Hey, I’ve created a Windows 10 virtual machine and its performance is slow, the mouse is moving sluggishly. I created Windows 10 VM using this guide: How to run a Windows virtual machine on LXD on Linux. Are there any ways to improve Windows 10 performance?
I’m going to run stuff like Visual Studio, Unity3d on the VM. I have an NVIDIA GeForce GTX 1060 GPU on the host. I use spice display console to access the Windows VM.
You can’t, LXD only supports virtio devices.
The folks at Red Hat have been working on improving the virtio-gpu driver for Windows quite a lot lately and it should soon get to parity or surpass QXL, but that’s why the VGA performance is sub-optimal compared to running desktop Linux in those VMs.
Boot your machine with iommu=pt intel_iommu=on passed to the kernel
Confirm that the GPU you wish to pass sits in its own IOMMU group (lspci -vmm can be used for that), if it’s not, you may need to physically move your GPU to another slot (if a desktop machine) or find some firmware option to reconfigure things
Make sure that your host system isn’t using that GPU (driver shouldn’t be loaded at all)
Once that’s all correct, you can simply pass it to the VM with:
You can remove the driver or you can set your distro’s driver blacklist so it doesn’t get loaded. If you have both nvidia and intel on your system and want to passthrough the nvidia GPU, blacklisting both nvidia and nouveau should cause your nvidia GPU to not be claimed by a driver and be available for passthrough.
An additional trick to get better performance on windows 10 VM is select “Adjust for best performance” in “Performance Options” of the VM’s control panel.