If you’ve seen my twitter from time to time or been lurking in my Discord or Twitch streams you’ll know that I am a big enthusiast of using Linux KVM (Kernel Virtual Machine) magic to run a Windows virtual machine on top of my distro of choice, Arch Linux.
In doing so, this allows me to run both Linux and Windows at the same time while having a near-native level of performance. I can also pass-through devices like Graphics Cards, SATA controllers and whatnot into the virtual machine, so it looks more like a traditional bare-metal PC.
However, this luxury comes as a cost. The major downside is that this specific setup requires me to have one graphics card for the host (hypervisor) so I can use it as well as one graphics card for the guest, amongst other workarounds and some duplicated hardware.
My AMD Ryzen 9 5900X doesn’t have built-in graphics and my AMD X570 motherboard doesn’t seem to like sharing it’s on-board USB ports with the VM. It’ll work but is prone to quirks. As a work-around an add-in PCI Express USB card provides the VM with enough USBs.
Having another graphics card means extra power, even if it’s sitting idle most of the time since I’m working inside the VM and not the host environment. My setup ended up consisting of an AMD RX570 for the Host GPU and a nVidia GTX 1070 for the Guest.
Unfortunately, the RX570 GPU died one recent cold winter morning and since I don’t have any new graphics cards to replace it with, that was No Bueno. I had to dissemble the setup and roll back to native Windows 10.
Instead of passing through a emulated keyboard and mouse – which was a pain in the ass originally to setup – I have a USB 3.0 switchable hub that allows me to change between Host 1 and Host 2. This allowed me to utilise the advanced features on both my keyboard and mouse, like the macro keys and RGB lighting.
This was really useful, because if I needed to do things in Linux, I just switch to HDMI 2 on my monitor, press the button on the hub and off I would go. I’m back in the Windows VM world. Need to get back to Linux? No worries, hit the button, switch the monitor input, back in the Linux world.
It was tedious sometimes to switch back and forth when having to check stuff, but it was somewhat easier than using a VNC Viewer to see the Linux desktop.
Using udev pass-through to attach/detach the mentioned input devices dynamically worked to an extent, but it wouldn’t process keys like the dedicated macro buttons on my G613 keyboard or handle DPI changes since I use a Logitech G903 mouse. I ended up using the USB switch to cure my woes.
I have tried solutions like Looking Glass, however they have their own caveats. The viewer application was decent however it seemed to crash randomly for no reason, requiring one to restart the application.
Can I really go a full Linux stack…?
From time to time while I run this setup, I wonder if I can migrate my whole stack to Linux. The answer to that question is mostly yes, however there’s some big pieces of my work stack that don’t run, or run disappointingly, as in it works but it breaks randomly or runs really erratically.
Visual Studio is the biggest elephant in the room. I rely on it a lot, as it’s my IDE of choice and while I do program in C# and can use NET Core, I do have some projects that are written in NET Framework that use Windows-specific things. Sure, I could use Mono… but ha ha… Sure…
I could get away with Visual Studio Code, but I honestly didn’t like it all that much. I could also look into JetBrains’ Rider IDE, but I’m rather comfy with Visual Studio and I am not willing to spend a good 6 months getting acquainted with a new IDE just to find that I’m going to be switching back to Visual Studio.
Unity Engine on Linux works but in the rather clunky way of “it works”. I believe the clunkiness comes because it’s designed to run under Ubuntu and use it’s user interface for greater usability, but since I’m a KDE user it sometimes sticks out like a sore thumb.
Not to mention that from my testing, it didn’t link up to any supported installed code editors, so it was unable to open any script files as in I’d have to do that manually. In short, it works but is not ideal.
For games and applications, I can use the WINE or customized versions such as GloriousEggroll’s Proton-enabled fork of WINE to run my games that I would usually run on Windows.
Steam also works really well with its WINE support. Some applications such as XMPlay which is a great little media player instantly crash using the built-in libraries. Trying to use native DLLs to get XMPlay working causes it to hang the WINE subsystems.
On the penguin side, KDE’s media players sometimes crash trying to parse Japanese song titles in my anime and J-Pop music collections. For videos, VLC works which is more than enough for me to be playing videos.
Truth be told, I’m actually very happy Valve is harnessing the power of Linux and contributing to the Linux Gaming community.
I guess you could say that I’m one of those developers that sit in between both camps. As much as I would love to go Linux-only and kick Windows off my hardware, there’s still a few pieces of my workflow that still are dependent on Windows.
Until I can find the magic bullet to fix that, I’m going to literally be the “double agent”. Hah.
I will probably go back to my KVM setup when I have another GPU in action, although I’m debating if I just run another Linux-only machine in my office that sleeps when not in use.
My bedroom PC is already running Linux, and I use that for mainly YouTube and Twitch before I go to bed, or maybe the odd late-night remote admin job on my server.
Until next time, Coburn out.
I use Arch Linux btw.