How to install Windows 11 in QEMU

From Computernewb Wiki
Jump to navigation Jump to search

< Windows 10 | <<< Table of Contents

The Windows 11 desktop in build 22000.348

This page details how to install Windows 11 in QEMU. Windows 11 is an operating system created by Microsoft which was officially released on October 5, 2021. The first build of Windows 11 (Build 21996) was leaked sometime in June 2021. It is the latest version of Windows.

Prerequisites

QEMU

You will need QEMU installed.

Windows 11 ISO

You'll need a Windows 11 ISO for this guide. You can:

  • You can use a physical disc
  • Download the Windows 11 ISO from Computernewb:
  • Source an ISO from elsewhere

Installation

Creating the Disk Image

First, open a command window and create a disk image for the VM using a command like the following.

qemu-img create -f qcow2 win11.qcow2 50G

50G can be replaced with however big you want the hard drive to be (with G standing for Gigabytes).

Starting QEMU

You can now start up QEMU with a command like the following:

qemu-system-x86_64 -M q35,usb=on,acpi=on,hpet=off -m 6G -cpu host,hv_relaxed,hv_frequencies,hv_vpindex,hv_ipi,hv_tlbflush,hv_spinlocks=0x1fff,hv_synic,hv_runtime,hv_time,hv_stimer,hv_vapic -smp cores=4 -accel kvm -drive file=win11.qcow2 -device usb-tablet -device VGA,vgamem_mb=256 -nic user,model=e1000 -monitor stdio -cdrom en-us_windows_11_iot_enterprise_ltsc_2024_x64_dvd_f6b14814.iso

Bypassing Installation Requirements

The IoT Enterprise LTSC ISO does not have restrictive installation requirements like the stock ISOs do. If you chose that ISO, skip this section.

Consumer versions of Windows 11 have the arbitrary requirements of UEFI with Secure Boot enabled, TPM 2.0, and some CPU features. While it's technically possible to virtualize these in QEMU, it's quite a pain in the ass. Instead, bypassing these requirements is pretty simple.

Once setup reaches the language selection screen, press Shift + F10 to open a command prompt. Run the following commands:

reg add HKLM\SYSTEM\Setup\LabConfig
reg add HKLM\SYSTEM\Setup\LabConfig /t REG_DWORD /v BypassTPMCheck /d 1
reg add HKLM\SYSTEM\Setup\LabConfig /t REG_DWORD /v BypassSecureBootCheck /d 1
reg add HKLM\SYSTEM\Setup\LabConfig /t REG_DWORD /v BypassRAMCheck /d 1
reg add HKLM\SYSTEM\Setup\LabConfig /t REG_DWORD /v BypassCPUCheck /d 1

You can now close command prompt and install Windows 11 as normal.

Installing Windows

From here, the installation is pretty straightforward. Agree to the license, select a custom install to the unallocated space, and wait for it to install. The OS should install pretty quick on newer systems.

Post-install

Invoking QEMU

After installing, you should remove the same QEMU command as before, except the -cdrom ... argument should be removed.

Activation

Windows 11 can be activated using Massgrave's Microsoft Activation Scripts:

  1. Download the latest MAS_AIO.cmd and run it
  2. Select 3 for TSForge Activation, followed by 1 to activate Windows.
  3. You should now have an activated copy of Windows 11.

< Windows 10 | <<< Table of Contents