High Performance VM?
When I first heard about this, I didn’t think it made much sense. When I was using virtualbox on a macbook running windows, I could see the performance degradation inside the VM in comparison to normal system use on the host machine. With GPU passthrough, I can’t really tell the difference between host and guest machine performance anymore (in most scenarios).
It took me a while to discover this and when I did, I bought a second GPU (750 Ti + 1070 setup) for my desktop and followed relevant arch wiki documentation to get this set up on my arch machine and following similar documentation for when I migrated my setup to debian. As you can see from the wiki page, it is a lengthy process but overall, it isn’t too difficult.
Requirements
Some of these aren’t absolutely required but it is good to have. The bare minimum requirements are in the prerequisites section regarding IOMMU support, GPU ROM must support UEFI, etc.
- Fast CPU and high quantity of RAM
- Two GPUs (possible without)
- Separate drive (for performance)
- Separate audio outputs
- Two Monitors (depending on use case)
- Two pairs of mice and keyboard (not really)
Running two machines at the same time especially if both are running intensive programs means you need a powerful CPU to handle this and you may want a lot of RAM to share across both systems. I would say bare minimum of 16 GB but a more realistic minimum is 32 GB. You can go the way of increasing your swap too but that isn’t great. I’ve previously tried running a heavily modded minecraft server on the host and play on the guest sharing server access to 4 friends and it wasn’t easy on my hardware despite my hardware not being so bad with 32GB RAM, 6 core 12 thread CPU, etc.
There are also setups where the host and guest share only one GPU but that has some limitations such as no display output to host while guest is running.
Virtual disk images have some performance loss but with another drive, it is easier to setup raw partitions/lvm/pass through raw disks but this harms some of the more robust snapshot and management features.
Separate audio outputs means you can hear audio from both machines at the same time.
You may want two monitors if you want to be able to see both machines at the same time for whatever reason but if you need access to both in one and only have one monitor, you may want to ssh from one machine to the other to manage both in one. I go into alternatives a little more in performance loss section below.
Two pairs of mice and keyboards aren’t strictly required which you may find surprising. There are solutions to share mouse and keyboard across both by switching between then such as when a key combination is used. If you however don’t like this, you can use two pairs and pass one pair as USB devices to the guest.
Performance Loss
There is still some performance loss in comparison to running on bare metal but it isn’t very much. It is generally the same experience but if you need that extra few percent of power, you may want to look into running the OS on your current system, running on a different PC that you have the display output go to another monitor while you do other unrelated tasks on another system or run on another machine that you stream the desktop of over your network to your normal system (latency issues).
Detection
I think the most difficult part is finding and making changes to your XML config to bypass VM detection by programs ran inside the guest. I found some methods that work okay for me but I still see some ways it can be detected. It looks easier to hide with an intel CPU but I am using an AMD CPU. I used Pafish to test and there are some other programs you can find out there.