Skip to content

Instantly share code, notes, and snippets.

@jfstenuit
Created December 19, 2025 07:31
Show Gist options
  • Select an option

  • Save jfstenuit/0b6ea522fc0d7f2ece385a9ff580fa97 to your computer and use it in GitHub Desktop.

Select an option

Save jfstenuit/0b6ea522fc0d7f2ece385a9ff580fa97 to your computer and use it in GitHub Desktop.
Windows 11 VM install

Install and prepare Windows 11 Pro (24H2)

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

Run debloater :

& ([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.

Disable hibernation

powercfg -h off

Clean up

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment