Play games in Windows on Linux! PCI passthrough quick guide

The hardware inside the KVM will appear different based on what resources you give the KVM, case in point: on my system my host CPU is a AMD 8370 (8 core) of which I give 6 cores to the Windows KVM, Windows sees this CPU as a AMD 6300 series (6 core) because that's all of the resources I'm giving it, same with the MB, most of the resources stay with the host system but I do pass a USB controller, a NIC, and a few other devices to the KVM physically instead of providing them virtually....as far as I can tell Win 10 has no clue running in a KVM what MB I'm using.

But....if you have used your Windows key on your host hardware, then install Linux and install Windows in the KVM Windows will in most cases see that as a new install and require a new key....

Hope that helps.

1 Like

If you see a console in the virt-manager window then you haven't removed all the display devices.

I removed that as well and still no output to the video card, are there any screenshots I can supply to get you a better idea of what I am looking at?

Does any thing need to be done to improve CPU allocation to the VM or does it just work? I'm looking to create a virtualized windows environment for gaming while enjoying the security and relative privacy Linux provides as the host OS.

A screenshot of the screen where you add and remove devices would be helpful.

Take a look at this thread. Just use the amount of cores and threads that your host has and it will be fine.

What CPU do you have?

Thank you. actually i haven't made a system yet, but am researching virtualizing windows over Linux because I want to get away from windows and its telemetry. I am trying to figure out what is the best way to go about getting hardware that will give a great gaming experience in the windows VM.

Here you go

Lots of cores, lots of RAM, an AMD graphics card for your VM, two monitors, another pair of keyboard and mouse :slight_smile:

I'm currently using kernel 4.10, but i'm not sure if the ACS patch is required for my iommu groupings.

01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP104 [GeForce GTX 1070] [10de:1b81] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation GP104 High Definition Audio Controller [10de:10f0] (rev a1)
02:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK104 [GeForce GTX 760] [10de:1187] (rev a1)
02:00.1 Audio device [0403]: NVIDIA Corporation GK104 HDMI Audio Controller [10de:0e0a] (rev a1)

/sys/kernel/iommu_groups/1/devices/0000:00:01.1
/sys/kernel/iommu_groups/1/devices/0000:02:00.1
/sys/kernel/iommu_groups/1/devices/0000:01:00.1
/sys/kernel/iommu_groups/1/devices/0000:00:01.0
/sys/kernel/iommu_groups/1/devices/0000:02:00.0
/sys/kernel/iommu_groups/1/devices/0000:01:00.0

You'll need the patch to separate the VGA and Audio device which are both on 01:00.x

Is the latest debian strech broken? I can install it but it wont boot when using the igpu. But will start with 1080gtx fine.

alright. Skylake............................

I tried to reproduce this in Xubuntu and it doesn't attach the Vfio module to the VGA and Network card which I try to pass thru.
But it does attach it to the Audio part of the GPU. Where could the problem be?

I do not use the ASC patch because I dont need it on Antergos at all so I figured I dont need it here either. Or? There it works flawless. But Antergos uses a different boot loader and the procedure is abit different.
I also prefer not to use Antergos as it tends to be not so stable as xubuntu.

VGA
Kernel driver in use: nouveau
Kernel modules: nvidiafb, nouveau
VGA Audio
Kernel driver in use: vfio-pci
Kernel modules: snd_hda_intel
Ethernet controller: Realtek Semiconductor Co
Kernel driver in use: r8169
Kernel modules: r8169

What exactly I'm missing here? I did follow the quide to the dot.

Perhaps someone can help me:

I configured everything exactly like in the guide but when I try to start the VM, there's no output-signal. The "second" screen stays black with "no signal detected". (I don't have a second monitor yet because I wanted to test all first, so I simply switched the input with plugging the HDMI cable into the graphics cards hdmi bus)

Is it possible, that my Mainboard doesn't support IOMMU? In the UEFI BIOS I can only find the "Virtualization for Intel CPUs" option to activate. There's no other related option to change, only the CPU Virtualization.

I got everything working, though I haven't been able to get audio working through a soundblaster USB dongle. My current workaround is audio streaming via VBAN to my phone and into a pair of headphones, but it's a cludgy and slow solution

Edit: I passed my asmedia USB controller (two ports on the back IO panel) to the VM, got sound working now :smiley:

wat.jpg

Yes, you will need the ACS patch.

For anyone thinking about doing an X99 based build, I highly recommend using Deepin 15.4 over other distros if using an MSI X99S-SLI-PLUS motherboard.

There's a major quirk (at least for me) where every other distro can't handle having a GTX 780 or any older card higher up on the board than a GTX 1070. Watchdog freaks out and the CPU soft locks during boot for most distros in this orientation aside from Deepin!

Finally got mine up and working with Dual E5-2670s, A GTX 1060 for host and a GTX 1070 for guest, getting an issue now with virt-manager whenever I fire up the VM I get output on my second display just fine but always get catapulted into UEFI Shell and all of my storage volumes are BLK(x) and every volume is empty.

I'm running Manjaro so I used the Arch guide on how to do it on the wiki which states : " If the installation process drops you in a UEFI shell right after booting, you may have an invalid EFI boot media. " - Have tried this on two separate iso's for win7 & 8 and still am getting the same issue :confused:

EDIT: I am also using the i440FX chipset option for this VM