Install Windows on ARM on KVM

This article is a live note of my very recent attempt to install Windows on ARM on KVM, on a Raspberry Pi 4. Stay tuned for more updates!

Prerequisites

To follow this tutorial, you must be running a 64-bit operating system with a KVM-enabled kernel. If you're on Debian 11, you're invited to follow the wiki in order to get Virtual Machine Manager (virt-manager) installed. Otherwise, you need to make sure these packages are up to date:

libvirt0 >= 7.0.0
qemu >= 5.2
qemu-efi-aarch64 >= 2020
virt-manager >= 3.2.0

Then, you need to build a Windows Disc Image (ISO file) using UUP dump converters. I'm using the build 19041.1 in this tutorial, which is the latest public release build that can be built without Windows.

Finally, you need to grab the VirtIO drivers image here, without which you won't have access to the VirtIO disk in Windows Setup.

Launch KVM

In the Virtual Machine Manager, create a VM with the Generic OS variant. Then, modify the configuration as follows:

Serial 1 - Remove
Channel qemu-ga - Remove
Controller VirtIO Serial 0 - Remove

Add Hardware - Input - EvTouch USB Graphics Tablet - Finish
Add Hardware - Input - USB Keyboard - Finish
Add Hardware - Graphics - VNC Server - Finish

CPUs - vCPU allocation: 4 - Apply
Video Virtio - Model - Ramfb - Apply
Controller USB 0 - Model - USB 2 - Apply (for Windows 10)

SCSI CDROM 1 - Source path - /path/to/win.iso - Apply
Boot Options -
    1: VirtIO Disk 1
    2: SCSI CDROM 1 - Apply

The most important step here is to set CPU topology - Windows on ARM simply wouldn't boot with a single core.

Now power on the virtual machine. You may get stuck on Press any key to boot from CD or DVD for a minute or two, but that's okay, you should be able to boot into Windows Setup right after.

Install Windows

At this point, Windows Setup should not find the Windows image (WIM file), since SCSI CD-ROMs are not supported in Windows Setup. A simple solution is to write the disc image to an external USB drive, using p7zip:

7z x win.iso /path/to/drive

Then, pass it to the virtual machine:

Add Hardware - USB Host Device - /Your USB Drive/ - Finish

During the installation, you'll be prompted for a missing driver for the hard disk. Simply pass (again) the VirtIO drivers image via USB and select C:\viostor\w10\ARM64 as the driver path.

Install Drivers

To install VirtIO drivers, you must disable driver signature enforcement via Advanced Boot Options. After that, install the drivers in Device Manager (in particular NetKVM for network access and vioscsi for SCSI devices).

FAQ

libvirt configuration file?

See here.

Upgrade to Windows 11?

Although I'm on Windows 11, officially (via Windows Update), you can't, since:

  • Windows on ARM does not recognize itself as a VM,
  • Secure Boot cannot be enabled due to unsigned VirtIO drivers, and,
  • TPM 2.0 emulation fails on Windows on ARM.

There are of course well-known workarounds, but I'll recommend that you stay on Windows 10 until one of the fixes for the above issues is released.

Weijia Wang / 2021-08-06
Emakso 29.3 (Org-reĝimo 9.6.15) / Nix-konstruilo / 2024-06-21 12:13:10