[vfio-users] My guide for installing Arch Linux + QEMU-KVM-VFIO

Zir Blazer zir_blazer at hotmail.com
Sat Nov 5 15:48:42 UTC 2016


Around 2 years ago I did a guide for installing Arch Linux with Xen to do VGA Passthrough. I think not more than 3 or 4 people actually used it while it was up-to-date, then it got completely obsolete as KVM-VFIO outclassed Xen for VGA Passthrough. I decided to overhaul my old guide (Which is currently around 3 years worth of experience troubleshooting made text) and share it to see if I can get a few guinea pigs that want to setup a system with passthrough using my guide, which is quite different to all what has been already published.

The guide: http://pastebin.com/YnEgWfys

If you want something that isn't TL;DR, then my guide is ABSOLUTELY NOT FOR YOU. For reference, I proofreaded it and took around 4 hours while using it to setup my system, which isn't that bad considering that it took me around 30m-1h googling solutions for every minor issue that I had along the way. Also, keep in mind that the guide is extremely biased to my way of thinking and doing things, and many people will not agree with me, or do things differently. So far, it is EXTREMELY rudimentary and low level, I suck at customizing things to make them productive.
I tried to make a walkthrough as detailed as possible as I'm intending to catch the attention of people with little or no previous Linux experience that also wants to learn what they're doing along the way, instead of merely typing in commands like a codemonkey. If you think that everytime you google for info about passthrough you get bombarded with info, then you will find that my guide, while quite long, is actually much easier to follow that having 15 tabs with similar yet different instructions about how to do something. It should get you totally from scratch to have at least a Windows VM working.


The Hardware requeriments are rather simple (Again, keep in mind that the instructions are centric to what I could test it with):
- A modern Desktop Intel platform with a Processor that supports VT-d (I prefer Haswell platform or Skylake, since during Haswell era VT-d support got more widespread and is less probable than you have Firmware issues). You can also do it with AMD platforms with AMD-Vi/IOMMU, but at least the Kernel Parameter to enable it was different (iommu=on I THINK).
- Two Video Cards, and two Monitors, one for each, since is the simplest way to setup it. You can do other setups like using only one Video Card, leaving the host headless and using SSH to access it from the VM, but since I didn't tested it, I can't help people doing so.
It is not mandatory for the Video Card that you are going to do VGA Passthrough of to have UEFI GOP since there is a extremely nice tool, GOPupd, that you can use to manually mod your Video Card Firmware. Also, since I don't have a nVidia Video Card, I didn't covered all the workarounds that you have to do to bypass the GeForce Drivers VM checks.

If your computer is less than 3 years old and you have a discrete Video Card, chances are that you're good to go. Maybe is even more important to have an empty HD/SSD, otherwise you will have to setup something more similar to Dual Boot first.


Guide highlights:

- A full overview of Hardware that should be compatible and their features
- Uses Arch Linux as base, with systemd-boot for UEFI Boot
- Extremely simple partition scheme (GPT with 3 partitions: EFI System Partition, Arch Linux partition, everything left for a big LVM partition)
- Basic Arch Linux configuration as per the Arch Wiki
- Uses systemd-networkd setup with MACVLAN/MACVTAP
- Uses Wayland as X.org replacement, with sway as Windows Manager
- Uses standalone QEMU from the command line with scripts. I don't use libvirt or any other frontend


Keep in mind that the guide itself is not finished. You should be able to boot Windows 10, install it, and install the Video Card Drivers, which will be enough for a working setup (And to keep you entertained). However, I'm missing major tuning:

- You have to repeat a few commands on every reboot (The script to bind the Video Card to VFIO, and launching the VM).
- Since I believe that the host will be for management only, I stick to root and bypass creating other users. I know that this is not recommended for general Linux users and don't care about that, but is also not recommended for QEMU since exploits could be more powerful if QEMU is run as root, which is worth of consideration.
- sway is ridiculous superficially configured. Tiling Windows Managers are a bit demanding to actually be productive with them (You will notice when the QEMU windows get resized). I have to learn how to configure sway so each QEMU windows opens by default Fullscreen in its own Workspace with its native resolution.
- The way that Wayland handles input with QEMU seems a disaster. QEMU doesn't grab the Mouse cursor as it does in X.org (With openbox/i3). I suppose that I have to use -object input-linux, at least for the Mouse.
- Still missing instructions about how to get sound working. The easiest way is to install Pulseaudio and let it manage everything. I never got things working by tuning for ALSA, still in the TODO list.
- The guide itself is still rather disorganized. I'm thinking that my guide will be hard to digest no matter what I do, unless I migrate to a Wiki to modularize the content and add links to centralize the long explanations.


Have fun.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/vfio-users/attachments/20161105/f9e356bc/attachment.htm>


More information about the vfio-users mailing list