Windows VM with GPU Passthrough, Part 0: Introduction
As you may know, I contributed quite a bit to the Looking Glass project — an ultra-low-latency viewer for virtual machines with GPU passthrough. To those who understand the use case, this is amazing technology; but to most people, these words hold little meaning. I had plenty of difficulty explaining what this is all about, so I thought I’d write about it.
What is GPU passthrough? It is essentially giving a dedicated GPU to a virtual machine, just as if you plugged it into a PCIe slot if it were a real machine. This is commonly called “VFIO” (Virtual Function I/O). Originally, this is intended for server applications, for example, giving a network card to a virtual machine. These days, however, it’s also commonly used by Linux users to run a Windows virtual machine to play games at native speeds without dual-booting — just as if you had a separate Windows computer.
Annoyingly, this requires you to plug a monitor into the Windows GPU to get a display output, requiring you to either have a new monitor, switch inputs, or buy a KVM switch. Looking Glass is meant to address this problem — by capturing the output of the Windows display and presenting it to you in a window that is integrated into your favourite Linux desktop environment. This eliminates all annoyances with monitors — simply move your mouse into the window to start using Windows, and move it out to use Linux.
In this series, I will slowly walk you through the process of creating such a virtual machine and installing Looking Glass, explaining the technical details along the way. Expect updates over the next little while:
- Part 1: Creating a basic Windows VM
- Part 2: Passing through PCIe Devices
- Part 3: Setting up Looking Glass
Additional Notes
It is worth noting that Looking Glass is hardly limited to displaying Windows games. Many have used Looking Glass for various productivity applications as well, e.g. for CAD. In the latest bleeding edge builds (post-B5), builtin audio support was added, creating a full, immersive experience out of the box.
For a more detailed introduction, check out this excellent video by gnif, the creator of the project: