Skip to main content

Windows 11 - Clone VM

warning

Work in progress

Boot up a fresh Windows 11 VM. Do not make any modifications or changes. Open up Terminal (Admin) and paste in:

C:\Windows\System32\Sysprep\sysprep.exe /audit

The system will shutdown and may need to be manually started in Proxmox again. The system should automatically log in as administrator with Sysprep already started. Do not perform any system updates or install any software from the Microsoft Store.

For Sysprep to perform the required actions a few things need to be disabled. Open up a Terminal (Admin). If bitlocker was enabled (mine was) then it must be removed:

Disable-BitLocker -MountPoint "C:"

Update mountpoint to the appropriate drive letter. If encryiption was on, the drive will need to be decrypted which can take some time. To check the status run:

Get-BitLockerVolume -MountPoint "C:"

Next, OneDrive needs to be disabled and removed. Close and Exit OneDrive I had to first uninstall OneDrive through the "Add or Remove Software", then run:

Get-AppxPackage -AllUsers Microsoft.OneDriveSync | Remove-AppxPackage -AllUsers

Ensure it does not get reinstalled for new users. This is optional.

Get-AppxProvisionedPackage -Online | Where-Object DisplayName -EQ 'Microsoft.OneDriveSync' | Remove-AppxProvisionedPackage -Online

Remove Co-Pilot

Get-AppxPackage -AllUsers *CoPilot* | Remove-AppxPackage -AllUsers 
Get-AppxProvisionedPackage -Online | where-object {$_.PackageName -like "*Copilot*"} | Remove-AppxProvisionedPackage -Online 

Once system updates are complete, select "OOBE" option and check "Generalize" and "Shutdown". Then click "OK"