Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

MoritzWM/vfio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My VFIO setup

NOTE

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.

Acknowledgements

This setup was made possible by:

Hardware Setup

  • 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

How-to

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

The GPU VBIOS

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)

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.

File and folder explanations

  • arch_vm.conf -- systemd-boot entry
  • scripts/ -- well... launch scripts, helper scripts, environment variables
  • libvirt/ -- the windows10.xml file, which contains all the configuration and an explanation what I did
  • kodi/ -- Kodi addon to launch windows
  • windows.desktop -- Nice desktop entry for GNOME
  • windows.service -- Systemd unit file