Cloned VM has same ip address as original

Nucker

Member
Mar 28, 2022
10
1
8
I have a VM running ubuntu server 22.04. When I clone it, the new vm has the same internal ip, however they have a different macaddress in the network device in my vm's hardware. Even following tutorials to give it a different mac address in software doesn't work.
 
Well, do you define the IP address manually in the VM or do they get it via DHCP? If it is manually configured, you will have to change it manually.
 
I
I have a VM running ubuntu server 22.04. When I clone it, the new vm has the same internal ip, however they have a different macaddress in the network device in my vm's hardware. Even following tutorials to give it a different mac address in software doesn't work.

I had this issue. If I understand the root cause correctly, some DHCP servers are using client ID, not MAC address to assign IP addresses. You will need to reset the machine id before cloning. I used the commands below and it worked for me:

Code:
echo -n >/etc/machine-id
rm /var/lib/dbus/machine-id
ln -s /etc/machine-id /var/lib/dbus/machine-id
 
I


I had this issue. If I understand the root cause correctly, some DHCP servers are using client ID, not MAC address to assign IP addresses. You will need to reset the machine id before cloning. I used the commands below and it worked for me:

Code:
echo -n >/etc/machine-id
rm /var/lib/dbus/machine-id
ln -s /etc/machine-id /var/lib/dbus/machine-id
all dhcp server using MAC as identifier.
 
all dhcp server using MAC as identifier.
i need to correct myself
the option 61 is the "client-ID" or client identifier

Two main options are used in this case: the vendor class identifier (option 60) and the client identifier (option 61). Client identifier is unique and helps the DHCP server to manage its clients and leases, it is generally set to the MAC address of the network interface on a local network. The vendor class identifier is more interesting, as it identifies the vendor type and configuration of a DHCP client in a simple character string. The format is open and can be interpreted by the server in order to adjust the answer options and content.
 
I


I had this issue. If I understand the root cause correctly, some DHCP servers are using client ID, not MAC address to assign IP addresses. You will need to reset the machine id before cloning. I used the commands below and it worked for me:

Code:
echo -n >/etc/machine-id
rm /var/lib/dbus/machine-id
ln -s /etc/machine-id /var/lib/dbus/machine-id
Thanks, it worked for me as well.
 
I


I had this issue. If I understand the root cause correctly, some DHCP servers are using client ID, not MAC address to assign IP addresses. You will need to reset the machine id before cloning. I used the commands below and it worked for me:

Code:
echo -n >/etc/machine-id
rm /var/lib/dbus/machine-id
ln -s /etc/machine-id /var/lib/dbus/machine-id
I am running into the same issue, but I'm pretty green. Am I just running those on the host's shell or in the particular VM?
 
I


I had this issue. If I understand the root cause correctly, some DHCP servers are using client ID, not MAC address to assign IP addresses. You will need to reset the machine id before cloning. I used the commands below and it worked for me:

Code:
echo -n >/etc/machine-id
rm /var/lib/dbus/machine-id
ln -s /etc/machine-id /var/lib/dbus/machine-id
This worked for me too. Using Ubuntu 24.04.
In fact I only did
> dbus-uuidgen > /etc/machine-id
and then rebooted.
 
  • Like
Reactions: fuho
Ok, many thanks for this workaround. But.. something has changed: this is a new behaviour - either because of Ubuntu 22.04 or Proxmox.

Any thoughts what could cause this? This smells like a bug but not sure where.
 
# dbus-uuidgen > /etc/machine-id
Thanks a lot!

I thought I was going to save myself time by converting the first ubuntu 24.04.3 server to a template and then cloning the workers from it, but instead.... well no, I actually still probably saved time I think :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!