Gaming in a VM
powerload79 Mar 9, 2015
Native gaming on Linux is awesome. For most of the games that don't have native ports, WINE is a very viable option.

There are however, a few games that haven't been ported to Linux (at least not yet) that won't run under WINE (in general, 64-bit games, and games that require DirectX 10 or better).

For those I run a Windows VM with VGA passthrough. For those of you that are interested in doing similar, I am writing some articles documenting the solution and various pitfalls I encountered along the way. You can have a read about my initial configuration using Xen here:
http://goo.gl/HNYkVO

I am currently building a Mk2 setup, this time using KVM to accommodate for a better native Linux Steam and WINE experiences (Xen dom0 support is increasingly broken in Nvidia's binary drivers), which will be documented in the subsequent article(s).
Aryvandaar May 4, 2015
Do I need two graphic cards to run a KVM with graphics pass-through?
powerload79 May 5, 2015
Theoretically, no, you could run Linux console on, say, a serial port. But realistically, yes, you'll need one GPU for the guest pass-through, and another one for the host. They don't have to be the same, or even similar.
powerload79 May 11, 2015
Here is part 2 of the article. Simplified and re-implemented using KVM:
http://www.altechnative.net/2015/04/05/virtually-gaming-part-2-evolution-consolidation-and-move-to-kvm/
loggfreak May 21, 2015
too bad it doesn't really work on a laptop, as far as i'm aware i'm not able to pass through my Optimus graphics card to the windows VM
powerload79 Jun 7, 2015
It is possible, but depending on your hardware, the degree of difficulty will vary. There are several issues that need to be overcome to use PCI passthrough of the Nvidia GPU in an Optimus configuration.

1) The Nvidia GPU is not wired up to any outputs. It is completely headless, and the way it normally works is by copying the framebuffer from the Nvidia GPU to the Intel GPU for displaying. If the Nvidia GPU was passed through to a VM, we would have to connect to it using something like Splashtop, Steam Streaming, Limelight or similar. This is not an insurmountable problem, and the performance would actually suffer particularly badly because both Kepler and Maxwell class GPUs have dedicated H264 real-time encoding hardware. That means the only actual overhead would be H264 decoding on the Intel GPU, which is unlikely to be a show-stopping issue.

2) By far the biggest potential problem is initializing the Nvidia GPU inside the VM. The main problem is the firmware, or rather, it's potential lack. If the Nvidia GPU has a discrete EEPROM chip, you are in luck, and the driver will be able to extract it as normal, and initialize the GPU. If your GPU firmware is in the main system firmware and is retrieved via an ACPI call, that gets harder. You would have to write a custom ACPI module that implements the _ROM() method which works a bit like pread() and returns the requested byte ranges of the firmware binary blob. You then side-load that ACPI module into QEMU so the guest OS can access it.
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
Login / Register


Or login with...
Sign in with Steam Sign in with Google
Social logins require cookies to stay logged in.

Buy Games
Buy games with our affiliate / partner links: