Home - HikariKnight/vfio-setup-docs GitHub Wiki

A streamlined VFIO+LookingGlass setup guide

Note: Guide is written primarily for Ubuntu 18.04 and newer

Preamble (pre-ramble)

Hello, my name is Ove, also known as HikariKnight. I am a mostly unemployed IT worker and have been so since 2013, I have a passion for scripting, automation, virtualization, Linux and cross platform development.

Overall I have about 15 years of experience in this through just studying in my personal time since I was 13. I also have dyslexia, so if something is not understandable for you, feel free to @ me on twitter https://twitter.com/TheHikariKnight

I decided to write this guide to make it easier for people to get VFIO GPU passthrough set up and running and properly configured, as I noticed all the guides out there stop after you have the virtual machine running with GPU passthrough and do not show how to improve it or maintain it if you are planning on using it permanently. Like in some cases related to SSD passthrough, they do not notify users that they need to configure their SSD as a SCSI device and make the virtual machine use the virtio-scsi controller in order to enable TRIM support. I also noticed all the guides I have seen, lack general quality of life tips and tricks as GPU passthrough is not super seamless by default.

During this guide you will encounter 4 types of tables.

The terminal

Text appearing like this, means it should be run in a terminal

File edit

Text in these boxes are meant to show what you should type in or copy+paste into files

Boxes like the one below are for editorial notes or extra information

Extra details or information

The table below is used when there are different configurations to do based on hardware, you only need to focus on what the box below the configuration that matches your setup tells you to do, the boxes below the configuration header can be either a terminal box or a file edit box(light grey/highlight).

Configuration 1 (terminal example) Configuration 2 (file edit example)
Things to do for config 1 Things to do for config 2

Support me on ko-fi if you feel like it and if it has helped you.

https://ko-fi.com/hikariknight

Why and what is this for? Why bother?

Dual booting is annoying, constantly having to reboot (and possibly wait through Windows Update deciding it is time to force you to install an update) to the operating system you need, depending on what you want or need to do.

And then there is just so much that Wine, Lutris and Proton/SteamPlay can do, not everything will run through those.

Finally, virtualization tech and driver support has finally gotten to a point that it makes sense to do this now and to teach people how to do this without forcing them to learn how everything works internally.

Running programs inside a virtual machine will give you full compatibility, except for programs that rely on PCI-e hardware which is not supported in Linux, or maybe you are wanting to play a Windows game that does not work in Wine or Photon.

Passing that device through to the virtual machine using VFIO and PCI passthrough will then give the virtual machine full access to that hardware.

Doing this to a graphic card will then give you the ability to run Linux as your main operating system, while using Windows running inside Linux for playing windows games or running Windows only software with full hardware accelerated graphics and in most cases with less than 1% performance loss on modern hardware, on older hardware you may get a slight performance loss.

Sadly there may be more costs associated with it on some systems if you lack storage space or a 2nd graphics card, or lack an Internal GPU or APU, but it is a worthy price to pay if you rather want to run Linux as your main operating system but can’t due to that one program or because all your games do not work in Linux.

So if you are like me and want to or prefer to use Linux, but still rely on Windows for some things, I have written this guide specifically for people like us!

It covers everything from setting up the system for VFIO, to fine tuning the system for your use case and specifications!

I really hope you will get good use of this guide and document.

And I hope this will make your life easier when it comes to using both systems at once.

Some information for this guide comes from other sources while most is from personal experience and is publicly available in several locations in bits and pieces or as incomplete to somewhat full guides.

Sources for some of this guides information:

Level1Techs - https://forum.level1techs.com/

LinuxUprising - https://www.linuxuprising.com

Rokups Tech Notebook - https://rokups.github.io/

My own personal experience