Has anyone set up QEMU successfully for Windows gaming in Linux?

I'm trying to get KVM/QEMU to work well for Windows gaming on Gentoo Linux but the performance is not satisfactory.

I have enabled KVM support, Intel processor support and host kernel acceleration in my kernel. I emerged qemu and aqemu for a GUI.

I've been reading the Gentoo wiki and other forums and they say to make a shell script in order to simplify QEMU's complex configuration but I can't find any sufficient documentation to write one up.

Does anyone have any tips or good guides to implement QEMU properly for Windows gaming? And is it possible to do VGA passthrough or an equivalent technology using a single card?

Thanks :D

Why not Xen?

The documentation for creating a qemu script can be found here:

qemu-system-x86_64 -h

They say to create a script because there are a humongous number of options that you must either type out every time on the command line, or just once in a script.

If you are looking for a sample, off the top of my head I believe OmniOS has one in their wiki.

VGA passthrough I haven't heard of in QEMU, but that may not necessarily mean it doesn't exist. Looking on google for a second brings up this recent thread on the Arch forums: https://bbs.archlinux.org/viewtopic.php?pid=1400381

To be honest, I don't see QEMU as a viable option for gaming. I could be wrong though. Things may have changed recently that I'm not aware of.

Thanks Freq. So from your knowledge Xen is a better alternative to KVM? I'll do some research into Xen and give it a go. I'll also look into the qemu script documentation you listed. Cheers

Yeah all the information I've come across is about Xen at least, and I know for sure there are quite a few tutorials for VGA passthrough with Xen.

I read a lot about Xen+Gaming - especially about the hardware. So forgive me for being offtopic: what are your specs? :D

If you are using your current system you will run into problems because of the Asus Z77 board and your K processor - they don't support vt-d, which is required for VGA-Passthrough. Same for your next K-Processor and maybe for the new MB, too. I don't know about the Maximus VI Gene, but Asus seems to be uninterested to support vt-d in consumer products.

In the XEN documentation one can read that nvidia-cards are more likely to make trouble. So like me - you may have chosen the wrong hardware for this. :)

Hey 193rd,

CPU is Intel Core i7-740QM which has the VT-x and VT-d extensions. Graphics is nVidia GeForce 435M. Unfortunately I don't have a second GPU which a lot of virtual machine implementations rely on. My desktop PC uses Windows 8.1 mainly ONLY because I have uni programs on it. Once I can run MATLAB, Altera Quartus, Solidworks, etc perfectly either using WINE or virtualised Windows, then I'll make the complete switch to Linux on that machine too. For now I'm making my laptop my Gentoo machine (which boots faster than my current rig which is several years newer...).

It's a shame about nVidia support, but nonetheless we may as well give it a go. Xen seems to be the way forward so I'll put some effort into that avenue.

This site is so good for Linux questions. Between the193rd, Freq Labs, Zoltan, thirdmortal, brennanriddell and others I can't remember, we're set.

Quartus actually has a Linux version, as does MATLAB. You're screwed with Solidworks, though.

I can't get either for free unfortunately. Maybe if I torrented them but the uni provides an educational copy for nothing. Didn't know there was a Linux version of Quartus. Yeah wish Solidworks would run natively.

Quartus II Web Edition is definitely free, though I think it is maybe slightly limited in what devices it can generate bitstreams for. I've been using it to tinker with the FPGA in an eeColor Color3 on Arch Linux, no problems whatsoever. Most non-obscure low- to mid-range devices should be supported, at least.

MATLAB probably costs a bundle, but maybe you could check out GNU Octave, or numpy/matplotlib/scipy/pylab if you're into Python. They may not be drop in replacements for MATLAB, but if you're interested in having something to use once you can't rely on a license from school, these could be good things to start getting acquainted with.

Did you take a look in your bios/uefi if you can activate vt-d/your MB supports this?

Furthermore I dont know if you can use vga-passthrough with only one gpu. In my understanding the host isnt allowed to use those devices. Audio could be a problem,  too. 

I dont want to crush your plans though! I never tryed this myself and I am very interested in your results! I have some bookmarks at home - I will take a look if  there is something usable for you. 

QEMU is a processor emulator, its usefulness in gaming is limited to games that require more processor cores artificially for certain functions, like BF4 to a certain extent, where it's not possible to hack the artificial software limitations out of the game.

KVM by far offer the best performance, it's faster than Xen, so it definitely is a better option for gaming.

I have scripted the setup when I was using it, with a VGA passthrough. But I haven't been using my Windows container for gaming since february 2013, the last time when I played a Windows game in the Windows container. Because of the countless Windows updates since then, the Windows install in that container is now broken, and I haven't bothered fixing it because I have better things to do than to spend my time fixing inherently broken malware, and I don't game a lot, but the games I do play, run in Linux. I've decided to be consequent about software: I don't use Windows software period, and that includes games that don't run in wine. Most of my games do run in wine just fine though.

To configure kvm for VGA passthrough, you have to script the container. For PCI passthrough (dual graphics), it can be done just using virt-manager, but to be honest, you wouldn't know how to configure what without knowing some CLI commands to get information about the system that you need to configure the PCI passthrough (not difficult, just dmesg, lspci, glxinfo, basic stuff like that).

The most important thing to know for VGA passthrough to work, is that it will only work with AMD cards, not with nVidia cards, and that you can only use KMS drivers in your host, because KVM uses the host's kernel, and you unbind the GPU from your host when starting the KVM container. So you can only access your host through ssh once you start up the container, which means that you have to think that through before starting the container, so that you can get to your host, without exposing the container or the host to security risks.

Xen is a viable option, it is only a bit slower than KVM, and it has the benefit of also working in Android (which is still in alpha, so it "kinda" works. The problem with Xen is the distro support. Some distros have a good Xen integration, like OpenSuSE, but most distros just "run" Xen, but do not offer full hypervizor implementation with the same functionality as running Xen Hypervizor on bare metal.

If you have and AMD card, and a dual graphics adapter (AMD or Intel spare GPU for the host when the main AMD GPU is passed through), it's not terribly difficult to set up a PCI passthrough with kvm, but there is no single config, it depends a lot on the specific hardware, so it's just not possible to give a "how to" that will work on all systems. People with nVidia cards or unsupported motherboards, are just out of luck. I've said this before and the193rd also explained it in this thread, but it's not because your CPU has VT-d that you're in the clear: a lot of mobos block the address translation that is necessary to run a passthrough.

As to 3D CAD, check out this "Solidworks-like" 3D CAD program, which is commercial closed source software for linux, but they offer a free trial version to get an idea of what it does: http://www.varicad.com/en/home/products/download/

Xen I understand can do primary graphics passthrough, and even a few nVidia cards reportedly work out of box or with some level of hackery:



Unfortunately, it seems the OP's mobile gpu hasn't been reported to work. It might still be possible, but there is little hope that a simple guide can be found.