Skip to main content

Setting Up Your Virtual Machine (Windows 11) – The Final Steps

This guide will walk you through the steps needed to set up a Windows 11 virtual machine on QEMU/KVM. It includes installing necessary packages, configuring the virtual machine, and handling installation steps.

1. Installing Required Packages

Windows 11 has a requirement for TPM (Trusted Platform Module). To address this, you need to install the required packages.

Install the swtpm package to provide a virtual TPM:

sudo pacman -S swtpm

2. Creating a New VM

2.1 Opening virt-manager

Open virt-manager on your system and click on New Virtual Machine to start the creation process.

2.2 Selecting Installation Media

In the installation method selection screen, choose Local install media (ISO image or CDROM).

Local install media

2.3 Locating the Windows 11 ISO

Click Browse to locate your Windows 11 ISO file and select it from your file system.

Windows ISO

2.4 Configuring Memory and CPU

Set the amount of memory (RAM) and number of CPU cores according to your requirements.

Memory and CPU

2.5 Setting Up Storage

Configure your storage settings by allocating a virtual hard disk size appropriate for Windows 11.

Enable Storage

2.6 Naming the VM

Provide a name for your virtual machine and select Customize configuration before install to access advanced settings.

Customize Configuration

3. Virt-manager Configuration

3.1 Configuring Firmware

In the Overview section, set the Firmware to UEFI x86_64: /usr/share/edk2/x64/OVMF_CODE.secboot.fd.

This is crucial as secure boot is required for Windows 11.

IMPORTANT!!! Ensure you are using the correct firmware as the changes cannot be undone after selecting Begin installation. If necessary, you will need to recreate the VM.

Firmware

3.2 Setting Up CPUs

Configure the CPU settings by setting the CPU mode to host-passthrough. Enable the option Copy host CPU configuration (host-passthrough) and manually set the CPU topology according to your requirements.

CPU

3.3 Adding VirtIO Disk

Add a VirtIO storage device with a size of 40GB. Configure this device with the VirtIO bus type and set the device type to Disk device.

Add VirtIO Disk

3.4 Adding VirtIO ISO

Create a VirtIO ISO storage device and set it as a CDROM device. This will be used for installing VirtIO drivers during the Windows setup.

Add VirtIO ISO

3.5 Configuring Boot Options

Set the SATA CDROM 1 as the primary boot device to ensure the VM boots from the Windows 11 ISO.

3.6 Adding TPM Device

Add a TPM device and configure it to version 2.0. This is required for Windows 11 installation.

TPM

3.7 Removing NIC

Remove the network interface card (NIC) to avoid the Microsoft Account sign-in requirements during the Windows installation. You can reconnect the NIC after the installation.

Tips: Removing the NIC ensures that the installation does not require online activation, which can be bypassed by using command-line tools to enable offline mode.

4. Booting the VM and Installing Windows 11

4.1 Starting the Installation

To begin the installation process, first click on Begin Installation to start your VM. If you miss the Press any key prompt that appears when the VM starts, follow these steps:

4.1.1 Accessing the UEFI Shell

Enter the UEFI Shell by pressing the necessary key to open the BIOS menu. Type exit to leave the BIOS menu.

Exit BIOS

4.1.2 Navigating to Boot Manager

Use the arrow keys to navigate to Boot Manager and select the UEFI DVD-ROM from the list of boot options.

Boot Manager Boot Manager

4.1.3 Booting from the Windows 11 ISO

Press any key to initiate the boot process from the Windows 11 ISO.

Press any key Win11 Launch

4.2 Completing Windows Setup

4.2.1 Selecting Language and Settings

On the Windows setup screen, choose your preferred language, time, and keyboard layout. Click Next.

Win11 Setup

4.2.2 Installing Windows

Click Install now to start the installation process.

Win11 Install Now

4.2.3 Skipping Product Key

When prompted for a product key, click I Don't have the product key.

Win11 Product Key

4.2.4 Selecting Edition

Choose Windows 11 Pro as the edition and click Next.

Win11 Pro Version

4.2.5 Accepting License Terms

Accept the license terms to proceed with the installation.

Win11 Accept License

4.2.6 Choosing Installation Type

Select Custom: Install Windows only (advanced) for a clean installation.

Win11 Custom Installation

4.2.7 Loading VirtIO Driver

To install the required drivers, click Load driver, then Browse.

Win11 Load Driver

Navigate to E:\amd64\w11, click OK.

Win11 Select Drivers

select the REDHAT result. Click Next.

Win11 REDHAT Driver Next

will take a while, just wait.

Win11 Waiting for Installation Complete

4.2.8 Selecting Installation Disk

Choose the disk where you want to install Windows (e.g: 400GB) and continue with the installation.

Win11 Install Disk Win11 Installing Win11 Installing Restart

4.2.9 Rebooting During Installation

The installation process will reboot several times. During these reboots, ignore any Press any key prompts.

Win11 Ignore Press Any Key Win11 Installing Win11 Loading Installing

4.3 Bypassing Network Requirements

When you reach the Hi screen, press Shift + F10 to open the Command Prompt. In the Command Prompt window, type:

OOBE\BYPASSNRO

The system will automatically reboot after executing this command.

OOBE\BYPASSNRO

5. Post-Installation Configuration

Now just install the window in the normal way. Don't worry too much about it being different.

5.1 Power Off the System

After completing the Windows 11 installation, you should power off the VM. This is done by using the Power off option from the VM’s menu.

Win11 Power Off

5.2 Adding GPU and GPU-Audio Devices

5.2.1 Adding the GPU

Add your GPU to the VM configuration. This involves specifying the GPU as a passthrough device in the VM settings.

Win11 Add GPU

5.3.2 Adding GPU-Audio

Similarly, add your GPU-Audio device. This step ensures that audio functionalities from the GPU are also included in the VM setup.

Win11 Add GPU-Audio

5.4 Reconnecting the Network Interface Card (NIC)

Since, previously we removed the NIC to avoid Microsoft account sign-in requirements during installation, reconnect it now. This step will restore network connectivity for the VM.

Win11 Add NIC

5.5 Removing the Windows 11 ISO

Finally, remove the Windows 11 ISO from the VM’s virtual drives to complete the setup. This ensures that the VM will not boot from the ISO again.

Win11 Remove Win11 ISO

6. Final Configuration and Updates

6.1 Updating Windows 11

You need to ensure your Windows 11 system is up to date.

6.1.1 Checking for Updates

Power on your VM and navigate to the Windows Update settings to check for updates.

Win11 Check for Update

6.1.2 Handling Update Errors

If you encounter any update errors, allow the system to reboot automatically as it may resolve the issue.

That's windows problem, don't worry too much. just force-reboot.

Win11 Update Error Win11 Up to Date

6.2 Installing VirtIO Drivers

To ensure optimal performance and functionality, you need to install VirtIO drivers.

6.2.1 Opening Device Manager

Open Device Manager to begin the process of updating drivers.

Device Manager

6.2.2 Updating PCI Devices Driver

Update the driver for PCI Devices by selecting the appropriate option in Device Manager.

Device Manager Update PCI

6.2.3 Browsing for the VirtIO ISO

Browse to the location of the VirtIO ISO on E:\ to locate the necessary drivers.

Device Manager Search Driver Device Manager Search E Driver Device Manager Searching E Device Manager Loaded

6.3 Installing VirtIO Driver gt

6.3.1 Launching the Installer

Open Explorer, navigate to the VirtIO folder, and start the installation of virtio-win-gt-x64.msi.

Explorer E VirtIO Win X64 Explorer E VirtIO Win X64 Next License VirtIO Explorer E VirtIO Win X64 Select Explorer E VirtIO Win X64 Install

Grant any necessary superuser permissions to complete the installation.

Explorer E VirtIO Win X64 Permission Explorer E VirtIO Win X64 Installing Explorer E VirtIO Win X64 Finish

6.3.2 Installing Guest Tools

Finally, install the guest tools to enhance the VM’s performance and integration.

Explorer E VirtIO Win X64 Guest Tool Explorer E VirtIO Win X64 Guest Tool Install Explorer E VirtIO Win X64 Guest Tool Install Yes Explorer E VirtIO Win X64 Guest Tool Installing Explorer E VirtIO Win X64 Guest Tool Success

7. Enabling and Installing GPU Drivers

7.1 Enabling AMD GPU

For windows 11, you need to manually enable the GPU utilize it for your VM.

7.1.1 Accessing Device Manager

Back to the Device Manager on your Windows 11 VM.

7.1.2 Enabling the GPU

Locate your GPU under the Display adapters section, right-click it, and select Enable to activate the GPU.

Enable GPU

7.2 Installing GPU Drivers

To ensure your GPU functions correctly, you need to install the appropriate drivers, Since it's windows LOL

Visit your GPU manufacturer’s website (AMD, Nvidia, or Intel) to download the latest drivers for your GPU.

9. Conclusion

Congratulations! You have successfully set up Windows 11 on a QEMU/KVM virtual machine, including configuring a virtual TPM and GPU. Explore and enjoy the features of Windows 11