linuxubuntu

Ubuntu – changing the VM identifier after cloning

1 min read

When you clone a virtual machine, it is good practice to change that virtual machine’s identifier.

To check the current machine-id, we can run the following command:

text
cat /etc/machine-id
cat /var/lib/dbus/machine-id

We can now change it with the following commands

text
sudo rm /etc/machine-id
sudo systemd-machine-id-setup

This command changes the machine-id stored in the two files listed above.

We should reboot the virtual machine to make sure all services are working correctly. Depending on the scenario, it may also be important to change the hostname. For that, see the article: </en/ubuntu-change-hostname/>

#ubuntu