Ubuntu 18.04 clones don't get new IP even with new MAC

This is for discussing general topics about how to use VirtualBox.
Post Reply
Lou Loizides
Posts: 5
Joined: 18. Dec 2017, 23:28

Ubuntu 18.04 clones don't get new IP even with new MAC

Post by Lou Loizides »

I have a base Ubuntu 18.04 server image that I clone in order to create new VMs. The VM has both an NAT and host-only adapter. Whenever I clone it I change the MAC addresses. But when I run ifconfig all of my host-only adapters across VMs have the same IP. Just to be safe I've shut them down, changed the MAC addresses again, and started them back up. Same thing. I've also tried releasing and renewing the DHCP addresses as well.

I'm running 6.0. I didn't have this problem in 5.x versions. Has anyone else experienced this? It's incredibly frustrating as I'm only able to run one VM at a time right now.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Ubuntu 18.04 clones don't get new IP even with new MAC

Post by scottgus1 »

Have you possibly set a static IP address on the source guest's Host-Only adapter?
Lou Loizides wrote:I'm only able to run one VM at a time right now.
You can change the Host-Only IP address inside each guest as a workaround until someone comes along with a solution.
Lou Loizides
Posts: 5
Joined: 18. Dec 2017, 23:28

Re: Ubuntu 18.04 clones don't get new IP even with new MAC

Post by Lou Loizides »

No, both interfaces are DHCP... thanks for the static IP suggestion but obviously it'll be a real pain to keep assigning those (I clone VMs every day).
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Ubuntu 18.04 clones don't get new IP even with new MAC

Post by mpack »

I don't think that Scott was suggesting that you use static IP addresses. He only asked if you were already doing so: and in fact I agree with his logic. AFAIK there are only a few reasons why two PCs would end up with the same IP :-
  1. You assigned the IPs manually, or (equivalently) the DHCP service has been disabled.
  2. The two PCs had the same MAC address last time they asked for an IP.
Post Reply