WoA on qemu (2025 ver)
prepare for macvtap.
the default 52:54:00:12:34:56
mac address is unchanged and the windows instance would be activated by others' license.
sudo ip link add link eth0 name macvtap0 type macvtap mode bridge ||:
sudo sysctl -w net.ipv6.conf.macvtap0.autoconf=0
sudo sysctl -w net.ipv6.conf.macvtap0.disable_ipv6=1
sudo ip link set macvtap0 allmulticast on address 52:54:00:12:34:56 up ||:
TAP=tap$(cat /sys/class/net/macvtap0/ifindex)
sudo chown USER /dev/$TAP
optional: share the sd card as virtio-blk (the user needs to be in group disk, and kvm)
MMC=""
[ -b /dev/mmcblk0 ] && MMC="-drive file=/dev/mmcblk0,if=none,id=sd,format=raw,cache=none,aio=native -device virtio-blk-pci,disable-legacy=on,drive=sd"
Note: this is not for first setup.
qemu-system-aarch64 -nographic -nodefaults -M virt,accel=kvm,usb=off -cpu host -m 3100M -smp 4 \
-monitor unix:/dev/shm/qemu-monitor-socket,server,nowait \
-device virtio-keyboard -device virtio-tablet \
-drive file=/dev/nvme0n1,if=none,id=nvme,format=raw,cache=none,aio=native -device virtio-blk-pci,disable-legacy=on,drive=nvme $MMC \
-device pcie-root-port,bus=pcie.0,id=root_port1 -device pcie-root-port,bus=pcie.0,id=root_port2 \
-drive if=pflash,format=raw,unit=0,readonly=on,file=/usr/share/AAVMF/AAVMF_CODE.fd -drive if=pflash,format=raw,unit=1,file=AAVMF_VARS.ms.fd \
-netdev tap,id=net0,fd=3,vhost=on,vhostfd=4 -device virtio-net,netdev=net0,disable-legacy=on,mac=52:54:00:12:34:56 3<>/dev/$TAP 4<>/dev/vhost-net
monitor console can be accessed via socat, use Ctrl-C to quit.
dont type quit, otherwise the VM will shutdown :(.
socat -,echo=0,icanon=0 unix-connect:/dev/shm/qemu-monitor-socket
optional: hotplug in monitor console.
multifunction=on is required on first device on certain bus, and you should use the same type of devices under that bus, so prepare multiple pcie-root-port(s) in advance.
#drive_add 0 blahblah
#device_add virtio-blahblah,bus=root_port1,multifunction=on
optional parameters for installation (remove usb=off in -M):
-device ramfb -vnc 0.0.0.0:0
-device nec-usb-xhci,id=xhci0 -device nec-usb-xhci,id=xhci1 -device usb-kbd -device usb-tablet
# -drive file=/path/to/isofile,media=cdrom,if=none,id=inst -device usb-storage,drive=inst
# -device nvme,serial=00000000,drive=nvme
Windows drivers can be found in Microsoft Update Catalog.
https://www.catalog.update.microsoft.com/Search.aspx?q=PCI%5CVEN_1AF4
the most important ones are:
(netkvm modern) PCI\VEN_1AF4&DEV_1041
(virtio-blk modern) PCI\VEN_1AF4&DEV_1042
sadly currently there is no WHQL virtio-scsi drivers for windows arm64 (early 2025), so the number of disk drives are limited by pci(e) slots. I dont want to disable signature checks :(