From: Michael Vogt <michael.vogt@ubuntu.com>
Date: Wed, 25 May 2022 18:22:01 +0800
Subject: Truncate /etc/machine-id (in addition to /var/lib/dbus/machine-id)

Systemd is using a /etc/machine-id file that needs to be unique to the
local system. Just like we remove /var/lib/dbus/machine-id we truncate
/etc/machine-id. This will make systemd generate a new one on each boot.
---
 share/hooks/004-remove-dbus-machine-id.chroot | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/share/hooks/004-remove-dbus-machine-id.chroot b/share/hooks/004-remove-dbus-machine-id.chroot
index 230099e..6beac3b 100755
--- a/share/hooks/004-remove-dbus-machine-id.chroot
+++ b/share/hooks/004-remove-dbus-machine-id.chroot
@@ -7,3 +7,6 @@ set -e
 # This removes dbus machine id that cache that makes each system unique.
 
 rm -f /var/lib/dbus/machine-id
+
+# truncate, do not remove otherwise systemd is unhappy
+printf "" > /etc/machine-id
