Maximum PC

Gaming on Windows on Linux Ain’t So Bad

USING LINUX has always meant being a second-class citizen for gaming. But if you’re up to the task, you can have the best of both Linux and Windows worlds.

- Alex Campbell

It sounds crazy, the idea of running Windows under Linux. If I’ve learned one thing from being a Linux user, though, it’s that I will go through extraordin­ary steps to play games. For me, being at the mercy of devs who may or may not port their games to Linux on Steam is infuriatin­g. Running Windows games and applicatio­ns in WINE is a nightmaris­h experience, full of half-implemente­d DLLs and missing functional­ity. And dual-booting my system just for the sake of games is always a pain in the ass.

My answer seemed to lie in the use of virtualiza­tion, though my previous experience using VirtualBox and VMWare Player has meant no GPU. After reading up on Linux’s built-in virtualiza­tion software KVM, I took the plunge, and banished Windows from the bare metal, and installed Linux on my precious high-end desktop.

And it was good. Once I got it working, using KVM to boot a virtualize­d Windows machine made me ask myself why I hadn’t done this before. By using KVM and the package qemu, I was able to pass a GTX 980 Ti through to the guest OS (Windows). The guest OS could then treat the GPU as though it were bare metal, and the Nvidia drivers were none the wiser. And performanc­e is nearly on a par with bare metal.

If you’re interested in doing this voodoo yourself, the Arch Linux wiki ( https://wiki.archlinux.org/ index.php/PCI_ passthroug­h_via_OVMF) has a great article on how to set up qemu/KVM with PCI passthroug­h. Although qemu/KVM works pretty well, there are a few caveats that you should know about going in.

The first thing you need to understand is that qemu is basically a virtualize­d firmware. Unlike installing Windows on the bare metal of a motherboar­d such as MSI or Gigabyte, the OS sees the hardware as qemu. The bad thing is that qemu doesn’t offer any support for SLI.

The second thing to know is that you need a newer CPU to pull this off. You need both a CPU and motherboar­d that support VT-d (Intel) or AMD-Vi. Your motherboar­d also needs to have IOMMU support enabled. And because you’ll be running a VM, be sure to have enough RAM to run both your Linux desktop and your Windows VM.

You need at least two GPUs, as well. Before you’re able to pass a GPU to the VM, you have to tell Linux to blacklist a specific hardware address before the Nvidia or Radeon driver can bind to it. This can be tricky if you have two of the same GPUs, because they have similar hardware IDs, and each card has both an audio and video device. That said, you can mix and match GPUs from different vendors if you dedicate one to the VM and one to the host. If you have a CPU that has an onboard GPU, you can use the CPU’s graphics to drive your Linux desktop, while using your PCIe device for your Windows VM.

Once you blacklist it, Linux can’t use the GPU you’ve designated for the VM. As a symptom of this, each GPU needs to attach to your monitor(s) separately. If you only have one monitor, it means that to switch to your Windows VM, you have to switch inputs on your monitor. You also have to keep a separate keyboard and mouse or a KVM switch handy.

As with anything Linux, getting a GPU passed through to Windows running in a VM can be a bit of a project. But if you prefer Linux, and just can’t let go of your Windows games, it is definitely a project worth the effort.

Alex Campbell is a Linux geek who enjoys learning about computer security.

 ??  ?? A Windows virtual machine guest runs KerbalSpac­eProgram on Linux.
A Windows virtual machine guest runs KerbalSpac­eProgram on Linux.
 ??  ??

Newspapers in English

Newspapers from United States