Windows 11 VM (LibVirt/KVM)

Suggested Reading

NOTE: See my Windows 10 VM article for a precursor to setting up and installing Windows 11

Software Prerequisites

sudo pacman -S swtpm

Windows 11 specific changes

Secure Boot

Setting Up Secure Boot requirement for Windows 11.

  <os>
    <type arch="x86_64" machine="pc-q35-5.1">hvm</type>
    <loader readonly="yes" type="pflash">/usr/share/OVMF/x64/OVMF_CODE.secboot.fd</loader>
    <nvram template="/usr/share/OVMF/x64/OVMF_VARS.secboot.fd">/var/lib/libvirt/qemu/nvram/win11_VARS.fd</nvram>
    <boot dev="hd"/>
    <bootmenu enable="yes"/>
  </os>

TPM

Adding TPM Module to the VM (for SecureBoot and etc):

<tpm model="tpm-crb">
  <backend type="emulator" version="2.0"/>
  <alias name="tpm0"/>
</tpm>