2

I'm aware that VirtualBox assigns the same IP to different VMs (by default 10.0.2.15), however I have a case where I have a VM with a single vNIC, and a Linux namespace inside the VM attempts to get an IP from DHCP, and it gets the same IP from VirtualBox. So both eth0 and the other interface inside my network namespace have the same IP address, which is obviously wrong.

Is there a way to have VirtualBox correctly return different DHCP responses or is it a limitation of VirtualBox that it doesn't correctly handle DHCP requests coming from different source MAC addresses from the same VM?

1 Answer 1

1

In NAT networking mode, VirtualBox machines can talk to the Internet, but not to each other.

In host-only networking mode, the virtual machines can talk to each other, but not to the Internet. (Though you could NAT them manually if you are on a Linux or FreeBSD host.)

Another option is VDE networking; this is only available in the community edition, and not the Oracle edition of VirtualBox, and only on Linux and FreeBSD hosts. It's much more involved to set up, but would do what you want once done.

The fastest and easiest way to set this up is, of course, bridged mode.

2
  • 1
    Thanks but this isn't very relevant to my question. I said I have only one VM involved. I want that single VM, which has a single vNIC, to be assigned two IP addresses by VirtualBox's DHCP.
    – tsuna
    Jan 24, 2013 at 7:12
  • tsuna@ Yes. And a bridged interface can be assigned multiple IPs. Does not answer your question, but points you in the right direction. Sep 26, 2020 at 8:06

You must log in to answer this question.

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