Enable hardware pass thru on KVM/QEMU for Windows VM's


jimbo45

Well-known member
Pro User
VIP
Local time
4:57 PM
Posts
4,288
Location
Hafnarfjörður IS
OS
Windows XP,7,10,11 Linux Arch Linux
Hi folks
If you are using KVM/QEMU to virtualize windows systems and you have decent (and sufficient) hardware you can pass thru to your VM -- this allows the VM to run at all but native speed especially if you can pass thru separate GPU's, or physical processors.

For grub bootloader and intel add this in the config file :

# GRUB boot loader configuration

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet"
GRUB_CMDLINE_LINUX="zswap.enabled=0 rootfstype=xfs intel_iommu=on iommu=pt" <<<<<<<<<<<<

simply add the intel_iommu etc to the relevant line.
For AMD there must be something similar.

For systemd boot -- haven't played enough with that yet but I imagine here most Linux users on this Forum would be using GRUB as their boot loader.

passing thru hardware means the actual OS hardware plus its native drivers etc are used which saves a lot of of potential overhead when normal "paravirtualisation" is used. Paravirtualisation emulates a lot of hardware so the same VM can run on a huge amount of different hardware and is fine for most things like Office docs, web browsing but get into multi-media editing, movie / other UHD streaming,game playing etc then you'll see the difference.

separating a physical processor in a multi processor system and passing thru a gpu should make your games etc run on a VM as per native windows.

Cheers
jimbo
 

My Computer

System One

  • OS
    Windows XP,7,10,11 Linux Arch Linux
    Computer type
    PC/Desktop
    CPU
    2 X Intel i7
Actually (unless you know a workaround), GRUB has almost reached its limit on my system, which has two OS's (Gariua <Arch> and Fedora Silverblue Rawhide, which use the BTFS filesystem (known as "better" FS for reasons). From each, I can directly boot Ubuntu Oracular (24.10) which uses EXT4 - although I could have used ZFS but that's another story), FWIW, concerning virtualization, only on Garuda can I run QEMU/KVM Gnome Boxes VMware and Virtualbox (I use a RAID0 which you and worked on during the Linux kernel 5.x/Windows 10 era). I can't even run VMware on Ubuntu (waiting on a workaround for VMware WS 17.5.2 on Github)

Cheers
 

My Computer

System One

  • OS
    Silverblue Rawhide, Mangaro 2024, Ubuntu 24.10
    Computer type
    PC/Desktop
    Manufacturer/Model
    HomeBrew
    CPU
    AMD Ryzen 7 7800X3D 8-Core
    Motherboard
    Gigabyte
    Memory
    64GB
    Graphics Card(s)
    Nvidia
    Monitor(s) Displays
    Dell
    Hard Drives
    3 ssd 2 spinners configured as raid 0
    Keyboard
    Eluktronics
    Mouse
    Eluktronics
    Browser
    Firefox and Chromium
    Other Info
    Gnome 45
Actually (unless you know a workaround), GRUB has almost reached its limit on my system, which has two OS's (Gariua <Arch> and Fedora Silverblue Rawhide, which use the BTFS filesystem (known as "better" FS for reasons). From each, I can directly boot Ubuntu Oracular (24.10) which uses EXT4 - although I could have used ZFS but that's another story), FWIW, concerning virtualization, only on Garuda can I run QEMU/KVM Gnome Boxes VMware and Virtualbox (I use a RAID0 which you and worked on during the Linux kernel 5.x/Windows 10 era). I can't even run VMware on Ubuntu (waiting on a workaround for VMware WS 17.5.2 on Github)

Cheers

@martyfelker

I find usually XFS still the best FS for most purposes with separate efi partition for boot (fs fat32) and just '/' for the OS and '/home' for the user data "homes". for swap ZRAM is fine - most distros create swap this way now.so I don't need to create or even define a separate swap partition. Btrfs just makes it too messy if I want to move stuff around and the stand alone bootable version of gparted makes copying and cloning partitions (even Windows ones) a doddle.

For grub - if you make the efi partition big enough -- > 100 MB but <= 499 MB then grub shouldn't be a problem no matter how many OS'es you have including loads of Windows ones on vhdx files. Also if you don't define a separate partition for /boot it will be created within the '/' partition when installing the system so you shouldn't get that problem of /boot not big enough.

The trouble with say Fedora with brtfs it creates a /boot partition of a fixed size and then you could run into probems.

As for Vmware -- works OK on Arch Linux with my currently running kernel of 6.9.x. Fedora is at 6.10.x -- I had problems with brtfs and "suggest partition layout" but I'll have a go with manual creation. Great thing about testing Linux stuff is that the whole kybosh can be done from external USB / NVME devices so no need to "destroy" existing OS'es on internal HDD's.

Cheers
jimbo
 

My Computer

System One

  • OS
    Windows XP,7,10,11 Linux Arch Linux
    Computer type
    PC/Desktop
    CPU
    2 X Intel i7

Latest Tutorials

Back
Top Bottom