andsens/bootstrap-vz

/etc/machine-id is not unset

Closed this issue · 1 comments

/etc/machine-id is not unset, so each VM created from the image has the same, not unique machine ID.

Valid solution is removing content (not the whole file) of /etc/machine-id. I think that it is safe to also clear /var/lib/dbus/machine-id (contains D-Bus machine ID) if it exists (package dbus is installed).

From systemd documentation https://www.freedesktop.org/software/systemd/man/machine-id.html

The /etc/machine-id file contains the unique machine ID of the local system that is set during installation or boot.

For operating system images which are created once and used on multiple machines, for example for containers or in the cloud, /etc/machine-id should be an empty file in the generic file system image. An ID will be generated during boot and saved to this file if possible. Having an empty file in place is useful because it allows a temporary file to be bind-mounted over the real file, in case the image is used read-only.

Good point. Send a PR and I'll merge.