Page 1 of 1

Adding a second network interface to VMs, host has only one

Posted: 16. Feb 2014, 05:22
by pdesjardins
Hi.

I am installing software that requires multiple network interfaces. I am running VirtualBox on a laptop that has only one network interface (eth0). Is there a way to configure my VMs so that they will have two network interfaces (eth0 and eth1)?

I am using a bridged network adapter for the VMs. They need access to the internet and must be reachable from the host. The second interface handles connections between the VMs only so I could use a more restricted type of virtual network.

I have tried enabling adapter two for the VMs and restarting. I tried a few different configuration for adapter two but the ifconfig command never shows an eth1 interface, only the existing eth0.

Am I misunderstanding the way VirtualBox networking interacts with the Linux network configuration? If I enable a host-only adapter two for each VM, do I need to tell Ubuntu to configure it as eth1? I thought/hoped making the adapter available would prompt Ubuntu to add it to the list of network interfaces automatically.

The guest OS I am using is Ubuntu Server 12.04. I am using VirtualBox 4.2.16_UBUNTU and the host OS is Ubuntu 13.10.

Thanks for your help!

Peter Desjardins

Re: Adding a second network interface to VMs, host has only

Posted: 16. Feb 2014, 11:03
by noteirak
If you only need the VMs to talk to each other, but not to the host, simple set the network interface mode to "Internal" and set the same network name on all the VMs.
Since you already have bridge interface, you can use that one to talk to the host. Else, you would need to use Host-Only.

Re: Adding a second network interface to VMs, host has only

Posted: 17. Feb 2014, 17:43
by pdesjardins
Thanks for the advice. I enabled adapter two on each of the VMs, set the "attached to" to "internal network", and used the same name "eth3" for each of the interfaces.

I reinstalled the guest Ubuntu Server OS after making these configurations but the ifconfig command does not show eth3 on any of the VMs. There's no sign of the eth3 interface in /etc/network/interfaces either.

Do you know how I can get the Linux guest OS to see the new interface as if it had two physical interface cards? Or does it sound like I didn't configure the VM correctly?

Thanks for your help.

Peter

Re: Adding a second network interface to VMs, host has only

Posted: 18. Feb 2014, 18:02
by pdesjardins
I figured out what was happening here. The new network interfaces were configured but I didn't realize that they need to be brought up explicitly. Using ifconfig -a I can see the new interfaces but they only appear in the ifconfig output after issuing a command such as:

ifconfig eth3 192.168.1.15 netmask 255.255.255.0 up

Thanks again for the help.