New Desktop
Building a new desktop computer, it was clear from the start, that I would never run Windows on that machine. It was also clear, that a fairly powerful AMD CPU would power the system. So I did the only sensible thing, and installed a gaming VM in a Proxmox Host.
My experience was a little bit of frickling, and a lot of good results, but let’s start at zero:
A Non-Windows gaming machine?
All my notebooks run Linux, usually Arch Linux, and have done so for the last 15 years. At the same time, all my notebooks are notoriously underpowered, and would barely cope with games. So I played on my desktop Windows computer, always dreading the switch to Linux gaming.
So, while I had a clear goal set, it took a few years and new hardware to give me the push to at least try.
For the initial test of gaming on Linux, I searched for the shiniest Linux distro I could find, that also marketed towards Gamers. I settled for Pop!_OS, and installed it on an SSD for funsies. And it worked super well.
I am not a big fan of Ubuntu or flatpak, but if all I do is some gaming, why not? Well, that’s how they get you :-)
A Non-Windows gaming VM?
Now, with my Linux Distro of choice, I was ready to test if I could move the distro to a virtual machine hosted on Proxmox. This would give me the chance to utilize the CPU (and GPU, maybe) in more than one way. Coming from a platform that was mostly CPU bound, 24 core out of 36 for gaming is luxury.
With Proxmox v8.3.5, even the PCI pass-through was super easy. There was a bit of confusion when picking the right approach, and there will be tests for alternatives.
For my Nvidia 970 GTX, these were the possible strategies
- VM & vGPU - requires registering into some Nvidia program, but the GPU (don’t even know if mine qualifies) would be shareable between VMs
- VM & PCI pass-through - requires the proper IOMMU kernel modules, and some straightforward configuration in the Proxmox GUI, but the GPU is then bound to a single VM
- LXC & ??? - allows sharing the GPU with other workloads.
For me, the third option sounds perfect, but I have not figured out how to create a LXC template container for Pop!_OS, and installing on top of a previous Ubuntu image is unsupported. So, I went with option (2).
Moving Steam Libraries / Flatpak magic
Flatpak isolates applications from the rest of the system in sandboxes. So, to move the Steam library base directory off my home directory, access and permissions to the target location needs to be explicitly granted. The easiest way to do so, is using the software Flatseal.
So I
- mounted a hard drive at
/mnt/sdd, - allowed the Steam sandbox access to
/mnt/sdd/__games/steam-library, - configured Steam to expect a library in that folder,
- and finally moved existing game data to that very folder (from the first try).
Games were detected automatically, saving a few 100 GB of data volume. Yay!
“Mounting” a Hard drive in VMs
So - how to actually mount a drive in a VM? Usually, there is no way to do this except for file sharing over network (NFS or samba), but I did not want to go down that road.
Instead, one can simply pass the whole PCI device through to the VM, from where we then can mount it very easily.
The future
I would love to share the graphics card between VMs or containers, but the current setup does not allow for that. I do like the idea of an LXC container for gaming (also sharing the Proxmox Kernel, maybe not the best idea?!), but for me and my limited time there is no way to figure out how to build a non-standard LXC template.
So, maybe run a more standard distro for gaming? Yes, but I am hooked on the ease of Pop!_OS for now. Maybe this is sth to try if I finally do buy a new graphics card :)