Ubuntu – changing the VM identifier after cloning

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:
cat /etc/machine-id
cat /var/lib/dbus/machine-idWe can now change it with the following commands
sudo rm /etc/machine-id
sudo systemd-machine-id-setupThis 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/>