Guide updated to use the official installation .iso from Microsoft, which finally became available in Dec. 2024! For the VHDX disk image based guide check an earlier version of this gist.
When following this guide on a host not capable of aarch64 virtualization, replace -cpu host -accel kvm
with -cpu max
.
- Download the installation .iso from https://www.microsoft.com/en-us/software-download/windows11arm64. Win11_24H2_EnglishInternational_Arm64.iso is known to work.
- Download the the latest virtio-win.iso from https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/.
- Create a disk image for the Windows installation:
qemu-img create -f qcow2 win11.qcow2 25G
- Start the installation with generic (ramfb for display, usb-storage for .isos) as well as virtio (virtio-gpu-pci, virtio-block) devices:
qemu-system-aarch64 -M virt -cpu host -accel kvm -m 4G -smp 4 -device ramfb -device virtio-gpu-pci -bios /usr/share/qemu/qemu-uefi-aarch64.bin -device qemu-xhci -device usb-kbd -device usb-tablet -drive file=Win11_24H2_EnglishInternational_Arm64.iso,media=cdrom,if=none,id=inst -device usb-storage,drive=inst -drive file=virtio-win.iso,media=cdrom,if=none,id=iso -device usb-storage,drive=iso -drive file=win11.qcow2,if=virtio -nic user,model=virtio-net-pci,mac=2A:50:A7:4E:D9:C4
. At least since build 25931, it's necessary to provide a network connection to finish the initial setup. The default QEMU MAC address will result in a false UUID match with some AutoPilot enrolled devices, forcing an "Intellek" domain login. To avoid that, use a different MAC address, e.g. one from https://duckduckgo.com/?q=random+mac+addr&ia=answer. The one from the QEMU man page is meanwhile bound to NVIDIA (argh!). To have a higher resolution with ramfb, enter the OVMF setup by pressing F10 during boot, change the preferred resolution to 1024x768 and reset. - In the setup dialog appears, proceed until the keyboard layout is configured but not further.
- Press Shift-F10 to open cmd.exe and run
regedit
. Navigate toHKEY_LOCAL_MACHINE/SYSTEM/Setup
, create a key (aka. folder) calledLabConfig
and inside that two DWORDsBypassTPMCheck
andBypassSecureBoot
and set both of them to 1. Alternatively you can also use a SB-enabled OVMF as bios and provide a TPM, but I haven't tried that (and IMO especially the SB requirement is absolute bullshit anyway). - Proceed to the drive selection. Be aware that if you read the license agreement, you'll probably want to throw your computer out of the window.
- Load the virtio-blk driver by going to the
E:\viostor\w11\ARM64
folder and selecting the driver that appears in the dialog (don't be confused: the driver title includes SCSI, but it's for virtio-blk). - Continue with the installation until the OOBE welcome wizard. It'll take ages (>30min here!) at "Installing 42%" for some reason.
- Complete the setup until it asks for network. Use the "Install driver" button to install the virtio-gpu driver first (!) by navigating to
E:\viogpudo\w11\ARM64
and letting it install the driver. After that completes, use the button and navigate toE:\NetKVM\w11\ARM64
and let it install the driver, followed by a reboot. You can shut down the VM at that point. - Now the generic devices can be omitted:
qemu-system-aarch64 -M virt -cpu host -accel kvm -m 4G -smp 4 -device virtio-gpu-pci -bios /usr/share/qemu/qemu-uefi-aarch64.bin -device qemu-xhci -device usb-kbd -device usb-tablet -drive file=win11.qcow2,if=virtio -nic user,model=virtio-net-pci,mac=2A:50:A7:4E:D9:C4
. The first boot will take a while with a disabled display, be patient (if it does not work, add-device ramfb
and use it for troubleshooting), - Complete the setup as usual. To avoid using a Microsoft account, use Shift-F10 and run
oobe\bypassnro
.
Somehow I managed to get a BSOD of BUGCODE_USB3_DRIVER, Build 22589