Gaming on a Virtual Machine?

What is the best VM setup for running windows games with solid performance? For reference, I’m trying to get a VM setup to run this title linked below specifically.

https://steamdb.info/app/2507950/

Of course security is the priority here. Worst comes to worst I’ll just install it on my baremetall drive that already has windows on it. Just wanted to see if there was a solid VM setup that could work first. It would be nice to run this game on Linux more easily also…

https://steamdb.info/app/976730/

I know that it is possible to pass through your GPU to the VM, but I don’t know how to do that and I have a hunch that it will add quite a bit of latency no matter what. It might be best to install on bare metal if you plan to game. At least that’s what I would do.

1 Like

I ran a GPU pass-through setup with QEMU using virt-manager, with help from an AUR package called gpu-passthrough-manager. The easiest way to do this is with 2nd, dedicated GPU, one that your Linux box is not using. Sharing the keyboard/mouse is also a snap with evdev.

Before you decide to jump in, become as familiar with virt-manager as you can. You’ll need to be certain that your power supply is powerful enough to run the 2nd GPU, even when it’s not being used, or your system won’t boot. Also, make sure that you use a recent guide as the older ones required way more hoops to jump through that just aren’t necessary anymore.

The only reason I stopped using this setup was that the games I play run great under Steam/Proton.

2 Likes

The best graphics performance comes with vmware. vmware-workstation is for free.

virtualbox or kvm are not as good as vmware in that regard.

GPU passthrough for kvm needs a second GPU.

PS
Some of the Delta Force games seem to run on LInux with Proton as well:

And Master Chief Collection too:

2 Likes

Delta Force, the new one that was released recently and that OP mentions in the first SteamDB link, doesn’t work on Linux because it uses kernel level anti-cheat.
One of the devs has confirmed that they will consider potentially adding support for Linux/Steam Deck, but I wouldn’t hold my breath for it.

The Master Chief collection seems to work, though, as you’ve said.

1 Like

You can pass-through your DGPU, but that’s possible on laptops only. On desktops however, that’s where you will need a second gpu

Basically, this video:

1 Like

I’ve never ran a game in a virtual machine before. But looking at your links I assume this request is to do with Anticheat implemented in those games.

I could be wrong but I’m sure secure boot and TPM would need to be activated. I’m unsure if this is possible with a virtual machine, and I think secure boot may need to be off when installing Linux and I’m unsure if that transfers in to virtual machines I use VIRT+QEMU and I see no options regarding secure boot in it (Other VMs may vary). And virtual machines also add additional latency to actions if these are competitive games.

I was also going to set up GPU passthrough at some point for the challenge of doing it but found out you need two GPUs so I didn’t bother in the end as I wouldn’t be able to use GPU passthrough as a reward of doing it anyway.

It may be worth keeping the games on a separate drive that has Windows installed on it for this. I have set up many games on my system and they all work but they don;t have Anticheat which will be a problem on Linux.

Anyone can correct me if I’m wrong though but this is how I understood anticheat based games.

Its totally possible with only one:

Did successfully done that in the past by patching my bios (2011 era so no real iommu support without that). Need to try on my new rig tho!

2 Likes

So he’s running this off a diffferent non-arch based distro. Are the commands that same for Endev in the sections where he is detaching and reattaching the GPU? I’m not sure if it’s relevant but this is the machine I’m using for this.

I’ll probably end up doing that. That said, I’d still like to get as many things running on Linux itself as possible so as to avoid having to reboot into windows just to play one or two games.

Thanks for sharing, I will have a look through and see if I can maybe re-ignite my challenge again.
I found a few guides for doing it on github too but would need two GPUs, never found this specific one though for single GPU, or rather I wasn’t sure if they would work since I read elsewhere from multiple places you need Two GPUs so I was worried the single GPU ones would not work. Since you managed to get this working I will take a look for myself.

Yeah i don’t know why its almost always what you found on the web. But it possible. The solution is pretty cleaver when you think about it.

1 - before the vm start the host release the gpu.
2 - the vm start with the gpu
3 - the vm close and release the gpu
4 - the host reconnect with the gpu

And done :rocket: Since then i’ve also discovered how to connect/disconnect/restart a usb device/hub/controller :grin:

1 Like

Pretty sure you can do the same on non-arch distros. Some commands will be different like the package installation, but it’s still possible.

As someone who has attempted this off and on for years, i can only conclude that your a vmware shill/fanboy. It’s fine to enjoy a piece of software but this statement is woefully incorrect.

I am certainly not a vmware fan boy. In fact, I have abandoned vmware more than a year ago and fully use kvm+libtvirt now. (reason for abandoning vmware was the broadcom deal)

But anyways, the better graphics performance of vmware is true. vmware has better 3D acceleration, opengl and directx support. And all benchmarks I have seen on the internet support that. I havent seen any benchmark that puts virtualbox in the lead.

You can find many other benchmarks and comparisons.

As far as I know, there is only one virtualization solution that has faster graphics performance than vmware. And that is kvm with GPU passthrough. But that only really works out with two GPU, which is expensive.

Then I should have seen it. And not found many other threads drawing the same conclusion as I have. I’ve always been stuck with software renders on vmware without failure, when games do actually run under vmware,

Back with some infos :slight_smile:

amd_iommu=on is not a valid argument anymore, if IOMMU is active in the bios its ON by default, so now you only need to put iommu=pt. With eos + systemd-boot this need to be added in /etc/kernel/cmdline then

sudo reinstall-kernels && reboot

The message AMD-Vi: AMD IOMMUv2 loaded and initialized seem to also have been removed. alternatively:

sudo dmesg | grep iommu

For sharing you keyboard/mouse with the VM, share your usb controller(s) like you have done with the GPU.
Sharing individual usb device(s) is not possible or i don’t know how. From what i can see: when the vm launch, the usb devices are not anymore accessible, so the vm fail to start.

To get some infos when the vm fail to start:

sudo systemctl status libvirtd

Sadly kinda lost my day because its was for playing at sea of thieves (ms store … :cry: ) but apparently they have added easy anti cheat and ofc he don’t accept to run on vm …

It’s not incorrect within this context, context being windows vms.

Only exception is if you have a vm with non-virtualized graphics (e.g. vga passthrough).

If you never managed to get hardware acceleration working on vmware, that sounds a bit like a skill issue. Last I tried it it was a simple as ticking a box and installing some vmware drivers on the guest side. It was many years ago tho, i’ve mostly been using qemu for virtualization of late.

But I’m thinking since they finally have dx11 support it might finally be time to give them another try.

Last I tried it was a long time ago and enabling hardware acceleration in VMware and Virtual Box was useless unless you looked at a 2d application. That would actually yield a tangible result.

I could fire up any ancient or “easy-to-run” 3d game and barely see 15 fps on a good day. (I have 11 titles to choose from).

Didn’t matter what hardware was in the host, allocated to the vm, emulation settings or even tweaking hidden settings through manually editing config files.

If they have actually fixed their shit in recent years that’s good.

It’s also possible that some games just don’t run well under a vm no matter what you try to do (excluding anticheat)

So what, you’re talking about having problems 15 years ago with vmware? get outta here man