My Ideal Computer: Linux Host with Windows VM and GPU Passthrough
A detailed guide to building the dream PC setup: Linux as the primary OS with a Windows virtual machine that supports GPU passthrough, bare-metal dual boot, and low-latency remote gaming via Moonlight and Sunshine.
Introduction
The author describes their ideal computer configuration:
- Primary OS: Linux
- Windows on a dedicated SSD
- Ability to boot either from GRUB or from a virtual machine
- Passthrough of a second GPU with a physical display
- Fast remote connection for gaming
What You'll Need
- A dedicated NVMe SSD for Windows
- A second graphics card (or a single card with automation)
- A suitable hardware configuration with proper IOMMU groups
- A few configuration tweaks
IOMMU Groups
Hardware is grouped into IOMMU groups at the hardware level. You can check your groups with the following commands:
sudo dmesg | grep iommu
lspci
lspci | grep NVMe
lspci | grep VGAIn the author's case, the NVMe drive (01:00.0) was in group 14, the NVIDIA GPU in group 16, and the AMD Radeon in group 15 alongside other devices.
SSD Passthrough
The process of creating a virtual machine through virt-manager:
- Install Windows from an ISO image
- Add the physical NVMe drive instead of a virtual disk
- Important: select the correct BIOS/UEFI (it must match the host for dual boot to work)
- Pass through the PCI device for the NVMe drive
Key point: "IMPORTANT!!! Go to the first item 'Overview' and select BIOS/UEFI" — this must match your host system's firmware type so the same Windows installation can boot both natively and in a VM.
GRUB Configuration
After installing Windows on the virtual machine, regenerate the GRUB config:
sudo grub2-mkconfig -o /etc/grub2-efi.cfgGRUB will automatically detect the Windows installation on the passed-through NVMe drive, adding it as a boot option.
GPU Isolation
To prevent the host from claiming the NVIDIA GPU, blacklist its drivers:
sudo vi /etc/default/grubAdd to GRUB_CMDLINE_LINUX:
rd.driver.blacklist=nouveau,nova_core modprobe.blacklist=nouveau,nova_coreAfter rebooting, verify the GPU is free:
lspci -nnk | grep VGA -A3The GPU should show "Kernel modules: nouveau" without "Kernel driver in use" — meaning no driver has claimed it and it's available for passthrough.
GPU Passthrough to the Virtual Machine
In virt-manager, add the NVIDIA GPU as a PCI device. If you encounter the error "group 16 is not viable," you need to add all devices from IOMMU group 16, including the NVIDIA Audio device.
After passing through the graphics card, the monitor connected to that GPU lights up, and Windows sees the graphics adapter natively.
The CPU Problem and Its Solution
A virtual machine with an improperly configured vCPU topology runs slowly even in simple games. The solution is to reconfigure the CPU topology with the correct distribution of sockets, cores, and threads (for example, 8 vCPUs with the proper topology instead of an incorrect flat distribution). Getting the topology right — matching the host's physical layout — is critical for performance.
Remote Connection for Gaming
Instead of requiring a separate physical monitor, you can use Moonlight (client) and Sunshine (server) for video streaming. Moonlight mirrors the video from the physical display, providing low latency suitable for gaming. This means you can play games on your Windows VM from your Linux desktop without switching monitors or inputs.
Removing the Virtual Display
To clean up the VM configuration and avoid conflicts:
- Remove the USB redirectors (SpiceVMC)
- Change the video device from QXL to None
- Remove the Spice graphics elements from the config
Conclusion
"So I've built my dream setup: Linux as the primary system with a fast Windows gaming VM that I can boot into from UEFI on bare metal if needed." This gives the best of both worlds — the flexibility and development environment of Linux for daily work, with instant access to a high-performance Windows environment for gaming, all on a single machine.
FAQ
What is this article about in one sentence?
This article explains the core idea in practical terms and focuses on what you can apply in real work.
Who is this article for?
It is written for engineers, technical leaders, and curious readers who want a clear, implementation-focused explanation.
What should I read next?
Use the related articles below to continue with closely connected topics and concrete examples.