I haven’t had much time in recent months to follow up on what’s happening in the KVM or virtualization world. That much bigger was my surprise to find that things are moving on quickly. When I started out 6 years ago to virtualise Windows and run it on Xen using VGA passthrough, I thought I would be forever marked as a geek.
Today I’m looking at dozens if not hundreds of tutorials and websites dealing with VGA passthrough, and an ever increasing number of followers. It seems to me this technology or concept is gaining momentum, at least among Linux users.
For those uninitiated in VGA passthrough, VGA passthrough allows a Virtual Machine to have direct access to the graphics hardware. In simple terms, it enables you to use Linux as your desktop of choice, and gives you access to a powerful Windows virtual machine for Windows-only games and applications. The performance difference between that Windows VM and a native Windows installation on the same hardware is negligible.
A few years ago this concept required special hardware – most CPUs and graphics cards would not support that technology. But a number of things happened over the last 5-6 years, or to be more precise, people made it happen. For one thing, Intel and AMD executives decided to have the majority of new CPUs support the features needed for VGA passthrough. Today it’s relatively easy to find a suitable and affordable CPU and motherboard.
KVM and Xen developers have pushed this technology forward, adding better support to what had been problematic hardware. UEFI support in newer graphics cards has also helped mitigate issues with VGA arbitration.
Intel went further with its Graphics Virtualization Technology: Intel’s integrated GPUs can be either dedicatedly assigned to a virtual machine (GVT-d); shared between multiple virtual machines on a time-sharing basis while using a native graphics driver (GVT-s); or shared between multiple virtual machines by using a virtual graphics driver (GVT-g). A setup guide for the latter can be found here.
A while ago Nvidia Optimus technology (found in some laptops) presented a insurmountable obstacle to VGA passthrough heaven. Not so today – see GUIDE to Optimus laptop dGPU passthrough.
Lately AMD introduced its powerful Ryzen CPU line, and as VGA passthrough aficionados reported IOMMU grouping issues, the vendor quickly responded with the AGESA 22.214.171.124 firmware update to address this and other issues. A VGA passthrough tutorial for this platform can be found at Level1techs.
One obstacle to the mainstream adoption of running Windows in a VM needs to be overcome, though: The current solution requires two dedicated GPUs, one for the Linux host, and one for Windows. For desktop users this may not be an issue at all, since one can use the IGD (Intel HD or Iris graphics) inside the CPU for the Linux host, and a dedicated graphics card for the Windows VM where performance matters. But many power users who run dedicated CPUs and GPUs as well as an even greater number of laptop users with a single integrated graphics processor do not have this choice. Unfortunately there isn’t a good solution to this. Some blame the Xorg team for not addressing this issue, but perhaps it’s not that easy.
Looking Glass allows you to display a Windows 10 VM on the Linux host display, either full screen or windowed. This requires still 2 dedicated GPUs, but makes a second screen unnecessary. Looking Glass copies the frame buffer of the Windows GPU to a shared memory location from where it is taken by the Linux host and displayed, with next to no latency. It’s still in an experimental stage. Level1techs’ Wendell is very excited about this technology, but I cannot really see the benefit. I’m doing VGA passthrough for the past 6 years using a single graphics display with two DVI inputs, switching inputs as necessary.
Intel and AMD are actively contributing to the open source community and making their virtualization technology accessible. In contrast, Nvidia disables certain features that improve VGA passthrough in its consumer-class products, forcing the user to get the expensive professional products. I’m not sure they are doing themselves a favour with it.
Soon virtualization technology on the desktop computer will come to a level where even novice users are able to install Linux and run their Windows OS in a VM. Some Linux distributions such as Arch Linux, Fedora, and Lime Technology (commercial) make it easy to set up virtualization. Others, I’m sure, will follow.