You can use some network. For example, NAT and Host-only, NAT for external , Host-only for PC.
https://www.virtualbox.org/manual/ch06.html
Modes | Guest → external | Guest ←→ Guest | Host PC → Guest |
---|---|---|---|
Bridged networking | OK | OK | OK |
Network Address Translation (NAT) | OK | NG | NG (OK : Portfoward) |
NAT Network | OK | OK | NG (OK : Portfoward) |
Host-only networking | NG | OK | OK |
Internal networking | NG | OK | NG |