After cloning a VM template, we need to change things to make us stay out of trouble.

SSH to the machine and do these things.


export NEW_HOSTNAME='newhost0'

Machine ID

Change machine ID.

sudo apt-get dist-upgrade
sudo rm /var/lib/dbus/machine-id
sudo rm /etc/machine-id
sudo systemd-machine-id-setup
sudo ln -s /etc/machine-id /var/lib/dbus/


echo " $NEW_HOSTNAME" | sudo tee -a /etc/hosts
sudo hostnamectl set-hostname $NEW_HOSTNAME