This is not maintained anymore. Gaming on Linux is very possible nowadays (see ProtonDB). I don't have Windows anymore. I will keep this Repo up so someone might find it some day, but I will no longer contribute anything.
This setup was made possible by:
- the ArchWiki, most notably these two pages: PCI passthrough via OVMF, QEMU
- YuriAlek, who has an amazing GitLab repository with everything. Especially the testing-auto branch is nice
- joeknock90's GitHub repository, thats where I have the part in my windows10.xml from
- i7 7700K
- Palit Super Jetstream GTX 1070
- 8GB RAM, 6GB of which are reserved for the VM at any time (yes I know that sounds and maybe is stupid)
- an entire SSD is passed to the VM
I basically followed the instructions in YuriAleks wiki and the ArchWiki, but here is what I did (approximately):
- first, I set up my host according to the steps described in Setting up IOMMU and Isolating GPU
- I set up my VM with virt-manager and installed windows in it (see ArchWiki -- VFIO)
- using virt-manager, I removed the SPICE display and other unnecessary stuff, and set it to pass through the GPU, a USB controller (which my mouse and keyboard are connected to) and my PCI sound card
- using virsh (
virsh edit win10
), I set up additional stuff unavailable in virt-manager (see README in libvirt folder)- important here: set the rom file for the GPU (see below)
- in the VM, installed the graphics driver and voila!
- important: in the libvirt folder, there is the .xml file and an explanation what I did. Read it, otherwise the performance will be crap
You need to provide a patched GPU VBIOS if you want to use the boot GPU for your VM. First, you need to extract the VBIOS:
- either you download one from techpowerup
- some versions did not work for me, others did. Make sure to try a different version if it doesn't work
- you can extract the VBIOS with the extract-vbios-nvflash.sh script (see scripts folder) and nvflash (fromtechpowerup)
- if you run windows either in dualboot or in a VM with a dedicated GPU (like, the classical way), you can extract it with GPU-Z
- I needed to set the kernel parameter
'kvm.ignore_msrs=1'
in my host, otherwise launching GPU-Z would crash my system (see this reddit thread)
- I needed to set the kernel parameter
Then, you need to patch it. joeknock90 made a nice how-to for that. You can use the script he provides, or you can just use a hex-editor like bless and patch it manually. I patched it manually, it is very easy and probably quicker and safer.
arch_vm.conf
-- systemd-boot entryscripts/
-- well... launch scripts, helper scripts, environment variableslibvirt/
-- the windows10.xml file, which contains all the configuration and an explanation what I didkodi/
-- Kodi addon to launch windowswindows.desktop
-- Nice desktop entry for GNOMEwindows.service
-- Systemd unit file