Play games in Windows on Linux! PCI passthrough quick guide

Great tutorial. Will probably go through these steps when I get some spare time. I've found passthrough to be pretty tricky.

5 Likes

Bookmarked this to do when I have the time.

3 Likes

It is tricky. This method took me months to perfect, and it works very well. Report back with your experience!

1 Like

Makes me want to upgrade. Need to wait until zen is out first.

2 Likes

Anyone done testing on what kind of performance difference there is in doing this? Or maybe just how different it feels compared to running a video game on a Windows-native host machine? Would absolutely love to run a virtualized Windows setup like this, video acceleration is the only real thing keeping me from switching full-time to Linux.

2 Likes

I don't notice any difference really. The only difference you would have is CPU speed since it is sharing that with the host. The GPU is fully allotted to the VM.

I totally agree as well, video acceleration on Linux is awful. It takes a lot of work and configuring to get rid of screen tearing and make videos smooth.

2 Likes

PC specs: FX8350, MSI 990FX, 16GB RAM, AMD R9 390 (Guest), Nvidia 610 (host).

Hi, I have attempted this on Kubuntu 16.04 and ran into some difficulties with the VM (win10). I was able to successfully passthrough the GPU (R9 390) to the VM and load all the virtio drivers for the ethernet and PCI on the windows 10 VM.

The Windows 10 VM does detect the GPU but whenever I am in the process of installing the AMD graphics driver, the VM goes to a blank screen then reboots after a while, getting stuck on the "your pc has encountered an error" screen . It then restarts after collecting data and gets stuck in this cycle.
I am trying this with the VNC display just for testing. The plan is to run synergy afterwards, well once it's working.

I have tried both Win10 PRO and Home but with the same results. Note I am attempting this without an activation key as I wanted to test if it works properly before purchasing a win10 license. I am not sure if Win10 not being activated is causing a problem.

I have also attempted this with a HP Windows 7 Pro CD but the VM just gets stuck on the starting windows screen. After some research this seems to be a current bug requiring you to set the video to "cirrus" to work. Unfortunately I didn't have any luck with this at all and decided to stick with the Win10 instead.

1 Like

You have to remove any other display devices for Windows to use the GPU. Remove VNC, Cirrus, anything like I said to do in the guide.

Are you using OVMF? My guide is for Debian, Ubuntu does not have OVMF so keep that in mind.

Thanks for the guide, I'm going to be doing this when I get a new GPU, hopefully in the next month or so. Any info on how 10 series work with this? I'm considering a 1080 or 1080ti, depending on price and if it works well.

Any new GPU will work just fine since they all support UEFI.

I know that, but I also know that Nvidia does some shady shit with locking non-quadro gpu's out of VM's. I was more inquiring about if they've upped the ante with the release of the 10 series. If there's nothing there, I'll be in the market soon.

No, the same steps I list in the guide work.

sweet!

1 Like

Great to see these kind of tutorials posted.
Keep up the good work!.

3 Likes

I am using OVMF, was able to get it from the base repos. I am not sure if it was added recently to Kubuntu (16.04).

I actually deleted and then re-did the VM removing all display devices, so that on first boot it displays through my pass through GPU. I was not able to go ahead with the windows install though, as I was unable to assign a USB mouse and keyboard to the VM. I add the USB mouse and keyboard through the add hardware option on virt manager (1.3.2) but nothing happens. I tried doing this while the VM was running and also tried it when the VM was off. I tried adding another USB mouse and keyboard just in case but still no luck. Currently looking into this.

Just to make sure, there weren't any errors when you booted the VM with the mouse and keyboard added? And you are running virt-manager as root?

There were no errors on virt manager when I booted with the mouse and keyboard added. The VM displays shows the "press any key to boot from CD" option then eventually ends up the UEFI shell where I get no response from the added keyboard. At this point the mouse and keyboard still functions in the host OS while the VM is running.

I was actually running virt-manager as the current user (it is part of the libvirtd group). I tried it as root but no difference.

If you are running as root it will ask for your password when it opens.

You are using a second keyboard and mouse for the VM right?

And just to clarify the GPU does output to the monitor?

Yes, I have a wired mouse and keyboard for the VM that was added as two separate USB devices to the VM in virt-manager.

I am using a dual input monitor. The host connection is via VGA (Nvidia 610) and the guest connection is via DVI (R9 390). When I start the VM I get output from the DVI connection so the GPU was passed through successfully.

Do I need to blacklist the USB devices before adding it to the VM?

You don't need to blacklist anything.

The main reason I use Debian in the guide is because Ubuntu's packages are really out of date. Virt-manager gets updates all the time which have drastically improved its functionality.

I'm on virt-manager 1.4.0 on Debian Stretch. What version do you have on Ubuntu (hit Help and then about in virt-manager)