Set up Windows 11 on KVM with support for WSL2
Supporting WSL2 in a Windows 11 guest virtual machine is trickier than it seems at the surface because of the requirement for nested virtualization and specific support for Hyper-V. This page outlines how to set up a virtual machine on KVM via virt-manager with specific adjustments sacrificing aesthetics in favor of better performance when running WSL2. It heavily assumes the AMD64 architecture on both host and guest, never tested on ARM64. Lots of ideas and steps were taken from or inspired by a very complete setup guide found in the SysGuides website[1].
Before you begin
Make sure you can dedicate the following resources to the virtual machine:
- At least 128 GB of storage for the VM disk
- At least 4 CPU (virtual) cores
- At least 12 GB of RAM
Enable KVM and install required packages on the host
Kernel-Based Virtual Machine (KVM) is a Linux kernel module that enables hardware-assisted virtualization. It is the default virtualization technology supported by Ubuntu[2]. On Intel and AMD processors, KVM requires enabling extensions via the firmware configuration (BIOS/UEFI). It turns a Linux host into hypervisor, collaborating with user space packages to make a fully featured virtual machine runner and management system. Check if the extensions are already available with:
$ lscpu | grep -i virtualization
Virtualization: VT-x
Intel processors show VT-x, AMD ones shows AMD-V. If it doesn't show anything, you might need to access your UEFI settings and enable the virtualization extensions. Otherwise, your hardware doesn't support virtual machine acceleration and you cannot proceed with this guide.
Install the following packages:
$ sudo apt install qemu-system libvirt-daemon-system virtinst \
virt-manager virt-viewer ovmf swtpm qemu-utils guestfs-tools \
libosinfo-bin
qemu-system: A user-space emulator that also supports VM hardware acceleration via KVM.libvirt-daemon-system: A daemon that manages virtual machines and the hypervisor providing an API and toolkit for higher level components to build on top of, abstracting QEMU and KVM.virtinst: A command-line tool for creating guest virtual machines.virt-manager: A graphical tool for creating and managing guest virtual machines.virt-viewer: A graphical console for connecting to a running virtual machine.ovmf: Enables UEFI support for Virtual Machines.swtpm: A TPM emulator for Virtual Machines.qemu-utils: Provides tools to create, convert, modify, and snapshot offline disk images.guestfs-tools: Provides a set of extended command-line tools for managing virtual machines.libosinfo-bin: A library for managing OS information for virtualization.
If you're on Ubuntu 24.04 or later, you must install virtiofsd explicitly since it's no longer bundled with qemu-system-common:
$ sudo apt install virtiofsd
virtiofsdthe host-side daemon for VirtioFS (used in the optional Shared Directory step later in this guide)
You can get more details about the key components in the Ubuntu documentation[3].
Make sure the user intended to operate the virtual machine is a member of the libvirt group: run sudo usermod -aG libvirt $USER. Then, check id -nG | grep libvirt. If you do not see libvirt, log out and log back in (or reboot). If you'd rather not log out or reboot yet, you can run newgrp libvirt (which opens a nested shell with the correct permissions) and continue this tutorial from that sub-shell.
Finally, validate your setup with virt-host-validate:
$ sudo virt-host-validate qemu
QEMU: Checking for hardware virtualization : PASS (VMX)
QEMU: Checking if device '/dev/kvm' exists : PASS
QEMU: Checking if device '/dev/kvm' is accessible : PASS
QEMU: Checking if device '/dev/cpu/0/msr' exists : PASS
QEMU: Checking if device '/dev/vhost-net' exists : PASS
QEMU: Checking if device '/dev/net/tun' exists : PASS
QEMU: Checking for cgroup 'cpu' controller support : PASS
QEMU: Checking for cgroup 'cpuacct' controller support : PASS
QEMU: Checking for cgroup 'cpuset' controller support : PASS
QEMU: Checking for cgroup 'memory' controller support : PASS
QEMU: Checking for cgroup 'devices' controller support : PASS
QEMU: Checking for cgroup 'blkio' controller support : PASS
QEMU: Checking for device assignment IOMMU support : PASS (DMAR)
QEMU: Checking if IOMMU is enabled by kernel : PASS
QEMU: Checking for secure guest support : WARN (None of SEV, SEV-ES, SEV-SNP, TDX available)
Download a Windows 11 ISO and VirtIO guest drivers
The page https://www.microsoft.com/en-in/software-download/windows11 provides three alternatives to prepare an installation media of Windows 11. We need the ISO from the "Download Windows 11 Disk Image (ISO) for x64 devices" alternative. If the page fails on Firefox-based browsers, try on a Chromium-based one. Select the image and language that matches your preferences.
Microsoft doesn't publish drivers for VirtIO, so you'll need to download the latest stable version of the virtio-win.iso image from https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/.
Create the virtual machine with virt-manager
We'll use the virt-manager's GUI for this setup, even though all options needed to optmize the VM for Windows are exposed in it. For that reason we need to enable XML editing. Open virt-manager, go to Edit > Preferences and toggle on the "Enable XML editing" checkbox in the General section.

Then create a new virtual machine using the left-most icon in the toolbar (Create new virtual machine) or via the menu File > New virtual machine. We'll use that wizard to define the basic structure of the Windows VM. For each step of the wizard, select the following answers:
| Step | Prompt | Answer |
|---|---|---|
| 1 | Choose how you would like to install the operating system | Local install media (ISO image or CDROM) |
| 2 | Choose ISO or CDROM install media | Select the Windows 11 ISO downloaded previously |
| Choose the operating system you are installing | Microsoft Windows (should be filled automatic, if not enter it manually) | |
| 3 | Choose Memory and CPU settings | Memory: 12288
CPUs: 8 |
| 4 | Enable storage for this virtual machine | ON |
| Create a disk image for the virtual machine | 128 GiB | |
| 5 | Customize configuration before install | Name the VM per your preferences, but be sure to toggle on the customization checkbox |
On hitting Forward for the last time you'll land in the customization window. Let's go section by section. Click Apply as you move from one section to another.
Overview > Hypervisor Details
If not already the defaults, make sure to select the Q35 chipset for PCIe-based virtual hardware emulation with better stability and improved pass-through behavior; and UEFI firmware.

Then click on XML (at the top of the page, near Details) and locate the os entry. Insert the following firmware features after the type field:
<firmware>
<feature enabled="yes" name="enrolled-keys"/>
<feature enabled="yes" name="secure-boot"/>
</firmware>
That allows Secure boot to just workTM. That makes the firmware emulator use the built-in Microsoft certificates needed to verify the Windows bootloader. Without those options you'd have to dive deeper into the Windows installer shenanigans to disable Secure Boot.

CPUs
Here we start the optimizations. First of all, find out how many threads per core your processor has:
$ lscpu | grep -i thread
Thread(s) per core: 2
We'll use that information to perform the math of how to distribute the virtual CPUs. First check "Copy host CPU configuration (host-passthrough). Then expand Topology and check "Manually set CPU topology".

Generally speaking, it's very likely that your setup will have Sockets=1, unless we're talking about special hardware with multiple processor chips, so the math is just:
Since we want 8 vCPUs, and the real CPU (hardware) has 2 threads per core in the example from above, we'll assign 4 cores with 2 threads each from a single socket, as shown in the screenshot above. This makes the virtual CPU layout accurately reflect the host, ensuring the guest OS can schedule workloads more efficiently. Inventing extra sockets or threads will just decrease performance.
Click on apply (bottom right) and then click on XML (top) to edit the raw configuration a bit further. Locate the CPU section and add <feature policy="require" name="vmx"/> (vmx for Intel, svm for AMD). Also, include the following properties check="none" and migratable="off" to the cpu entry if they are not already present (assuming the host is a workstation, making no sense to talk about VM migration).

Hyper-V enlightenments
WSL2 depends on Hyper-V. QEMU has specific features for Hyper-V as a guest, but they are not exposed in the virt-manager GUI, thus we need more XML editing. Locate hyperv under the features (usually after acpi or apic) entry and replace its entire contents with:
<hyperv mode="custom">
<relaxed state="on"/>
<vapic state="on"/>
<spinlocks state="on" retries="8191"/>
<vpindex state="on"/>
<runtime state="on"/>
<synic state="on"/>
<stimer state="on">
<direct state="on"/>
</stimer>
<reset state="on"/>
<frequencies state="on"/>
<reenlightenment state="on"/>
<tlbflush state="on"/>
<ipi state="on"/>
<evmcs state="on"/>
</hyperv>
Locate the clock entry, usually after cpu, and make sure it contains the following:
<clock offset="localtime">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
<timer name="hypervclock" present="yes"/>
</clock>
The result should look like:

If you need more technical information, checkout the documentation pages about QEMU Hyper-V enlightenments and libvirt Hypervisor features.
Memory and VirtioFS
Skip this section if you don't want to share a host directory with the guest. That's not strictly necessary for running WSL2 in the VM.
In the memory section, check Enable shared memory. It allows sharing files between host and guest via VirtioFS, a high performance file sharing solution.

Storage
For better performance, change the SATA Disk 1 bus to VirtIO, thus reducing the runtime cost of emulating the storage device. That implies in specific steps during the guest OS installation to load VirtIO drivers, not present in Windows images. yet the performance benefits are worth the extra setup.
Change the Cache mode to writeback for better performance, as it lets the host cache disk writes, making Windows installations, updates, and everyday use noticeably faster. Small random writes benefit the most, and the risk of data loss on a typical desktop system is very low because Linux flushes cached data frequently. For qcow2-based desktop VMs, writeback provides the best overall speed and is the recommended choice.
Keep the Discard mode set to unmap. This enables TRIM support for the virtual disk. With discard set to unmap, Windows can tell the host which blocks are no longer in use. This helps prevent qcow2 images from growing unnecessarily, improves long-term storage performance, and allows SSDs to maintain their write speed. There is no downside for typical desktop setups, so keeping discard on unmap is recommended.

On the bottom left part of the window, click on Add Hardware. In the newly opened dialog, select the Storage type at left, then check the Select or create custom storage radio button, click on Manage... to browse for the virtio-win-*.iso previously download. Set Device type to CDROM device and Bus type to SATA. We'll need that virtual CDROM to source the disk drivers from when installing Windows. Otherwise the installer will fail to detect the target disk.

Improve the network performance
By now you're already aware that VirtIO is the way to avoid runtime cost of device emulation. We can use it for network as well. Select the NIC in the left, and configure its Device model to virtio.

TPM 2.0
Windows 11 checks for a TPM 2.0 device during installation. KVM supports a fully functional virtual TPM, so adding it now ensures the installer accepts the system and all security features work correctly. Expand the Advanced options section and select the model CRB and version 2.0.

QEMU Guest Agent
While it is not strictly mandatory for the VM to boot, enabling the QEMU guest agent channel is strongly recommended. Without the guest agent running inside Windows, libvirt and QEMU are limited to interacting with the VM from the outside via generic ACPI signals and hardware emulation. The agent provides a direct, low-overhead communication socket (org.qemu.guest_agent.0) between the host and the Windows kernel, providing the following features (and more!):
- Reliable Graceful Shutdowns: Standard
virshshutdown command or GUI shutdown actions send anACPIpower button event. Windows often ignores or delaysACPIpower signals if a user session is locked, an administrator prompt is open, or background updates are running. The guest agent issues an internal Windows shutdown API call, ensuring the machine powers off or restarts cleanly without having to force-destroy it. - VSS Snapshot Consistency (preventing disk corruption): This is critical when running WSL2. When creating live snapshots or host-level backups of your .qcow2 disk, the
QEMUguest agent integrates directly with the Windows Volume Shadow Copy Service (VSS). It temporarily freezes disk I/O and flushes all pending in-memory write caches. Without it, live disk snapshots are only "crash-consistent," which risks corrupting the nested WSL2 virtual disk. - Accurate IP and interface reporting:
libvirt's default network queries (virsh domifaddr) inspect the host's bridgeARPtables orDHCPleases. If your VM uses static IPs, bridged adapters, or complex multi-homed routes, the host cannot easily detect the guest's IP. The agent reports interface addresses directly from inside Windows. That's not a feature we're using in this guide, but it's good to know in case you modify this guide into a more complex network setup. - Instant clock re-synchronization: If you suspend, pause, or save/restore the VM, the guest clock freezes. The agent immediately re-synchronizes the Windows system clock with host time upon wake-up via guest-set-time, preventing SSL handshake failures and time-drift bugs in WSL2 before Windows Time Service (W32Time) eventually catches up.
- Host-to-guest automation (guest-exec): Allows the host to run shell commands, deploy scripts, or inspect guest system state without needing an open network connection, SSH server, or
WinRMconfigured on the guest. That opens up infinite possibilities for your development and testing workflows.
Having said that, click on the bottom left Add Hardware button, on the left of the newly opened dialog select the Channel device type, on the Name drop-down, pick org.qemu.guest_agent.0. Device Type should be Unix socket (unix) and the Auto socket checkbox should be active by default.

Entropy device
Instead of using emulated devices, virt-manager can add a virtual random device that feeds randomness from the host into the guest (para-virtualization). This improves security and can reduce delays in workloads that depend on high-quality entropy.
Click the Add Hardware button to open the Add New Virtual Hardware dialog and select RNG. Leave the random source set to /dev/urandom (default) and click Finish to apply.

Shared Directory
This is optional, skip it if you don't have reasons to share a particular directory with your VM.
We'll use ~/Downloads as an example. Click once again in the Add Hardware button, on the left select Filesystem for the device type, Driver is virtio, for the Source path click on Browse... and then Browse local and select the folder you want to share. For the Target path give it a descriptive name. It will show up on Windows as an automatic mounted disk drive. Toggle Export filesystem as a readonly mount per your preferences.

Aesthetics sacrifices Part I
We're keeping the defaults for video rendering (Display Spice device, Type Spice server, all options unchanged). We could have enabled OpenGL for better graphics and maybe even complete GPU pass-through, but that's especially complicated on laptops with hybrid graphics and can result in crashes, so I'm leaving those options out of the table. Video QXL and Sound ich9 devices should just keep the defaults. Similarly, we're not using a Tablet device in this VM, so removal is recommended.
After installation we'll present a few more adjustments to improve your VM performance, sacrificing a bit more of the aesthetics of the guest OS.
The complete virtual machine definition in XML
We're finally ready to start installing the guest OS. Here's the complete XML definition. Do not blindly copy and paste it as it would contain paths specific to the machine used to write this guide. Also, as defaults evolve, some of those verbose definitions may become unnecessary or evolve into something more modern in the future, reason why guides like this one age as milk. Use it just for reference.
<domain type="kvm">
<name>win11-2026</name>
<uuid>6308298e-426a-4ed7-adbd-32b1fe10468a</uuid>
<title>WSL2 on KVM</title>
<description>A WSL2 capable Windows 11 guest</description>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://microsoft.com/win/11"/>
</libosinfo:libosinfo>
</metadata>
<memory>12582912</memory>
<currentMemory>12582912</currentMemory>
<vcpu current="8">8</vcpu>
<os firmware="efi">
<type arch="x86_64" machine="q35">hvm</type>
<firmware>
<feature enabled="yes" name="enrolled-keys"/>
<feature enabled="yes" name="secure-boot"/>
</firmware>
<boot dev="hd"/>
</os>
<features>
<acpi/>
<apic/>
<hyperv mode="custom">
<relaxed state="on"/>
<vapic state="on"/>
<spinlocks state="on" retries="8191"/>
<vpindex state="on"/>
<runtime state="on"/>
<synic state="on"/>
<stimer state="on">
<direct state="on"/>
</stimer>
<reset state="on"/>
<frequencies state="on"/>
<reenlightenment state="on"/>
<tlbflush state="on"/>
<ipi state="on"/>
<evmcs state="on"/>
</hyperv>
<vmport state="off"/>
</features>
<cpu mode="host-passthrough" check="none" migratable="off">
<topology sockets="1" cores="4" threads="2"/>
<feature policy="require" name="vmx"/>
</cpu>
<clock offset="localtime">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
<timer name="hypervclock" present="yes"/>
</clock>
<pm>
<suspend-to-mem enabled="no"/>
<suspend-to-disk enabled="no"/>
</pm>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2" discard="unmap" cache="writeback"/>
<source file="/var/lib/libvirt/images/$VM_NAME>.qcow2"/>
<target dev="vda" bus="virtio"/>
</disk>
<disk type="file" device="cdrom">
<driver name="qemu" type="raw"/>
<source file="$USER_HOME/Downloads/Windows11_$WIN_ISO_VERSION.iso"/>
<target dev="sdb" bus="sata"/>
<readonly/>
</disk>
<controller type="usb" model="qemu-xhci" ports="15"/>
<controller type="pci" model="pcie-root"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<controller type="pci" model="pcie-root-port"/>
<interface type="network">
<source network="default"/>
<mac address="52:54:00:4c:bb:a3"/>
<model type="virtio"/>
</interface>
<console type="pty"/>
<channel type="spicevmc">
<target type="virtio" name="com.redhat.spice.0"/>
</channel>
<tpm model="tpm-crb">
<backend type="emulator" version="2.0"/>
</tpm>
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
<image compression="off"/>
</graphics>
<sound model="ich9"/>
<video>
<model type="qxl"/>
</video>
<redirdev bus="usb" type="spicevmc"/>
<redirdev bus="usb" type="spicevmc"/>
<disk type="file" device="cdrom">
<driver name="qemu" type="raw"/>
<source file="$USER_HOME/Downloads/virtio-win-$VIRTIO_WIN_VERSION.iso"/>
<target dev="sdc" bus="sata"/>
<readonly/>
</disk>
<channel type="unix">
<source mode="bind"/>
<target type="virtio" name="org.qemu.guest_agent.0"/>
</channel>
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
</rng>
<filesystem type="mount">
<source dir="$USER_HOME/Downloads"/>
<target dir="Shared_Downloads"/>
<driver type="virtiofs"/>
</filesystem>
</devices>
<memoryBacking>
<source type="memfd"/>
<access mode="shared"/>
</memoryBacking>
</domain>
Install Windows 11
Apply all the last changes, if not already applied, and then click on Begin Installation on the top of the VM configuration window. When the VM starts, it will briefly show a message that says: Press any key to boot from CD or DVD… Press a key as soon as you see this. If you miss it, the VM will skip the installer and try to boot from the empty virtual disk, which makes it look like the setup is not working. After the installer loads, the first screen will appear. Notice that in the top of the VM viewer Window, there is a message showing the keyboard shortcut to release the mouse pointer (by default it's Control_L+Alt_L). You'll need that key combo as you desire to move the mouse in and out of the VM.
Proceed with the regular Windows setup: Select your language and your time and currency format, then click Next, select the keyboard layout that matches your hardware, and finally in the Select setup option screen choose Install Windows 11 for the I would like to prompt and check I agree everything will be deleted including files, apps and settings. There is nothing to delete actually, as the disk is empty. At next enter your product key if you have one, or click I don't have a product key link in the bottom left part of the wizard. Select the version of Windows matching your license and needs (Windows 11 Home, Pro etc) and agree with the license terms. You'll land in the Select location to install Windows 11 page with no disks listed. That's expected, the installer won't be able to find the target disk because it doesn't have drivers for VirtIO.

Click on the link Load Driver and then Browse to locate the virtio-win.iso disk. Expand the folder viostor > w11 and select amd64.

The Red Hat VirtIO SCSI controller driver should appear in the previously empty table. Select it and click Install. The 128 GB disk now appears in the select-location page. But don’t continue with the installation yet. You still need to install the VirtIO network driver, otherwise the network won’t during the installation. Repeat the same procedure for the network driver: click Load Driver, then Browse. In the window that appears, expand the second CD drive, then expand NetKVM > w11 > amd64, and click OK. You should now see the driver listed as Red Hat VirtIO Ethernet Adapter. You'd still have a chance to install this driver later on, during the customization steps at the Let's connect you to a network page if you miss this step. Select it and click Install.
Back to the Select location page, choose the 128 GB disk and click Next. The installer will automatically partition it. In the Ready to install page, click on Install and leave it running. The full blue screen Installing Windows 11 will show you the progress.

The remaining steps are just personalization , account setup and Windows updates. Complete them according to your preferences, and once everything is finished, Windows 11 will boot to the desktop. If you get stuck in the Sign in with your Microsoft Account screen and you don't want to do it (after all this is a virtual machine) hit Shift+F10 to open the command prompt and type start ms-cxh:localonly to create a local account. That will force advancing the Windows OOBE wizard past user login creation.
Install VirtIO Guest Tools and File System Proxy
Now that Windows 11 is installed, you need to install the VirtIO Windows Guest Tools package. This installer provides the required VirtIO drivers along with the QEMU Guest Agent and SPICE Guest Tools. It also installs the QXL video driver, which enables features like copy and paste integration and automatic resolution changes when using SPICE. These components improve performance and make the VM behave more like a native desktop session. Open Windows Explorer, go to the second CD Drive (E:), and double click the virtio-win-guest-tools.exe installer and check I agree to the license terms and conditions to begin the installation., agreeing with the defaults.

Once done, in the virt-manager window, click the View menu > Scale Display > Never, and enable the Auto resize VM with window option. This allows the Windows 11 guest to automatically adjust its resolution when you resize the window or go full screen.

To make the file sharing functional we need a user space component that acts like FUSE, since VirtioFS is not an independent file sharing protocol like SMB or NFS, but rather a highly specialized pipe designed to pass the Linux host's native local file system operations directly into the guest VM with as little overhead as possible, indeed implemented on top of FUSE. The component we need is WinFSP file system proxy. WinFsp is system software that provides runtime and development support for custom file systems on Windows computers. In this sense it is similar to FUSE (Filesystem in Userspace), which provides the same functionality on UNIX-like computers. Typically any information or storage may be organized and presented as a file system via WinFsp, with the benefit being that the information can be accessed via the standand Windows file API’s by any Windows application.[4] Download the latest installer from https://winfsp.dev/rel/ and run it with the default options.

When the installation completes, hit Win + R and enter services.msc, search for the VirtIO-FS Service and right click to access its Properties. Configure its Startup Type to Automatic (Delayed Start). Then hit the Start button, Apply and OK. Close the Services console and hit Win + E to open the Windows Explorer. You should now see your shared folder appearing as a mapped drive.


Finally remove both virtual CDROMs as we'll no longer need them for this VM. Shutdown the VM and open the hardware details page in virt-manager. Select each CDROM device and remove them from the VM using the button at the bottom right part of the window. Your VM is almost ready, but we still can do better.
Aesthetics sacrifices Part II (plus some useful enhancements)
Windows 11 ships with many background services, animations, advertisements, and scheduled tasks that are not useful in a virtual machine. These features consume CPU time, disk I/O, and memory, which slows the system down. In this section, we will apply a set of safe and practical optimizations that improve responsiveness and reduce unnecessary background activity without breaking Windows updates or features. Power up the VM and perform the modifications listed below.
Disable SuperFetch (SysMain)
SuperFetch, now called SysMain, is designed to speed up application loading on physical systems, especially those with slow hard drives. In a virtual machine it often has the opposite effect. It keeps reading and writing large amounts of data in the background, which increases disk usage and slows down the VM. Disabling it makes Windows 11 more responsive inside KVM.
- Press Win + R, type services.msc, and press Enter.
- Scroll down and find SysMain in the list.
- Double click SysMain to open its properties window.
- Click Stop to stop the service.
- Change Startup type to Disabled.
- Click Apply and OK.

Disable Windows Web Search
Windows Web Search integrates Bing results into the Start Menu. It also runs background processes that are not useful inside a virtual machine. Disabling it reduces network requests and improves overall responsiveness when opening the Start Menu, keeping its search local and lightweight.
- Press Win + R, type regedit, and press Enter.
- Navigate to:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows - If the key Explorer does not exist, right click Windows, select New, choose Key, and name it Explorer.
- Inside Explorer, right click on the right side, choose New, select
DWORD (32 bit) Value, and name itDisableSearchBoxSuggestions. - Double click it and set Value data to 1.
- Close the Registry Editor and restart Windows.

Remove Ads and Recommendations
Windows 11 displays ads, suggestions, and promotional notifications across the Start Menu, Lock screen, and Settings app. These are unnecessary inside a virtual machine, and turning them off reduces background activity. Go to Settings > Personalization > Start and turn off:
- Show recently added apps (optional)
- Show recommendations for tips, shortcuts, new apps, and more

If you activated Windows, you can also tweak the Lock Screen Settings. Go to Settings > Personalization > Lock screen and configure:
- Change Personalize your lock screen from Windows Spotlight to Picture
- Turn off Get fun facts, tips, tricks, and more on your lock screen
- Set Lock screen status to None
Go to Settings > Privacy & security > Recommendations & offers and turn off:
- Personalized offers
- Allow websites to access my language list (optional)
- Improve Start and search results
- Show notifications in Settings
- Recommendations and offers in Settings
- Advertising ID
After applying these settings, Windows 11 will show fewer ads, suggestions, and promotional messages, making your VM cleaner and reducing background activity.
Disable Widgets and the Sliding News Panel
The Widgets panel in Windows 11 loads news, weather, and personalized content in the background. Even when you never open it, it uses RAM, CPU cycles, and GPU resources. Disabling it makes the VM lighter and prevents the panel from sliding in from the left.
Right click any empty area on the Taskbar.
Click Taskbar settings.
In the Taskbar items list, turn Widgets off.


Disable Unnecessary Scheduled Tasks and Startup Programs
Windows includes several scheduled tasks that collect diagnostic data, update location maps, or support retail demo features. These tasks provide no benefit inside a virtual machine and only add CPU wakeups and disk activity. Disabling a few of the heaviest tasks improves responsiveness. Press Win + R, type taskschd.msc, and press Enter. Expand Task Scheduler Library > Microsoft > Windows. Each sub-folder represents a group of scheduled tasks, the tasks themselves appear in the middle panel that contains a table of tasks, statuses, triggers etc. To disable a task, find its group at left, select the desired task in the table and click Disable in the bottom right under the Selected Item sub-panel (see the mouse pointer in the picture below).

Below is a non-exhaustive list of scheduled tasks worth disabling in a virtual machine:
- Application Experience > Microsoft Compatibility Appraiser Exp
- Autochk > Proxy
- Customer Experience Improvement Program > Consolidator and UsbCeip
- DiskDiagnostic > Microsoft-Windows-DiskDiagnosticDataCollector
- Maps > MapsToaskTask and MapsUpdateTask
- RetailDemo > CleanupOfflineContent
- Windows Error Reporting > QueueReporting
Finally, for the startup programs, press Ctrl + Shift + Esc to open Task Manager, go to the Startup apps tab. Review the list and disable anything you do not need on every boot. To disable, select the item and click Disable.

Adjust Visual Effects for Best Performance
Windows 11 includes many animations and visual effects that look nice on real hardware but add unnecessary overhead inside a virtual machine. Reducing these effects makes the desktop feel more responsive, especially when using virtio graphics.
- Press Win + R, type sysdm.cpl, and press Enter.
- In the System Properties window, go to the Advanced tab.
- Under Performance, click Settings.
- Select Adjust for best performance to disable all animations.
- Then re-enable the following options to keep text and icons clear:
- Show thumbnails instead of icons
- Show window contents while dragging
- Smooth edges of screen fonts
- Smooth-scroll list boxes
- Click Apply and OK.
The OS will be less prettier, but more useful.
Windows Subsystem for Linux
Finally, it's time for WSL2! Open the Windows Terminal and type wsl --install. It will ask you for elevation, download the latest stable version of the WSL package from Microsoft, enable the required Windows Features to support WSL2 and tell you that a reboot is necessary. Then, shutdown the VM completely.

Once the reboot completes, run wsl --install again to install Ubuntu. Proceed with the regular setup experience. Finally close the Windows Terminal and reopen it again. Start Ubuntu from the terminal drop down menu. Confirm that WSL2 is working, Ubuntu is properly set up and the terminal profile reflects the Ubuntu branding.

Congratulations!
Your KVM based virtual machine is running Windows 11 with WSL2! Now, if you try this guide in the future and it doesn't work exactly as described because of outdated assumptions, do not hesitate in propose updates and keep it current and useful!