proxmox

How to Create and Use Proxmox VM Templates

Then enable the Guest Agent option in the VM’s Proxmox Options tab, which improves shutdown handling and provides more accurate VM status information.

Cleaning Up Machine-Specific Identifiers

Before converting to a template, remove identifiers that shouldn’t be duplicated across clones:

sudo truncate -s 0 /etc/machine-id
sudo rm /var/lib/dbus/machine-id
sudo ln -s /etc/machine-id /var/lib/dbus/machine-id

Also clear SSH host keys so each cloned VM generates its own unique keys on first boot:

sudo rm /etc/ssh/ssh_host_*

Converting the VM to a Template

Shut down the VM completely, then in the Proxmox web UI:

  1. Right-click the VM in the sidebar.
  2. Select Convert to Template.

The VM icon changes to indicate it’s now a template and can no longer be started directly.

Cloning a New VM from the Template

  1. Right-click the template.
  2. Select Clone.
  3. Choose a new VM ID and name.
  4. Select Clone Mode:
    • Full Clone – creates an entirely independent copy of the disk, using more storage but with no dependency on the original template
    • Linked Clone – much faster and more storage-efficient, but requires the original template to remain intact since new VMs reference its base disk

First Boot After Cloning

On first boot, the cloned VM regenerates its machine ID and SSH host keys (thanks to the cleanup steps above), ensuring each clone behaves as a genuinely unique system rather than an identical duplicate causing network conflicts.

Building Multiple Templates for Different Use Cases

Consider maintaining a few different base templates tailored to common needs — a minimal Debian template for lightweight services, an Ubuntu template with Docker pre-installed for container workloads, and perhaps a template with monitoring agents pre-configured for services you want observability on immediately.

Updating a Template Over Time

Since templates represent a frozen point-in-time configuration, periodically refresh them: clone the template into a regular VM, apply updates and any new baseline changes, then convert that updated VM into a new template to keep future clones reasonably current.

Final Thoughts

Building Proxmox VM templates turns repetitive VM setup work into a one-time investment, letting you spin up new, ready-to-configure servers in seconds rather than repeating the same installation steps every time. For any homelab where you’re regularly creating new VMs — testing environments, new services, or disposable sandboxes — templates are one of the highest-value Proxmox features to set up early.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *