Windows 11 QEMU Config July 2, 2023
#!/bin/bash
#-boot d \
#-cdrom win_10_pro_64.iso \
#-cdrom QuickBooks2013InstallCD.iso \
#-monitor stdio \
#-cdrom $HOME/ISOs/Win11_22H2_English_x64v2.iso \
#-drive file=$HOME/VMs/Windows_C.img,format=raw,index=0,media=disk
#-nic none \
# TPM setup
tmpdir=$(mktemp -d)
swtpm socket \
--tpmstate dir=${tmpdir} \
--ctrl type=unixio,path=${tmpdir}/swtpm-sock \
--tpm2 &
# QEMU setup
qemu-system-x86_64 \
-name win11 \
-cpu host \
-enable-kvm \
-m 8G \
-bios /usr/share/ovmf/OVMF.fd \
-chardev socket,id=chrtpm,path=${tmpdir}/swtpm-sock \
-tpmdev emulator,id=tpm0,chardev=chrtpm \
-device tpm-tis,tpmdev=tpm0 \
-vga vmware \
-smp cores=2,threads=2 \
-usb \
-device usb-tablet \
-device usb-host,vendorid=0x0525,productid=0xa4a1 \
-device usb-host,vendorid=0x1c99,productid=0x0002 \
-device usb-host,vendorid=0x058f,productid=0x6387 \
-rtc clock=host,base=localtime \
-drive file=$HOME/VMs/Windows11.qcow2,format=qcow2,index=0,media=disk