Start without a network interface in the configuration - will help to create local account
KMS key : W269N-WFGWX-YVC9B-4J6C9-T83GX
Even if there is no network interface in the system, recent Win11 versions still insist on "Let's connect you to a network".
- Press shift-F10
- Type
OOBE\BYPASSNRO - (system restarts)
- (Now you can click on "I don't have Internet")
Create a user account 'john' , a password , answer the three security questions Accept the most minimal data collection settings
Install Virtio drivers and qemu-guest-utils
In a privilege elevated CMD prompt :
Check Bitlocker and disable if needed :
manage-bde -status C:
manage-bde -off C:
manage-bde -protectors -disable C:
Enable built-in administrator account :
net user Administrator /active:yes
net user Administrator YourSecurePassword123
poweroff
Remove the two virtual CD-ROM Add a virtual network card
Remove the temp user (account and profile) via Settings > Accounts > Other Users
reboot
Have windows update itself
& ([scriptblock]::Create((irm "https://debloat.raphi.re/")))
Remove extra unwanted applications
Tune for performances / speed :
- Open Control Panel.
- Click on System and Security.
- Under the "System" section, click the "Allow remote access" option to open the legacy System Properties.
- Click the Advanced tab.
- Under the "Performance" section, click the Settings button.
- Click the Visual Effects tab.
- Select the "Adjust for best performance" option.
powercfg -h off
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
cleanmgr /sageset:1
cleanmgr /sagerun:1
net stop wuauserv
del /f /s /q %windir%\SoftwareDistribution\Download\*
net start wuauserv
(only if using qcow2 files - not required if using proxmox lvm-thin)
sdelete -z C:
(and on the libvirt host)
qemu-img convert -O qcow2 template-disk.qcow2 template-slim.qcow2
(or)
virt-sparsify --in-place template.qcow2
sysprep /oobe /generalize /shutdown
sysprep /generalize /shutdown /unattend:C:\Windows\System32\Sysprep\unattend.xml
Sysprep is likely to fail because of appxpackages not properly configured. Uninstall them.