Run Windows as the User VM OS

This tutorial describes how to launch Windows as a Guest (WaaG) User VM on the ACRN hypervisor.

ACRN Service VM Setup

Follow the steps in this Getting Started Guide to set up ACRN based on Ubuntu and launch the Service VM.

Setup for Using Windows as the Guest VM

In the following steps, you’ll first create a Windows image in the Service VM, and then launch that image as a Guest VM.

Verified Version

  • Windows 10 Version:

    • Microsoft Windows 10 Enterprise LTSC Evaluation

  • Windows graphics driver:

    • igfx_win10_100.9030.zip

    Note

    WHL needs the following BIOS setting: set DVMT Pre-Allocated to 64MB and set PM Support to Enabled.

Create a Windows 10 Image in the Service VM

Create a Windows 10 image to install Windows 10 onto a virtual disk.

Download Win10 Image and Drivers

  1. Download MediaCreationTool20H2.exe.

    • Run this file and select Create installation media(USB flash drive, DVD, or ISO file) for another PC; Then click ISO file to create Windows10.iso.

  2. Download the Oracle Windows driver.

    • Sign in. If you do not have an Oracle account, register for one.

    • Select Download Package. Key in Oracle Linux 7.6 and click Search.

    • Click DLP: Oracle Linux 7.6 to add to your Cart.

    • Click Checkout, which is located at the top-right corner.

    • Under Platforms/Language, select x86 64-bit. Click Continue.

    • Check I accept the terms in the license agreement. Click Continue.

    • From the list, right check the item labeled Oracle VirtIO Drivers Version for Microsoft Windows 1.1.x, yy MB, and then Save link as …. It is named V982789-01.zip.

    • Click Download. When the download is complete, unzip the file. You will see an ISO named winvirtio.iso.

Create a Raw Disk

Run these commands on the Service VM:

$ sudo apt-get install qemu-utils
$ mkdir /home/acrn/work
$ cd /home/acrn/work
$ qemu-img create -f raw win10-ltsc.img 30G

Prepare the Script to Create an Image

  1. Refer Enable GPU Passthrough (GVT-d) to enable GVT-d GOP feature; then copy above .iso files and the built OVMF.fd to /home/acrn/work

  2. Prepare WaaG install script, a /home/acrn/work/install_win.sh file should be created with the following content.

#!/bin/bash
function launch_win()
{
vm_name=win_vm$1
#check if the vm is running or not
vm_ps=$(pgrep -a -f acrn-dm)
result=$(echo $vm_ps | grep "${vm_name}")
if [[ "$result" != "" ]]; then
  echo "$vm_name is running, can't create twice!"
  exit
fi
echo "8086 9ded" > /sys/bus/pci/drivers/pci-stub/new_id
echo "0000:00:14.0" > /sys/bus/pci/devices/0000:00:14.0/driver/unbind
echo "0000:00:14.0" > /sys/bus/pci/drivers/pci-stub/bind
echo "8086 3ea0" > /sys/bus/pci/drivers/pci-stub/new_id
echo "0000:00:02.0" > /sys/bus/pci/devices/0000:00:02.0/driver/unbind
echo "0000:00:02.0" > /sys/bus/pci/drivers/pci-stub/bind
#for memsize setting
mem_size=4096M
acrn-dm -m $mem_size -s 0:0,hostbridge -s 1:0,lpc -l com1,stdio \
  -s 2,passthru,0/2/0 \
  -s 8,virtio-net,tap=tap0 \
  -s 4,virtio-blk,/home/acrn/work/win10-ltsc.img
  -s 5,ahci,cd:/home/acrn/work/Windows10.iso \
  -s 6,ahci,cd:/home/acrn/work/winvirtio.iso \
  -s 7,passthru,0/14/0,d3hot_reset \
  --ovmf /home/acrn/work/OVMF.fd \
  --windows \
  $vm_name
}
# offline Service VM CPUs except BSP before launching User VM
for i in `ls -d /sys/devices/system/cpu/cpu[1-99]`; do
        online=`cat $i/online`
        idx=`echo $i | tr -cd "[1-99]"`
        echo cpu$idx online=$online
        if [ "$online" = "1" ]; then
                echo 0 > $i/online
                # during boot time, cpu hotplug may be disabled by pci_device_probe during a pci module insmod
               while [ "$online" = "1" ]; do
                        sleep 1
                        echo 0 > $i/online
                        online=`cat $i/online`
                done
                echo $idx > /sys/devices/virtual/misc/acrn_hsm/remove_cpu
        fi
done
launch_win 1

Install Windows 10 by GVT-d

  1. Run install_win.sh

    cd /home/acrn/work/
    sudo chmod +x install_win.sh
    sudo ./install_win.sh
    

When you see the UEFI shell, input exit.

  1. Select Boot Manager and boot from Win10 ISO.

  2. When the display reads Press any key to boot from CD or DVD on the monitor, press any key in the terminal on the Host side.

    ../_images/windows_install_1.png
    ../_images/windows_install_2.png
    ../_images/windows_install_3.png
  3. Click Load driver.

    ../_images/windows_install_4.png
  4. Click Browser and go to the drive that includes the virtio Windows drivers. Select all under vio\w10\amd64. Install the following drivers into the image:

    • Virtio-balloon

    • Virtio-net

    • Virtio-rng

    • Virtio-scsi

    • Virtio-serial

    • Virtio-block

    • Virtio-input

    Note

    Be sure to unselect Hide Drivers that aren’t compatible with this computer’s hardware near the bottom of the page.

    ../_images/windows_install_5.png
  5. Click Next.

    ../_images/windows_install_6.png
  6. Continue with the installation.

    ../_images/windows_install_7.png
  7. Verify that the system restarts.

    ../_images/windows_install_8.png
  8. Configure your system when Windows completes its restart cycle.

    ../_images/windows_install_9.png
  9. Verify that the Windows desktop displays after the Windows installation is complete.

    ../_images/windows_install_10.png
  10. Download the Intel DCH Graphics Driver in Windows and install in safe mode. Version 27.20.100.9030 was verified on WHL. You should use the same version as the one in native Windows 10 on your board.

Boot Windows on ACRN With a Default Configuration

  1. Prepare WaaG launch script:

    cp /home/acrn/work/install_win.sh  /home/acrn/work/launch_win.sh
    

    Remove following lines in launch_win.sh

    -s 5,ahci,cd:/home/acrn/work/Windows10.iso \
    -s 6,ahci,cd:/home/acrn/work/winvirtio.iso \
    
  2. Launch WaaG

    cd /home/acrn/work/
    sudo ./launch_win.sh
    

The WaaG desktop displays on the monitor.

ACRN Windows Verified Feature List

Items

Details

Status

IO Devices

Virtio block as the boot device

Working

AHCI CD-ROM

Working

Virtio network

Working

Virtio input - mouse

Working

Virtio input - keyboard

Working

GVT-d

GVT-d with local display

Working

Tools

WinDbg

Working

Test cases

Install Windows 10 from scratch

OK

Windows reboot

OK

Windows shutdown

OK

Built-in Apps

Microsoft Edge

OK

Maps

OK

Microsoft Store

OK

3D Viewer

OK

Secure Boot Enabling

Refer to the steps in Enable Secure Boot in Windows for secure boot enabling.

Activate Windows 10

If you use a trial version of Windows 10, you might find that some apps and features do not work or that Windows 10 automatically gets shut down by the Windows licensing monitoring service. To avoid these issues, obtain a licensed version of Windows.

For Windows 10 activation steps, refer to Activate Windows 10.