Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

Generalization

Direct answer

Generalization removes machine-specific identity from a template — hostname, SIDs, machine-id, SSH host keys, logs and network config — so every clone gets new, unique identity on first boot.

When to use this

Use this when preparing a template so clones get unique identity.

First 30 seconds

1. Generalisation removes host-specific identity: machine-id, SSH host keys, logs, MACs, hostname.

2. Linux: virt-sysprep or manual cleanup.

3. Windows: sysprep.

4. Duplicate IDs break DHCP, AD, monitoring.

5. Verify in clones.

Operational verification

template → identity removed → clone regenerates

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
virtualization-image
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformvirtualization-image
Scope / prerequisiteUse this when preparing a template so clones get unique identity.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Common mistakes Narrow the fault
  • Forgetting /etc/machine-id on Linux, causing duplicate DHCP DUIDs.
  • Leaving SSH host keys, so all clones share keys.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Windows templates are generalized with Sysprep.
Key checks
  • virt-sysprep -a <disk> --operations defaults — generalize Linux image
  • cat /etc/machine-id — should be empty in template
  • ls /etc/ssh/ssh_host_* — host keys removed in template
ReferenceWhy it matters1 section · depth on demand

Reference

  • Duplicate Windows SIDs matter mainly for domain-joined machines and some software; Sysprep is still the supported path.
  • On Linux, a duplicated /etc/machine-id breaks DHCP leases (same DUID) and systemd-journald identity.
ReferenceImportant terms & boundaries3 sections · depth on demand

In depth

Linux: what makes a clone a duplicate

ItemProblem when duplicatedGeneralisation step
/etc/machine-idSame DHCP client ID (systemd-networkd), same journal ID, confused monitoringEmpty the file (keep it present, zero length) so systemd generates a new ID at boot
SSH host keysClients see identical host keys; MITM warnings ignoredDelete /etc/ssh/ssh_host_*; regenerated at boot
Persistent network names / MAC in configNIC renamed or no network on the cloneRemove hard-coded MACs
Cloud-init stateCloud-init thinks first boot already happenedcloud-init clean --logs
Logs, shell history, temp filesLeak build informationClean

The virt-sysprep manual covers these as operations (machine-id, ssh-hostkeys, net-hwaddr, logfiles and more), applied to an offline image:

$ virt-sysprep -d tpl-debian12 --hostname localhost --operations defaults

Windows: sysprep

C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe /shutdown /unattend:C:\unattend.xml

/generalize resets the SID, removes device-specific drivers state and prepares OOBE. Never clone a domain-joined Windows VM without sysprep — duplicate SIDs and computer accounts break domain trust. Remove apps installed per-user from the Store before sysprep; they are a frequent cause of sysprep failure (see C:\Windows\System32\Sysprep\Panther\setupact.log).

Verify on the first clone

CheckCommand
New machine-idcat /etc/machine-id differs from the template
New SSH host keyssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
Unique Windows SIDwhoami /user (machine part) or PsGetSid
Cloud-init rancloud-init status --long → done

*The Linux and Windows guest generalisation examples above are illustrative examples, not captured from a lab or production host.*

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works

Generalisation removes machine-specific identity from an image before it becomes a template: Sysprep on Windows; clearing machine-id, SSH host keys, logs and cloud-init state on Linux.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docvirtualization-image current

Authoritative/upstream documentation reviewed for bounded claims in VM Templates → Generalization. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://libvirt.org/docs.html · confidence 94%
Confirmation

Confirm action

Continue?