In setting up virtual machines with VirtualBox, I often want the following characteristics
- VM has a static IP
- host can access VM without port forwarding
- VM can access the internet
- I can move my laptop from network to network (e.g. from home to office to coffee shop) without worrying about securing or reconfiguring the VM
None of the VirtualBox network connection methods satisfies these requirements on their own.
NAT
Requires port forwarding if you want to connect to the VM from the host.Host-only
The VM can not access the internet unless the host is a router.Bridged
Exposes the VM to the network; not portable.