If you like the idea of creating a Gaming VM, the next question you might ask is: OK, but how?
There are no single answer for this question, and you might find a lot of different approach by searching the internet. However, I’m only covering one: based on PCI Passtrough, which is a technology that allows a physical PCI device – like a GPU – to be assigned directly to a virtual machine (VM)
All other approach are sacrificing latency and performance, and booth are essential for gaming. And even this technology has different levels:
The enterprise grade solutions
Well, these are surely not designed – and priced – for gaming in their mind, but worth mentioning the existence of these enterprise level solutions:
The professional way
The GPU SR-IOV (Single Root I/O Virtualization) is a technology that allows a single physical GPU to be shared among multiple virtual machines (VMs), with each VM getting its own virtual function and near-native performance.
This enables each VM to have direct access to a portion of the GPU’s resources, however it’s still needs a professional grade hardware:
And this is not just about the GPU itself, but all the surroundings (Motherboard, BIOS) must support SR-IOV.
However, even if you can afford such a professional workstation, these are still not designed for gaming, but for CAD, and 3D modelling applications.
The affordable one
And now we are arrived (back) to the ‘consumer’ level, the hardware what you can actually by in your closest PC store… This category however flooded by unusable (but cheap) crap, you need to avoid. And this is the first challenge.
Unfortunately, I can’t suggest you exact hardware pieces, as I have not tried all the available parts out there, moreover local markets are considerably different. Means what I can by at the local stores at affordable price, that migh be not even available in your region.
So I can only share the requirements, and can only go into the details about what I actually have – see it in a lter post.
Requirements
- a Desktop PC
Yes, a good old – and probably custom buit – desktop computer. While there are very powerful gaming laptops out there, they are usually not suitable for GPU Passtrough for mutliple reasons. Some laptops can still achieve Gaming in a VM, but you would need to find a different solution, which usually comes with more compromise – as an addition. As ‘gaming laptops’ inherently comes with a lot.
- a well balanced configuration
This is not specific to virtualistaion, as any Gamer PC also needs this. As soon as you plan to run virtual machines, it is becoming more critical, as you going to share those resources (CPU, RAM, disk I/O) among multiple VMs. This usually means you need (much) more RAM, and faster (random read/write) disks to keep up with the increased requirements.
- a motherboard, with proper IOMMU groups.
Where ‘proper’ here means unrelated components should not be bonded together, as all the IOMMU group members must be passed trough toegteher.
Sou if your GPU is not alone in a group, that sucks. And you can only blame your motherboard vendor for such issues.
Unfortunately, you can’t find this info in the product data sheets. Neither in the vendor provided manuals. You must find out yourself, or you can relay on others already find and shared such information.
- a GPU suitable for PCI Passtrough
Here we go again: a requirement, that you can’t find out but after you bought and tried it yourself. You might search for these potential issues, but nobody can guarantee that you can avoid such. Especially if you going for a ‘just released’ GPU
- a GPU for your Host OS
Yes, that’s means you need – at least – 2 GPUs in your PC. This is however very easy to achieve, as most of the modern CPUs are having an integrated GPU, which is usually good enough for the Host OS.
- a second display(s) – or a display with multiple input options.
As you gonna dedicate one of your GPUs to a Guest VM, it’s output(s) needs to be connected to a display to actually see it’s screen.
- a second set of input devices (Keyboard + Mouse)
As you will have no virtual screen – how usually you provide virtual input devices – you need to provide a dedicated set of Keyboard and Mouse to your Guest VM, or a KVM switch as an alternative.
In this way – if all of your components are nicely cooperates – you can reach the goal: to create your Gaming VM. Technically you can have multiple ones, but you can only run a single one at a time – as you might guessed from the requirements above.
Implementation
Theoretically, now you have everything to achieve your goal. You ‘just’ need to implement this in practice ;)
And here you have multiple options again, to choose the:
- Virtualisation technology
Where you should prefer the Type1 hypervisors, like: Hyper-V, VMware ESXi, or KVM
- Host OS – which will manage your VMs
This might be defined by the virtualistaion technology you have chosen from above.
- Guest OS – which will actually run your games.
And this is usually your preferred Windows edition and version. I would highly recommend the Windows 11 IoT LTSC 2024, as this is the least annoying and the least intrusive – still supported – edition today. Keep in mind, that this version might require special licence, what you must obtain yourself.
As you see – again – you have a lot of options to choose from, however neither of those are guarantee success out of the box. You must find out yourself which combination of hardware and software are working for you.
I can highly recommend reading Heiko’s Blog, that was helping me a lot.
You can also read about my – very optimistic – but failed attempt using Qubes OS for Gaming
What I can show you in details – as a Proof of Concept – How I built my Gaming VM