Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
---
title: Windows on Arm virtual machine creation using Arm Linux, QEMU, and KVM

draft: true
cascade:
draft: true
title: Automate Windows on Arm virtual machine deployment with QEMU and KVM on Arm Linux

minutes_to_complete: 90

who_is_this_for: This is for developers and system administrators who want to automate Windows on Arm virtual machine (VM) creation on Arm Linux systems using QEMU and KVM.
who_is_this_for: This is an introductory topic for developers and system administrators who want to automate Windows on Arm virtual machine (VM) creation on Arm Linux systems using QEMU and KVM.

learning_objectives:
- Understand the process of creating Windows on Arm virtual machine using Bash scripts.
- Run scripts for VM creation and management.
- Troubleshoot common VM setup and runtime issues.
- Use Windows on Arm virtual machines for software development and testing.
- Understand the process of creating a Windows on Arm virtual machine using Bash scripts
- Run scripts for VM creation and management
- Troubleshoot common VM setup and runtime issues
- Use Windows on Arm virtual machines for software development and testing

prerequisites:
- An Arm Linux system with KVM support and a minimum of 8GB RAM and 50GB free disk space.
- An Arm Linux system with KVM support and a minimum of 8GB RAM and 50GB free disk space

author: Jason Andrews

Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
---
title: System requirements
title: Check system requirements
weight: 2

### FIXED, DO NOT MODIFY
layout: learningpathall
---

If you are building and testing Windows on Arm software you have a variety of options to run Windows on Arm. You can use local laptops, cloud virtual machines, and CI/CD platforms like GitHub Actions for development tasks.

You can also use a local Arm Linux server to create virtual machines for Windows on Arm software development tasks. This Learning Path explains how to install and use Windows on Arm virtual machines on an Arm Linux system. Two scripts are provided to create and run Windows on Arm virtual machines to make the process easy.
## Prepare your system for Windows on Arm virtual machines

Before creating a Windows on Arm virtual machine, ensure your Arm Linux system meets the hardware and software requirements. This section covers everything you need to prepare to create a Windows on Arm virtual machine using QEMU and KVM.
To build and test Windows on Arm software, choose from several flexible options: run Windows on Arm locally, use cloud-based virtual machines, or leverage CI/CD platforms like GitHub Actions. For hands-on development, set up a Windows on Arm virtual machine directly on your Arm Linux server.

## Hardware requirements
In this Learning Path, you'll install and use Windows on Arm virtual machines on an Arm Linux system. Two easy-to-use scripts are included to streamline the creation and management of your virtual machines. Before you get started, make sure your Arm Linux system meets the hardware and software requirements. In this section, you'll set up everything you need to create a Windows on Arm virtual machine using QEMU and KVM.

You need an Arm Linux system with enough performance, memory, and storage to run a Windows on Arm virtual machine.
## Check hardware requirements

The provided scripts have been tested on a [Thelio Astra](https://system76.com/desktops/thelio-astra-a1.1-n1/configure?srsltid=AfmBOoplXbwXifyxppxFe_oyahYMJHUT0bp2BnIBSH5ADjqgZxB7wW75) running Ubuntu 24.04.
You need an Arm Linux system with enough performance, memory, and storage to run a Windows on Arm virtual machine. You can use the scripts on a [Thelio Astra](https://system76.com/desktops/thelio-astra-a1.1-n1/configure?srsltid=AfmBOoplXbwXifyxppxFe_oyahYMJHUT0bp2BnIBSH5ADjqgZxB7wW75) running Ubuntu 24.04, where they have been tested successfully.

Thelio Astra is an Arm-based desktop computer designed by System76 for autonomous vehicle development and other general-purpose Arm software development. It uses the Ampere Altra processor, which is based on the Arm Neoverse N1 CPU, and ships with the Ubuntu operating system.

Other Arm Linux systems and other Linux distributions are possible, but have not been tested. General hardware requirements are listed below.
You can try these scripts on other Arm Linux systems or distributions, but only the configuration above has been tested. Check the general hardware requirements below before you continue.

The minimum hardware requirements for the Arm Linux system are:

- 8 cores with hardware virtualization support
- 8 GB RAM
- 50 GB free disk space

The scripts automatically allocate resources as listed below, but the details can be customized for your system.
Customize CPU cores, memory, and disk size by editing the variables at the top of each script file (`create-vm.sh` and `run-vm.sh` in the project directory) to match your system's capabilities.

For this Learning Path, add the following information:

- CPU: half of available cores (minimum 4 cores)
- Memory: half of available RAM (minimum 4 GB)
- Disk: 40 GB VM disk

## KVM support
## Verify KVM support

Kernel-based Virtual Machine (KVM) support is required for hardware-accelerated virtualization and good VM performance.
Kernel-based Virtual Machine (KVM) support is required for hardware-accelerated virtualization and optimal virtual machine (VM) performance on Arm systems. Without KVM, your VMs run significantly slower because they rely on software emulation instead of using Arm's hardware virtualization features.

KVM is a virtualization infrastructure built into the Linux kernel that allows you to run virtual machines with near-native performance. It leverages Arm's hardware virtualization extensions to provide efficient CPU virtualization, while QEMU handles device emulation and management. Without KVM, virtual machines run much slower using software emulation.

Expand All @@ -59,7 +59,7 @@ This confirms that:
- The KVM kernel module is loaded
- The `/dev/kvm` device exists

## Required software
## Install required software

The scripts require several software packages.

Expand All @@ -70,11 +70,13 @@ sudo apt update
sudo apt install qemu-system-arm qemu-utils genisoimage wget curl jq uuid-runtime -y
```

If needed, the [Remmina](https://remmina.org/) remote desktop (RDP) client is automatically installed by the run script so you don't need to install it now, but you can install it using the command below.
If needed, the [Remmina](https://remmina.org/) remote desktop (RDP) client is automatically installed by the run script so you don't need to install it now, but you can install it using this command:

```console
sudo apt install remmina remmina-plugin-rdp -y
```

Proceed to the next section to learn about the scripts.

You’ve verified your system requirements and you’re now ready to move on and start working with Windows on Arm virtual machines.


Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
title: Understanding the virtual machine scripts
title: Understand and customize Windows on Arm VM automation scripts

weight: 3

layout: "learningpathall"
---

## Get started with the Windows on Arm VM automation scripts

A GitHub project provides two Bash scripts. Understanding their architecture and design will help you use them effectively and enable you to customize the options for your specific needs.

Start by cloning the project repository from GitHub to your Arm Linux system.
Expand Down Expand Up @@ -47,23 +49,23 @@ Virtual machine creation includes the following steps:

The `create-win11-vm.sh` script implements a four-step process that builds a Windows VM incrementally:

### Step 1: Create VM directory
### Step 1: Create the VM directory

Step 1 initializes the VM directory structure and configuration. It creates the VM directory, copies initial configuration files, and sets up the basic environment. As a result, the VM directory, configuration files, and connection profiles are created.

### Step 2: Download Windows
### Step 2: Download Windows and VirtIO drivers

Step 2 downloads the Windows 11 ISO and VirtIO drivers. It downloads the Windows 11 Arm ISO from Microsoft, fetches VirtIO drivers, and prepares unattended installation files. The files created during this step include `installer.iso`, `virtio-win.iso`, and the unattended installation directory. This step takes some time as the Windows ISO download is large, but if you already have the file the script will save time and not repeat the download.

### Step 3: Prepare VM disk image
### Step 3: Prepare the VM disk image

Step 3 creates the VM disk image and finalizes the installation setup. It builds the unattended installation ISO, creates the main VM disk image, and configures all installation media. The files created during this step include `disk.qcow2` and `unattended.iso`.

{{% notice Note %}}
The product key used in the scripts is a generic key provided by Microsoft, which allows installation. This key is for testing purposes only and does not activate Windows. If you plan to continue using Windows beyond installation, you should replace it with a genuine product key.
{{% /notice %}}

### Step 4: First Windows boot
### Step 4: Boot Windows for the first time

Step 4 executes the Windows installation. It boots the VM with installation media, runs the automated Windows setup, and completes the initial configuration. The result is a fully installed and configured Windows on Arm VM.

Expand Down Expand Up @@ -93,7 +95,7 @@ For storage, the default VM disk size is 40GB in QCOW2 format. The available dis

All settings are customizable using command line arguments.

## Script Integration and Workflow
## Script integration and workflow

The create and run scripts share the same configuration files. Separating creation from execution enables you to create a VM once and then use the run script repeatedly.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ Set up a VM with English International language:
./create-win11-vm.sh all $HOME/win11-vm --language "English International"
```


## Alternative four-step creation process

The VM creation process consists of four distinct steps that can be run individually. Understanding each step helps with troubleshooting and customization.
You can run each step of the VM creation process individually. Understanding each step helps with troubleshooting and customization.

### Step 1: Create VM directory structure
### Step 1: Create the VM directory structure

```console
./create-win11-vm.sh create $HOME/win11-vm
Expand Down Expand Up @@ -151,7 +152,7 @@ The script uses an automated process to download Windows 11 from Microsoft's off
3. Obtain download link - Retrieves the direct download URL for Arm64
4. Download and verify - Downloads the ISO and verifies its integrity

### Step 3: Prepare VM disk
### Step 3: Prepare the VM disk

```console
./create-win11-vm.sh prepare $HOME/win11-vm
Expand All @@ -175,7 +176,7 @@ The script creates a QCOW2 disk image with these optimizations:

Important Note: If `disk.qcow2` already exists, the script will warn you that proceeding will delete the existing VM's hard drive and start over with a clean installation.

### Step 4: First boot and Windows installation
### Step 4: Boot and install Windows for the first time

```console
./create-win11-vm.sh firstboot $HOME/win11-vm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ After your Windows 11 Arm VM is created, launching it is simple with the unified
./run-win11-vm.sh $HOME/win11-vm
```

This single command handles the entire VM startup and connection process automatically. The script performs three key steps: checks if the VM is already running, starts it in headless mode if needed, and connects you via RDP using Remmina.
This single command handles the entire VM startup and connection process automatically.

The script performs three key steps. It does the following:

- Checks if the VM is already running
- Starts the VM in headless mode if required
- Connects you through RDP using Remmina

When the virtual machine starts you will see it on your Linux desktop:

![Windows on Arm VM](./images/win11arm.png)
![Screenshot showing the Windows 11 desktop running in a virtual machine on an Arm-based Linux system. The Windows Start menu and taskbar are visible, confirming successful VM launch and RDP connection. alt-text#center](./images/win11arm.png "Windows 11 Arm VM desktop")

## What does the run script do?

Expand Down Expand Up @@ -279,4 +285,4 @@ RDP session ended

This is a known Remmina issue and does not affect VM functionality.

You have learned how to create Windows on Arm virtual machines on an Arm Linux system with QEMU and KVM. You can use these virtual machines for software development and testing. You can speedup your development tasks by using an Arm Linux desktop or server with high processor count and plenty of RAM.
You have completed the VM execution section. You now know how to run, monitor, and manage Windows on Arm virtual machines on an Arm Linux system. Keep building your skills and explore more advanced automation or troubleshooting as your next step - great work!