Sometimes you got reasons to venture into the land of Microsoft, then a throwaway VM with a local account is a superb option. This is a brief guide how to setup a basic, optimized Windows 11 VM with Virtual Machine Manager.

Preparations#

  • Install Virtual Machine Manager - probably in your repo with the name virt-manager
  • Install any other requirements for virtualization on your distro
  • Ensure any Virtualization options is enabled in Bios.
  • Get a windows11 iso download here
  • Get virtio drivers iso download here

Setup#

  • Edit -> Preferences -> Enable XML editing
  • Create the VM but before Finish - check Customize conf before install
  • @Overview
    • Ensure Chipset: Q35 and Firmwre: UEFI
    • Edit XML - if AMD cpu, remove the <evmcs stat="on"/> line
    • Add the clock-section line where it belongs.
<hyperv mode="custom">
  <relaxed state="on"/>
  <vapic state="on"/>
  <spinlocks state="on" retries="8191"/>
  <vpindex state="on"/>
  <runtime state="on"/>
  <synic state="on"/>
  <stimer state="on">
    <direct state="on"/>
  </stimer>
  <reset state="on"/>
  <vendor_id state="on" value="KVM Hv"/>
  <frequencies state="on"/>
  <reenlightenment state="on"/>
  <tlbflush state="on"/>
  <ipi state="on"/>
  <evmcs state="on"/>
</hyperv>

# And in the <clock.... -section, add this line:
  <timer name="hypervclock" present="yes"/>
  • @CPUs enable host-passthrough
  • In Storage @SATA Disk 1
    • Disk bus: VirtIO
    • Cache mode: none
    • Discard mode: unmap
  • Mount VirtIO iso - @Add Hardware
    • Storage->Select->virtio-win.iso
    • Device type: CDROM device
  • @NIC - configure network
    • Device model: virtio
  • Remove @Tablet device
  • Add Guest Agent Channel @Add Hardware
    • Channel
    • Name: ..qemu.guest_agent..
  • Enable TPM @TPM vNone
    • Version: 2.0

Install#

  • When the step of selecting disk, if no disk found. Choose Load Driver.
    • Browse to w11/amd64 and click OK.
  • Optionally also add the network driver the same way: NetKVM/w11/amd64. (or do it after).

Install with local account, no Microsoft account.#

  • When the windows install goes graphical and let you choose region.
    • Click shift+F10 and write OOBE\BYPASSNRO - wait for it to restart.
    • Turn off the internet access now if network drivers are previously installed.
      • If you cant “physically” disable internet, push shift+F10 and write ipconfig /release after each restart during the installation.
  • Try again if it still requires Microsoft login (ensure internet connection is off).

Post install#

  • Install the complete VirtIO-package from the mounted CD, execute E:\virtio-win-gt-x64.msi.
    • After this you can remove the CD-device from the VM-settings.
  • Install Spice Guest binaries in the Windows VM to get display and other drivers, download here

Optional extras#

Enable 3D Acceleration.#

  • Turn off the VM and open the settings.
  • @Display Spice
    • Listen type: None
    • OpenGL: Check
      • Auto
  • @Video QXL
    • Model: Virtio
    • 3D acceleration: Check

Optimizing Windows#

Disable Copilot#

  • @Settings -> Personalisation -> Disable Copilot
  • Search gpedit for Group policy Editor
    • Browse to User configuration/Administrative templates/Windows components/Windows Copilot
      • Double click Turn off Windows Copilot
      • Check Enabled, Apply

Disable SuperFetch (uses unnecessary cpu+ram)#

  • @Services (Meta+R: services.msc)
  • find SysMain -> properties
    • Startup type: Disabled
    • Click Stop
  • Or alternatively with CMD:
    • sc stop “SysMain” & sc config “SysMain” start=disabled

Disable visual effects#

  • Search for “appearance” and click Adjust the appearance and performance.
  • Select Adjust for best performance

Disable unwanted auto starts#

  • @Task Manager -> Startup
    • Disable unwanted applications.
  • @Settings (Meta+I) -> Apps -> Startup
    • Disable unwanted applications.

Disable unwanted tracking / telemetry#

  • @Settings -> Privacy & Security -> Activity History ->
    • Disable Store my activity history
  • @Settings -> Privacy & Security -> Speech
    • Disable Online speech recognition
  • @Settings -> Privacy & Security -> Diagnostics and feedback
    • Disable Send optional diagnostic data
  • @Settings -> Personalization -> Start ->
    • Disable Show recommendations, tips, shortcuts, new apps and more

That’s it for installation! Do any further installation/customization necessary for your use case.

Further Reading:#

  • Take a look at quickemu for very easy pre-optimized VMs!