Testing qemu-system-aarch64 on Windows
This document explains how to test the QEMU AArch64 emulator on a Windows host.
Page Contents
Video Demonstration
Preparing the Virtual Machine
These steps only need to be completed once when the virtual machine is first created. When restarting the VM at a later time, simply double-click the batch file.
- Download the latest Alpine Linux “Virtual” ISO file for the aarch64 architecture.
- Create a dedicated folder on your host system to contain this virtual machine.
- Move the downloaded ISO file from the first step into the newly created folder.
- Copy the edk2-arms-vars.fd file from C:\Program Files\qemu\share into the new folder.
- Open the command interpreter or PowerShell, and use the cd command to navigate to the folder you created.
- Create the disk image by running the following command:
qemu-img create -f qcow2 alpine.qcow2 40G
- Proceed to create a batch file (in the same folder) to run QEMU. An example is shown in the next section.
- You should be able to run the virtual machine by double-clicking the batch file in Explorer.
Batch File
I have improved the batch file from the version I used when creating the video. In particular, this version correctly uses the edk2-arm-vars.fd file. Save the batch file into the same folder you prepared above.
:: Alpine Linux (AArch64)
qemu-system-aarch64 ^
-name "Alpine Linux AArch64" ^
-machine type=virt,iommu=smmuv3 ^
-accel tcg ^
-cpu cortex-a57 ^
-m 2048 ^
-rtc base=utc ^
-drive if=pflash,format=raw,file="C:\Program Files\qemu\share\edk2-aarch64-code.fd",readonly=on ^
-drive if=pflash,format=raw,file=edk2-arm-vars.fd ^
-drive file="alpine.qcow2",if=virtio,format=qcow2 ^
-drive file="alpine-virt-3.16.2-aarch64.iso",format=raw,readonly=on ^
-boot menu=on ^
-display gtk ^
-device virtio-vga ^
-nic user,id=NAT,model=virtio-net-pci,mac=02:00:00:00:00:01 ^
-device qemu-xhci ^
-device usb-kbd ^
-device usb-tablet
echo QEMU has finished
pause
If a newer version of Alpine Linux has been released, be sure to edit the 4th “-drive” argument accordingly. You should be able to run the VM by double-clicking the batch file.