Running Windows inside Ubuntu is easy with KVM, QEMU, libvirt, and Virtual Machine Manager (virt-manager). These tools let you run Windows in a virtual machine without dual-booting.
Features include hardware virtualization, fast VirtIO storage and networking, USB passthrough, snapshots, and easy VM management.
Example: This guide uses Windows 10. Windows 11 can also run in a VM but requires TPM 2.0 and UEFI support for Secure Boot.
Note: Windows 10 support ended on October 14, 2025. For a new VM in 2026, Windows 11 is generally the better choice.
Step 1: KVM and QEMU Installation
What We Are Building
The final environment will look like this:
The technologies have different responsibilities.
- KVM — KVM (Kernel-based Virtual Machine) is the Linux kernel's hardware virtualization mechanism.
- QEMU — Its provides the virtual machine process and virtual hardware.
- libvirt — Its provides a management layer for QEMU/KVM virtual machines.
-
virt-manager — Virtual Machine Manager (
virt-manager) provides a graphical interface for managing libvirt VMs.
This combination is widely used for Linux virtualization and is an excellent foundation for learning virtualization and DevOps.
Other essentials are —
- OVMF — Its provides UEFI firmware for the virtual machine.
-
VirtIO — Its provides high-performance paravirtualized devices such as
Virtual disks,Network adapters,SCSI controllers - SPICE — Its provides the graphical console and guest integration features.
Windows 10 vs Windows 11
The basic KVM architecture works for both Windows 10 and Windows 11.
However, Windows 11 requires additional virtual hardware.
Microsoft lists requirements including:
- UEFI firmware
- Secure Boot capability
- TPM 2.0
- At least 4 GB RAM
- At least 64 GB storage
- At least two virtual processors
Therefore:
Windows 10
UEFI
VirtIO
SPICE
No vTPM required
Windows 11
UEFI
Secure Boot
TPM 2.0
VirtIO
SPICE
For this practical guide, Windows 10 is used because it makes the VirtIO installation process particularly easy to demonstrate.
Requirements (Hardware)
Recommended:
- 64-bit Intel or AMD processor
- Intel VT-x or AMD-V
- At least 8 GB RAM
- 80–100 GB free storage
- SSD recommended
- Ubuntu 26.04 LTS
For comfortable Windows virtualization:
16 GB RAM or more
is preferable.
Recommended VM configuration
For a host with 16 GB RAM:
CPU : 4 vCPU
RAM : 6 GB
Disk : 80–100 GB
Storage : VirtIO
Network : VirtIO
Display : SPICE
Firmware : UEFI
These values are starting points, not strict requirements.
Check Hardware Virtualization
Open Terminal.
Run:
lscpu | grep -E 'Virtualization|Model name'
On an Intel system, you should see something similar to:
Model name: Intel(R) Core(TM) i5-1135G7
Virtualization: VT-x
For AMD:
Virtualization: AMD-V
Check whether /dev/kvm exists
Run:
ls -l /dev/kvm
You should see something similar to:
crw-rw----+ 1 root kvm ... /dev/kvm
Install the KVM checker
sudo apt update
sudo apt install -y cpu-checker
Then:
kvm-ok
Expected result:
INFO: /dev/kvm exists
KVM acceleration can be used
If KVM acceleration is unavailable, enter your computer's BIOS/UEFI and enable hardware virtualization.
For Intel systems, the option may be called:
Intel Virtualization Technology
VT-x
Intel VT
For AMD systems:
SVM
AMD-V
Install KVM/QEMU and Virtualization Packages
Ubuntu 26.04 uses newer HWE virtualization packages, so older tutorials may show slightly different package names.
Install the main components:
sudo apt update
sudo apt install -y \
qemu-system-x86 \
qemu-utils \
libvirt-daemon-system \
libvirt-clients \
virt-manager \
ovmf \
bridge-utils \
dnsmasq-base \
cpu-checker
What these packages provide:
-
qemu-system-x86: QEMU x86 virtual machines -
qemu-utils: QEMU disk utilities -
libvirt-daemon-system: libvirt virtualization service -
libvirt-clients:virshcommand-line tools -
virt-manager: GUI virtualization manager -
ovmf: UEFI firmware -
bridge-utils: Network bridge utilities -
dnsmasq-base: Virtual network DHCP/DNS support -
cpu-checker: KVM capability checking
What about qemu-kvm? (Optional)
On some Ubuntu versions, tutorials tell you to run:
sudo apt install qemu-kvm
On newer Ubuntu releases, qemu-kvm may be a virtual package provided by another QEMU package.
If Ubuntu tells you:
Package qemu-kvm is a virtual package
that isn't necessarily an error.
For this setup, installing:
sudo apt install qemu-system-x86
is sufficient.
Configure User Permissions
Add your user to the KVM and libvirt groups:
sudo usermod -aG kvm,libvirt $USER
Check:
groups
You should eventually see:
kvm
libvirt
🔥 Important
Log out and log back in.
A reboot is also fine:
systemctl reboot -i
After logging back in:
groups
Configure the libvirt Network
libvirt normally provides a default NAT network.
Check it:
virsh net-list --all
You should see something like:
Name State Autostart Persistent
--------------------------------------------
default active yes yes
If default exists but is inactive:
sudo virsh net-start default
Enable automatic startup:
sudo virsh net-autostart default
Check again:
virsh net-list --all
How the default network works
The typical architecture is:
The Windows VM does not need a physical network adapter.
Verify the KVM Installation
Run:
kvm-ok
Then:
lsmod | grep kvm
On Intel:
kvm_intel
kvm
Check libvirt:
virsh list --all
No VMs should exist yet.
That's fine.
Check the network:
virsh net-list --all
You want the default network active.
Step-2: Configuration virt-manager
Download the Windows ISO
For Windows 10, download the ISO from Microsoft's official Windows 10 download page
For Windows 11, use Microsoft's official Windows 11 download page
Store the ISO somewhere such as:
~/Downloads/
For example:
~/Downloads/Win10_22H2.iso
For Windows 11:
~/Downloads/Win11.iso
Use a legitimate Windows license/product key for activation.
Download VirtIO Drivers
Windows does not necessarily contain the VirtIO drivers required for your virtual storage and network devices.
The virtio-win project provides Windows drivers and guest tools for QEMU/KVM. The project maintains stable and latest ISO builds.
Download the VirtIO Windows ISO from the official VirtIO project
Unofficial download link
Save it as:
~/Downloads/virtio-win.iso
You should now have:
~/Downloads/
├── Win10_22H2.iso
└── virtio-win.iso
VirtIO provides optimized virtual storage and networking drivers for Windows guests running on QEMU/KVM.
Create the Windows 10 Virtual Machine
Open Terminal and type:
virt-manager
Select:
QEMU/KVM
Then:
File
→ New Virtual Machine
Step 1 — INSTALLATION MEDIA
The configuration method is shown in the image below:
- Select Local install media (ISO image or CDROM)
- Then click Forward
Step 2 — SELECT THE WINDOWS ISO
The configuration method is shown in the image below:
- Click Browse
- Select from
~/Downloads/Win10_22H2.iso - virt-manager may automatically detect:
Microsoft Windows 10. (If it doesn't, select the appropriate Windows version manually.) - Click Forward
Step 3 — ALLOCATE RAM AND CPU
For a 16 GB host, a reasonable starting point is:
RAM: 6144 MB
CPU: 4 vCPU
For an 8 GB host:
RAM: 4096 MB
CPU: 2–4 vCPU
For a 32 GB host:
RAM: 8192 MB or more
The configuration method is shown in the image below:
- Set RAM as
4096MB (4GB) (NB: Its depends on your host computer) - Set CPU cores as
4(NB: Its depends on your host computer) - Then Click Forward.
Step 4 — ALLOCATE STORAGE
Create a virtual disk storage:
80–100 GB
For a general-purpose Windows VM:
100 GB
is a comfortable starting point if sufficient host storage is available.
The virtual disk format as qcow2
The default libvirt location is commonly:
/var/lib/libvirt/images/
For example:
/var/lib/libvirt/images/Windows-10.qcow2
Step 5 — CREATE A NEW VIRTUAL MACHINE
- Set name of VM OS
- Select Network
Avoid giving the VM almost all of the host's RAM.
Ubuntu still needs memory for:
- GNOME
- Browser
- VS Code
- Docker
- Background services
- QEMU
- Other applications
The configuration method is shown in the image below:
Configure UEFI (Especially for Windows 11)
💡If you want to install Windows 10 os, you can ignore this Step.
Before starting installation, enable UEFI.
In virt-manager:
Overview
→ Firmware
Select:
UEFI
This normally uses OVMF/EDK2 firmware.
For Windows 10:
UEFI
is sufficient.
For Windows 11, configure:
UEFI
+ Secure Boot capability
+ TPM 2.0
Microsoft requires TPM 2.0 and UEFI/Secure Boot capability for Windows 11.
Configure the Virtual Disk
Step-1: CONFIGURE THE SATA DISK-1
The configuration method is shown in the image below:
- Select SATA Disk 1
- Set Disk bus as
VirtIO - Click Apply
This gives Windows high-performance paravirtualized storage.
However, Windows Setup may not initially recognize the disk. That is why the VirtIO ISO must also be attached.
Step-2: ATTACH THE VirtIO ISO
The configuration method is shown in the image below:
In virt-manager:
- Click Add Hardware
- Select Storage
- Select as
Select or create custom storage - Click Manage and select from
~/Downloads/virtio-win-0.1.302.iso - Then click Choose Volume
Now, Which setting you have to configure that shown in the image below:
- Set Device Type as
CDROM device - Set Bus type as
SATA - Then click Finish
Step-3: CHECK SATA CDROM-1 and SATA CDROM-2
SATA CDROM-1 will be configured with Windows 10 ISO.
SATA CDROM-2 will be configured with virtio-win-0.1.302.iso.
Step-4: SET BOOT SEQUENCE
Which setting you have to configure that shown in the image below:
- Select Boot Options
- Select as
Enable boot menuand organize boot sequences as -SATA CDROM 1VirtIO Disk 1
- Click Apply
Configure SPICE Display
The configuration method is shown in the image below:
- Click Add Hardware
- Select Graphics
- Set type as
Spice server - Then click Finish
For the video device, use a model supported by your current virt-manager/QEMU/Windows combination. QXL remains a common SPICE configuration; VirtIO-GPU may also be available depending on the stack and Windows driver support.
Note: If any problem faced for selecting as Spice server, then switched as VNC server
Configure the Network
The configuration method is shown in the image below:
- Select the network interface as NIC :9d:f3:8f
- Set
Network sourceasVirtual network 'default': NAT - Set
Device modelasvirtio - Then click Apply
The final network architecture is:
Internet
|
Ubuntu
|
libvirt_NAT
|
VirtIO_NIC
|
Windows
Configure the CPU
Use:
CPU model:
host-passthrough
This exposes appropriate host CPU features to the guest.
💡Important! CPU topology correction
Do not use:
Sockets: 1
Cores: 1
Threads: 2
and then call the VM a 4-vCPU VM.
That configuration represents:
1 × 1 × 2 = 2 vCPU
For 4 vCPU, if manually specifying topology, for example:
Sockets: 1
Cores: 2
Threads: 2
gives:
1 × 2 × 2 = 4 vCPU
However, for a normal desktop Windows VM, simply allocating 4 virtual CPUs is usually easier.
The configuration method is shown in the image below:
- Select CPUs
- Select
ConfigurationasCopy host CPU configuration (host-passthrough) - Select
Manually set CPU topologyand set as Sockets:1, Cores:2, Threads:2 - Click Apply
Step-3: Windows Installation
Step-1: START WINDOWS INSTALLATION
The configuration method is shown in the image below:
Click Begin Installation
When Allow inhibiting shortcut diaglog box shown then click Allow button.
- Select Language
- Select Time and currency Keyboard
Then, click Install now
When prompted for a product key, you can select as I don't have a product key, if you plan to activate Windows later with a valid license.
Select the Windows edition you are licensed to use. For example, Windows 10 Pro
Accept I accept the license terms
Select as Custom: Install Windows only (advanced)
Step-2 (Method-1): LOAD THE VirtIO STORAGE DRIVER
When you may reach as Where do you want to install Windows? and No drives were found.
This happens because Windows Setup does not have the required VirtIO storage driver loaded.
Click Load driver
Then, click OK
Select as Red Hat VirtIO SCSI controller (E:\amd64\w10\viostor.inf) and then click Next
Select as Drive 0 Unallocated Space and click Next option.
Windows will create the necessary partitions automatically. The installation will proceed and the VM will restart several times. Once Windows starts booting from the virtual disk, you may remove the Windows installation ISO.
💡Keep the VirtIO ISO attached until the required drivers have been installed.
Step-2 (Method-2): LOAD THE VirtIO STORAGE DRIVER (Recommended)
When you may reach as Where do you want to install Windows? and No drives were found.
This happens because Windows Setup does not have the required VirtIO storage driver loaded.
Click Load driver
- Then, click Browse
- Navigate to:
"CD Drive (E:) virtio-win-0.1.302" > viostor > w10 > amd64
- Then Select and click OK. Its select
viostor.inffile automatically. - Click
Red Hat VirtIO SCSI controller (E:\viostor\w10\amd64\viostor.inf)and also click Next.
Windows will create the necessary partitions automatically.
The installation will proceed and the VM will restart several times.
Once Windows starts booting from the virtual disk, you may remove the Windows installation ISO.
Keep the VirtIO ISO attached until the required drivers have been installed.
Step-3: COMPLETE WINDOWS INITIAL SETUP
Complete the normal Windows setup:
- Keyboard layout
- Network
- User account
- Password/PIN
- Privacy settings
If you temporarily install without Internet access, you can connect the VirtIO network after installing the network driver.
Step-4: Install VirtIO Guest Drivers
Step-1: NETWORK CONNECTION AND OTHERS PERIPHERALS
After reaching the Windows desktop, open:
This PC
Open the VirtIO CD-ROM.
You may find:
virtio-win-gt-x64.msi
Install the appropriate package.
When these driver icon come to up, then select each for as Entire feature will be installed on local hard drive and click Next.
When the pop-up box come to up, click Yes.
Restart Windows.
Step-2: INSTALL SPICE Guest Agent (DISPLAY/GRAPHICS DRIVER)
SPICE guest components are separate from the general VirtIO driver package.
The SPICE project provides Windows guest tools including SPICE-related guest components.
Download the appropriate SPICE guest tools from the official SPICE download area and install them inside Windows.
Unofficial download link
This can provide features such as:
- Better mouse integration
- Clipboard integration
- Guest-agent communication
- Improved desktop integration
The configuration method is shown in the image below:
Restart Windows after installation.
Step-3: VERIFY VirtIO DEVICES
Go to Search box
Open Device Manager
Check:
- Disk drives
- Storage controllers
- Network adapters
- Display adapters
- System devices
There should be no unexplained yellow warning icons (⚠️).
If you don't see the yellow warning icon, it means that all drivers are installed correctly and there are no driver warnings.
If you see one, right-click it:
Click Update driver and then click Browse my computer for drivers
Select VirtIO drive or navigate to:
"CD Drive (E:) virtio-win-0.1.302" > viostor > w10 > amd64
Click OK.
💡 This method is highly likely to solve this issue.
Run and Manage Windows-OS
Step-1: INSTALL virt-viewer ON UBUNTU
virt-viewer can connect to a virtual machine and display its graphical console in full-screen mode. Therefore, you can use it to view your Windows VM. This Step is optional.
First, check whether virt-viewer is already installed.
Open the Ubuntu terminal and type:
virt-viewer
The configuration method is shown in the image below:
If virt-viewer is not installed, install it using:
sudo apt install virt-viewer
Step-2 (Method-1): RUN WINDOWS 10/11 OS WITH KVM-QEMU
Suppose you are using Windows 10 as the guest OS.
Open a terminal on Ubuntu and type:
virt-manager
When the Virtual Machine Manager window opens, select Win10 and click the Play button.
This will be shown as follows:
Now, open another terminal.
Type:
virt-viewer
When the Choose a virtual machine window opens, select Win10 and click the Connect button.
When the Allow inhibiting shortcuts dialog box appears, click the Allow button.
Now, enjoy!
Step-2 (Method-2): RUN WINDOWS 10/11 OS WITH KVM-QEMU
START VIRTUAL MACHINE
Open terminal and type:
virsh start Windows-10
Here, replace Windows-10 with the name you gave while creating the Virtual Machine.
Example:
Here, you used name as win10. So, your terminal command have to:
virsh start win10
Check status
virsh list --all
Open Windows 10 with Virt-Viewer
virt-viewer
When open a pop-up box as Choose a virtual machine, select win10 and click Connect
Now your Windows 10 OS will be run.
Now, enjoy!
SHUTDOWN VIRTUAL MACHINE
Shutdown your Windows OS
Then open terminal and type:
virsh shutdown win10
If you have trouble shutting down Windows, you can use this command to force your virtual machine to shut down.
virsh destroy win10
destroy does not delete the VM. It immediately stops the guest, similar to physically powering off a computer.
Use graceful shutdown whenever possible.
Create the First Snapshot
Once Windows is completely configured, shut it down.
In virt-manager:
Windows-10
→ Snapshots
→ Create
Name it:
Clean-Windows-10-Installation
You can create another snapshot after installing your normal applications:
Windows-10-Base-Apps
Snapshots are useful recovery points, but they should not replace proper VM backups.
USB Passthrough
USB devices can be passed from Ubuntu to Windows.
Examples include:
- USB flash drives
- Android phones
- USB printers
- USB adapters
- USB license dongles
Step-1: WHEN YOU WANT TO CONNECT USB DEVICES
The configuration method is shown in the image below:
In virt-manager:
- Select Virtual Machine
- Select Redirect USB device
Select the desired USB device and click.
Step-2: WHEN YOU WANT TO DISCONNECT / EJECT USB DEVICES
Unchecked your USB-Device and close the windows.
YOU CAN ALSO INSPECT USB DEVICES FROM UBUNTU
lsusb
Example:
Bus 001 Device 003: ID 046d:c077 Logitech Mouse
File Sharing Between Ubuntu and Windows
There are two different directions.
Step-1: Ubuntu → Windows
If Ubuntu contains the files you want Windows to access, use Samba or another network-sharing mechanism on Ubuntu.
💡 Note: If you want to learn how to install and configure SMB on Linux, see this note.
Windows can then access:
\\192.168.122.1\share
depending on the host-side network configuration.
Step-2: Windows → Ubuntu
If Windows contains the files you want Ubuntu to access, share the folder from Windows using SMB.
Windows shared folder ➜ [---SMB---] ➜ Ubuntu Files
In Windows OS
The configuration method is shown in the image below:
Folder Properties > Sharing > Advanced Sharing > Check Share this folder > Permissions > Choose Everyone & set permissions > Apply > OK.
Folder Properties > Security > Select Everyone > Set permissions > Apply > OK.
Go to the search box and type Manage advanced sharing settings.
Expand Private (current profile).
- Enable
Turn on network discovery. - Enable
Turn on file and printer sharing.
Expand Guest or Public.
- Enable
Turn on network discovery. - Enable
Turn on file and printer sharing.
Expand All Networks.
- Enable
Turn on sharing so anyone with network access can read and write files in the Public folders. - Enable
Use 128-bit encryption to help protect file sharing connections (recommended).
For normal use, do not disable password-protected sharing. Using authenticated SMB access is preferable.
Go to the search box, type cmd, and select Command Prompt.
Type the following command in the terminal:
ipconfig
Then look for the IPv4 Address. This is the IP address of the Windows 10 VM. For example, suppose the IP address is 192.168.122.128.
Access from Ubuntu
💡 Note: If you want to learn how to install and configure SMB on Linux, see this note.
Open Files on Ubuntu and go to the Network section. Enter:
smb://192.168.122.128
Then press Enter.
- After pressing Enter, a new Authentication Required window will appear.
- Select the password field and enter your Windows login password.
- Click the Connect button.
Select your shared folder. For example, suppose the shared folder is named Drivers. Open the folder.
Copy or place the file you want to share into this folder. For example:
spice-guest-tools-latest.exe
You can then access this file from Ubuntu through the Windows SMB share.
Backup the Virtual Machine (VM)
First shut down Windows:
virsh shutdown Windows-10
Check:
virsh list --all
Export the VM configuration:
virsh dumpxml Windows-10 > ~/Windows-10.xml
Back up the disk:
sudo rsync -avh --progress \
/var/lib/libvirt/images/Windows-10.qcow2 \
~/Windows-10-backup.qcow2
Your backup set should contain:
Windows-10.xml
Windows-10.qcow2
For a serious backup strategy, store the backup on a different physical disk from the original VM.
Useful virsh Commands
List VMs
virsh list --all
Start VM
virsh start Windows-10
Shut down VM
virsh shutdown Windows-10
Force stop
virsh destroy Windows-10
VM information
virsh dominfo Windows-10
Export VM configuration
virsh dumpxml Windows-10
List networks
virsh net-list --all
Start default network
virsh net-start default
Enable network autostart
virsh net-autostart default
Enable VM autostart
virsh autostart Windows-10
Disable VM autostart
virsh autostart --disable Windows-10
Common Problem
/dev/kvm Doesn't Exist
Check:
ls -l /dev/kvm
Then:
lsmod | grep kvm
For Intel:
sudo modprobe kvm_intel
For AMD:
sudo modprobe kvm_amd
Then:
ls -l /dev/kvm
If it still doesn't exist, verify that virtualization is enabled in BIOS/UEFI.
KVM Acceleration Is Unavailable
Run:
kvm-ok
If KVM cannot be used:
- Reboot.
- Enter BIOS/UEFI.
- Enable Intel VT-x or AMD-V/SVM.
- Boot Ubuntu.
- Run:
kvm-ok
again.
default Network Is Inactive
Check:
virsh net-list --all
If inactive:
sudo virsh net-start default
Then:
sudo virsh net-autostart default
Windows Says "No Drives Found"
This normally means that the VirtIO storage driver has not been loaded.
Go to:
Load driver
→ Browse
→ VirtIO CD
→ viostor / vioscsi
→ Windows version
→ amd64
Select the appropriate .inf file.
The virtual disk should then appear.
Windows Has No Internet
In virt-manager, check:
Network source:
Virtual network 'default'
and:
Device model:
VirtIO
Then verify the VirtIO network driver inside Windows.
Run in windows terminal:
ipconfig
If no adapter appears, open:
Device Manager
→ Network adapters
and install the appropriate VirtIO driver.
Display Is Slow
Verify:
Display:
SPICE
and make sure the appropriate Windows display/guest components are installed.
Also verify that the video device configured in virt-manager has a compatible Windows driver.
Windows Won't Boot After Changing Disk Bus
Suppose Windows was installed using:
SATA
and you later change the disk to:
VirtIO
Windows may fail to boot if the VirtIO storage driver wasn't installed beforehand.
The correct sequence is:
Install VirtIO driver
↓
Verify driver
↓
Shut down Windows
↓
Change disk to VirtIO
↓
Boot Windows
Don't change storage controllers randomly after installation.
VM Is Extremely Slow
Check:
CPU:
host-passthrough
Disk:
VirtIO
Network:
VirtIO
Firmware:
UEFI
Display:
SPICE
Then check host resources:
free -h
and:
top
If Ubuntu is running out of RAM or CPU, reduce the VM's allocation.
Recommended Configuration
For a host with 16 GB RAM:
┌──────────────────────────────────┐
│ Windows VM │
├──────────────────────────────────┤
│ RAM 6 GB │
│ CPU 4 vCPU │
│ CPU Model host-passthrough │
│ Disk 80–100 GB │
│ Disk Format qcow2 │
│ Disk Bus VirtIO │
│ Network VirtIO │
│ Network libvirt NAT │
│ Firmware UEFI │
│ Display SPICE │
└──────────────────────────────────┘
For Windows 11, additionally configure:
TPM 2.0
Secure Boot Enabled/Supported
Final Architecture
After configuration:
INTERNET
│
▼
Ubuntu 26.04 Host
│
┌──────────┴──────────┐
│ │
libvirt KVM
│ │
└──────────┬──────────┘
│
QEMU
│
┌────────┴────────┐
│ │
VirtIO SPICE
│ │
▼ ▼
Windows 10/11 VM Console
│
┌──────────┼───────────┐
│ │ │
Disk Network USB
VirtIO VirtIO Passthrough
Conclusion
KVM/QEMU is a powerful way to run Windows inside Ubuntu without dual-booting.



































































Top comments (0)