6

VB version: 4.2.16

Guest OS version: ubuntu 12.4 LTS

Host OS version: OSX 10.8.4

I have created two VMs. Each vm are given two network adaptors: NAT and Host-only.

It is how the host only adaptor is defined:

enter image description here

These are the screenshots from two instance of VirtualBox.

First VM

Second VM

It seems like both machines got an IP of 192.168.122.1 for interface virbr0.

As @kenster suggested, VB does not created a virbr0 interface. I do not know where does it come from.

And apparently eth0 comes from the NAT adaptor. Both VMs has the same IP for eth0. Here is screen shot from one of the VM:

enter image description here

Should I expect an eth1 from the second Host-only adaptor? If so, why it is not created?

Host-only dhcp setting in VB preference:

enter image description here

So, why VB assign same IP twice to both boxes?

5
  • Why don't you configure a static IP address on this interface for each machine ? This would force the DHCP configuration on virbr0. Commented Aug 12, 2013 at 16:42
  • Are you sure that is the host-only interface? According to cyberciti.biz/faq/… "virbr0" is a XEN interface. I have an Ubuntu VM running in virtualbox, and its host-only interface is named "eth1". In other words, the VM thinks it is an ethernet interface.
    – Kenster
    Commented Aug 12, 2013 at 17:23
  • did you clone the vms? in that case, you likely have dhcp cache or lease that causes the duplication. check /var/lib/dhcp3, delete everything, and restart networking.
    – johnshen64
    Commented Aug 12, 2013 at 17:23
  • @johnshen64 I did not clone the vms. There is only /var/lib/dhcp. Clearing it does not resolve the issue. Thanks. Commented Aug 12, 2013 at 17:40
  • @Kenster Interesting. I did not know why I got this interface then. I actually setup two adaptors for each VMS: first one NAT and second one Host-only. Apparently only the first one is ever created. Will update my question with more details. Commented Aug 12, 2013 at 17:42

5 Answers 5

3

Sorry for a lot of noise in the question.

Basically it is what happened:

1) I use only one network adaptor (NAT) when I first created both VM

2) I then added one more Host-only adaptor in VirtualBox and expecting, incorrectly, the new interface will appear in ifconfig

Solution to my issue

Add the new eth1 in the /etc/network/interface and restart network.

2

If you have created a clone from one that you have already created, check the MAC address of both the installations.

If the MAC addresses are the same, change the MAC address on one of the machines and restart it.

1
  • Not sure why you got marked down. This answered the question for me. +1
    – MagicLAMP
    Commented Jun 26, 2017 at 13:55
1

Remove the kernel’s networking interface rules file so that it can be regenerated

# rm -f /etc/udev/rules.d/70-persistent-net.rules
# reboot

it will work for your clone VM.

1
  • The question is about Ubuntu not RHEL/CentOS.
    – marcv81
    Commented Dec 8, 2014 at 23:29
1

I had same problem, regenerating MACs addresses didn't fix, what worked for me: sudo dhclient eth1 (use your host-only interface) from the first vbox. Then the problem was fixed, others vbox started with correct ip released by dhcp

-1

Another way of fixing this issue is to change network from NAT to bridge. Worked in my case.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .