Document:Installing Windows Server on QEMU (ARM64)

1. Download and install QEMU 2.11 for Windows for your respective architecture. 32-bit version. 64-bit version.

2. Download Linaro UEFI 15.12 64-bit and copy this file to your QEMU installation folder.

3. Download this git file and unpack it (using a tool such as 7-Zip) until you get the file named, then copy it to your QEMU installation folder.

4. Download USB Mass Storage UEFI driver for ARM64.

5. Download VirtIO CD-ROM driver for ARM64 and copy it to your QEMU installation folder.

6. Create needed VHD files using the  utility included with Windows. To do so, run the following commands. Note that these files will be created in a directory on your C drive called "arm64", and they will be mounted under the drive letters M, P, and W.

create vdisk file="C:\arm64\usb.vhd" maximum=4000 type=expandable

select vdisk file="C:\arm64\usb.vhd"

attach vdisk

convert gpt

create partition primary

format quick fs=fat32

assign letter=m

create vdisk file="C:\arm64\hdd.vhd" maximum=60000 type=expandable

select vdisk file="C:\arm64\hdd.vhd"

attach vdisk

convert gpt

create partition efi size=100

format quick fs=fat32

assign letter=p

create partition primary

format quick

assign letter=w

exit

7. Import the USB driver and system image by copying the file  to M:\ and then eject the M drive, and then mounting the ISO image of this build and running the following commands in an elevated command prompt (assuming that V is the letter of the drive you mounted the iso to):

dism /apply-image /imagefile:V:\sources\install.wim /index:1 /applydir:W:\

bcdboot W:\Windows /s P: /f UEFI

After that, eject P and W. Once ejected, P remains and disappears after a reboot.

8. Run QEMU by going to your QEMU installation folder, saving the following text to a batch file, and then running it to start the emulator:

For first time setup, this text instead allows you to connect the DVD-ROM drive:

qemu-system-aarch64 -M virt,virtualization=true -cpu cortex-a57 -smp 4 -m 2048 ^ -device qemu-xhci-device usb-kbd-device usb-tablet ^ -drive file=C:\arm64\hdd.vhd,if=virtio ^ -nic user,model=virtio ^ -drive file=.iso,media=cdrom,if=none,id=cdrom -device usb-storage,drive=cdrom ^ -bios QEMU_EFI.fd -device ramfb ^ -drive file=vars-template-pflash.raw,if=pflash,index=1

You will now need to run the following command in the UEFI internal shell to boot from the DVD image:. When you get to the choice of the HDD partition to install the system to, Setup will prompt you to load the HDD controller driver. You must load the drivers from the VirtIO driver CD located in the  folder.

9. If you want to change screen resolution (optional step), press F2 to enter EFI settings, enter  and then. Change the resolution to the desired one then commit the changes and exit. Choose  in the QEMU menu and then reset the emulator.

10. Load the USB driver and start the system by pressing F2 to enter the EFI settings, selecting, and then select. Enter a drive letter (such as ) in the shell and run the following commands:

(The above commands give you access to the USB drive)

(The above commands allow you to start the OOBE)

After the completion of the OOBE, you can boot into the system.

11. Log in. First, wait patiently for the configuration to complete, then do the following: Press Ctrl + Alt + 2 to switch to the QEMU Monitor and then input  and press Enter, then press Ctrl + Alt + 1 to switch back to the system display. Enter your password to log in.

Each time you reboot, you need to redo step 10.

12. If you want to make an automatic login (optional step), quit QEMU and mount. Run  on your host and click , then click on the menu item "File", then "Load Hive...", and open   (assuming that W is the letter you mounted the drive to). Give any name to the hive when prompted, then navigate to. Create a new string value named  and set its value to 1. Create another string value named  and set its value to. Then, create a third string value named  and set its value to the password you already set during the OOBE. Navigate back to, then click on the menu item "File", then "Unload Hive..." and choose "Yes" for the dialog box.