Use this when generalizing Windows for cloning.
Sysprep
Sysprep generalizes a Windows installation (sysprep /generalize /oobe /shutdown) so a template can be cloned with new SIDs and computer names. An unattend.xml answer file automates the first-boot setup.
1. Sysprep generalises Windows: new SID, hardware detection, OOBE.
2. Required before templating Windows.
3. Remove per-user Appx packages that block it.
4. Use unattend.xml for automation.
5. Limited rearms.
installed Windows → sysprep generalize → shut down → template
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Checks Verify boundary
C:\Windows\System32\Sysprep\Panther\setupact.logwithout errors.- VM shuts down after Sysprep.
- New SID after deployment (
whoami /user).
Step 2 Common mistakes Narrow the fault
- Running Sysprep more than the rearm limit allows.
- Store apps (Appx) installed per user, causing Sysprep to fail — check
C:\Windows\System32\Sysprep\Panther\setupact.log. - Joining the template to the domain before Sysprep.
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.
- Windows limits how many times an image can be rearmed.
C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe /shutdown— generalize WindowsGet-Content C:\Windows\System32\Sysprep\Panther\setupact.log— sysprep logGet-AppxPackage -AllUsers | ? PackageUserInformation -match Installed— provisioned apps blocking sysprep
ReferenceImportant terms & boundaries2 sections · depth on demand
Reference
C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe /shutdown /unattend:C:\unattend.xml
Documented example, not captured output. Remove the VM from the domain first and uninstall per-user Appx packages that block Sysprep.
In depth
Sysprep generalises a Windows installation before it becomes a template: it removes the machine SID, computer name, driver state and activation data so each clone gets a unique identity at first boot.
C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe /shutdown /mode:vm [/unattend:C:\unattend.xml]
/mode:vm skips hardware re-detection when deploying to the same hypervisor. Common failures: Appx packages installed per user (remove them), more than 8 rearm attempts, and BitLocker enabled on the template. Never clone a domain-joined, non-generalised Windows VM — duplicate SIDs and computer accounts break domain trust.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in VM Templates → Sysprep. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://libvirt.org/docs.html · confidence 94%