Mechakhan Logo

Mechakhan's Domain

Windows 10 Virtual Machine with CPU and GPU Passthrough

Posted Mon, 15 May 2023 20:59:48 +0200 | |

I used this great guide for setting up a Windows 10 VM with GPU passthrough using Virt Manager. I encountered some issues though that weren’t brought up in the guide, and also found some additional optimizations to the process. Since it might help others I thought I would document them here.

Now, because the process of GPU passthrough is not entirely trivial, you might want to consider running your application using wine, or if it’s a Steam game, proton. Personally, I haven’t had much problems with running obscure applications like proprietary build SDKs or old visual novels using wine. I have also been able to run some uncooperative Steam games in proton by changing the proton version in Steam to experimental, or fix issues like crackling audio by going into the launch options for the game and setting PULSE_LATENCY_MSEC to some appropriate value. Check https://www.protondb.com for your game to see feedback about how well it runs, there are usually good tips for which proton version to use, or which launch options to tinker with.

Nevertheless, if you have problems using wine or proton, or if you would prefer not to use them, then here are my notes.

After this everything worked smoothly. Note that once you start the VM in Virt Manager your host environment’s access to the GPU is removed and all your open applications are killed. Don’t worry, when you power off the VM you will be returned to the lock screen of your host environment, but of course if you had any unsaved work that work is now lost.

If you need to troubleshoot your VM and have a spare computer lying around, it is useful to start an SSH server on your VM host and manage Virt Manager remotely through your spare computer. Because your VM host loses access to the GPU, if the VM hangs the VM host is essentially stuck in a black screen of death. By remotely shutting down the VM, you can recover from this without having to do a hard reset of your VM host by holding down its power button.

I still haven’t tried passing through sound to the VM, if I get around to it and have something useful to report I’ll post an update.