Photon OS 3.0 Template Gotcha

Published · Read in about 2 min (275 words)

Photon OS is VMware’s minimal Linux distribution, and in a small project in the lab I thought I should use it for some small lightweight Veeam Backup & Replication v10 Linux proxies. After deploying it, and converting it to a template, I ran into some very frustrating authentication issues after deployment. To make a very long troubleshooting story short, I forgot to ensure that a new unique machine-id was created, wrecking havoc with, amongst other things, the DHCP server assignments.

From the machine-id man page #

The /etc/machine-id file contains the unique machine ID of the local system that is set during installation or boot. The machine ID is a single newline-terminated, hexadecimal, 32-character, lowercase ID. When decoded from hexadecimal, this corresponds to a 16-byte/128-bit value. This ID may not be all zeros.

So remember, if you want to use Photon OS (and many other Linux distributions) as a template in vSphere, make sure the last command you run before shutting down and converting to a template, forces generation of a new machine-id.

The quickest way I thought of forcing this, is to run the following command:

 echo -n > /etc/machine-id

This simply overwrites the /etc/machine-id file with a new empty one, forcing a new machine-id to be generated at the next boot.


This is not a Photon OS specific issue as such, more a general Linux (and FreeBSD) one, but it was in Photon OS it came back to bite me. In many regards it’s akin to not forcing a new Security ID (SID) to be created for cloned Windows VMs, which also causes all sorts of problems, especially for domain joined machines.

Post last updated on January 2, 2024: Update copyright to 2024

About is the digital home of Christian Mohn and Stine Elise Larsen.

The primary focus is on IT architecture and data center technologies like virtualization and related topics, but other content also pops up from time to time.