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.

Conventions

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/

Hostname

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