Network config for Linux VMs on a laptop
I run a bunch of Linux (mostly Ubuntu) VMs on my main machine at home, which happens to be a laptop. I use VirtualBox, but what I have to say here is probably applicable to most host based virtualisation environments.
My requirements are pretty simple:
- The VMs need to be able to access the Internet via whatever connection the laptop has.
- Internet access should continue to work if I switch between wired and wireless connections (e.g. if I undock the laptop and take it into the lounge).
- I need to be able to access the VMs over SSH using PuTTY.
- Not attached – obviously
- NAT – provides Internet access, but doesn’t give an IP that I can SSH to
- Bridged – makes me choose between wired or wireless
- Internal network – doesn’t do any of the things I want (at least not without much extra work/plumbing)
- Host only – doesn’t give me Internet access
- Generic driver – don’t even go there
- NAT – appears as eth0 – provides Internet access whether I’m using wired or wireless
- Host only – appears as eth1 – provides an IP that I can connect to using PuTTY
# Host only interface auto eth1 iface eth1 inet dhcp
Filed under: howto, technology | 2 Comments
Tags: bridged, eth0, eth1, host only, howto, internal, Linux, NAT, network, networking, Putty, SSH, Ubuntu, VirtualBox, virtualisation, virtualization