Emulation, paravirtualization, and pass-through: what you need to know for client hypervisors
Since desktop virtualization is fairly new, no one's really started out their careers from scratch focusing on this space. Instead, people start in another area of IT and kind of "fall into" (or are forced into) desktop virtualization after they've been working awhile.
Since desktop virtualization is fairly new, no one's really started out their careers from scratch focusing on this space. Instead, people start in another area of IT and kind of "fall into" (or are forced into) desktop virtualization after they've been working awhile. And those people typically come into desktop virtualization from one of two areas: either they're historic "desktop people" (who probably have a history with Citrix or SMS), or they're "server virtualization" people with a history with VMware in the datacenter. Each path to desktop virtualization has its advantages and disadvantages. Legacy desktop people know more about all the little things that make managing desktops hard, like user profiles and application conflicts. Legacy server virtualization people are better equipped to scale and run server-class hardware, and they understand more about the nuances of hypervisors and hardware virtualization in general.
Even though the two groups are coming at desktop virtualization from two different perspectives, the "client hypervisor" is probably the perfect place for them to meet. I've written quite a bit about client hypervisors over the past few years. Most people reading this are probably familiar with startup companies Neocleus and Virtual Computer who are both shipping Xen-based client hypervisor-based desktop management products today. And most of you probably also know that both VMware and Citrix are working on client hypervisor implementations of their own, and that they both have eluded to releasing products before the end of the year.
My point is that even if you don't know too much about client hypervisors today, you're going to hear a lot more about them in the coming months. So I thought it'd be important to take a look at some of the various virtualization techniques a hypervisor can leverage. These can most easily be broken down into three groups:
- Emulation
- Paravirtualization
- Hardware pass-through
Legacy desktop people have probably heard of one (or more) of these virtualization techniques, but it's easy to not really pay attention since virtualization has typically been a "server thing" that hasn't affected us desktop people too much. But now that client hypervisors are immanent, we desktop people actually have to pay attention to the differences between emulation, paravirtualization, and hardware pass-through virtualization techniques.
Emulation
Emulation is probably the virtualization technique that most of us think about when we think about hardware virtualization. As its name implies, emulation is where the hypervisor emulates a certain piece of hardware that it presents to the guest VM, regardless of what the actual physical hardware is. When emulation is used, you get the classic benefit of "VM portability," meaning that any VM can run on any hardware. (And this makes sense, since the guest VM only sees the emulated hardware, not the actual physical hypervisor.
So emulation has great and broad portability, but at the expense of performance. The problem is that the hypervisor has to pick the "lowest common denominator" when deciding how to deal with a broad variety of physical hardware. So this is where you get that generic VGA graphics card inside your VM even if you have a physical badass GPU. And if the guest VM only sees a generic VGA card, then that's all it can use. You won't be able to run cool graphics or Aero or anything if your hypervisor is only emulating something generic.
Emulation is also responsible for the biggest "performance penalty" when virtualizing. This makes sense if you think about it, because the hypervisor needs to receive the instructions for the fake hardware it's emulating and then translate those to whatever the real hardware needs.
Advantages of Emulation
- Widest hardware compatibility
- More portable images
Disadvantages of Emulation
- Worst user experience
- Worst performance
Paravirtualization
Paravirtualization is a technique where the hypervisor exposes a modified version of the physical hardware interface to the guest VM. The idea is that since emulation "wastes" a lot of computational time doing those translations, a paravirtualization setup will let the guest VM have special access to certain aspects of the physical hardware.
In theory, paravirtualization is really great. You get good performance and some portability. The downside is that it's a new way for the guest to access the physical hardware through the hypervisor, so you need hardware, a hypervisor, and a guest OS that are all in agreement on what can be paravirtualized. In the real world this means that your paravirtualization hypervisor will only support certain hardware in certain configurations. You also need to have a guest OS that's been "enlightened" to understand that it should use the paravirtualized hooks into the hardware instead of the "real" hardware. So that requires cooperation between your OS vendor, your hypervisor vendor, and probably your hardware vendor.
Advantages of Paravirtualization
- Good image portability
- Direct hardware access is possible
Disadvantages of Paravirtualization
- Complex driver architecture
- Compatibility is limited by the vendors
Hardware pass-through
As the name implies, hardware pass-through means that the guest VM has direct access to the physical hardware. The hypervisor literally lets it "pass through" to the hardware. Hardware pass-through is the best possible performance for the guest VM since it's essentially the same speed as if their was no hypervisor at all.
Sounds great, eh? Not so fast… Of course there are downsides with hardware pass-through too, namely, that you need to have the proper drivers for the real physical hardware that's being passed through to your VM. This means that you lose VM portability across hardware of different types.
Hardware pass-through also gets complicated with certain versions of the CPU and chipsets. As you can probably imagine, Intel and AMD are constantly looking for reasons for people to buy new processors. (This is where you get all that V-Pro and VT-x and stuff.) So one of the features of VT-x is that it can allow multiple VMs to access the same hardware via pass-through at the same time. (So your hypervisor could pass through the physical GPU, and you could have two VMs running Aero glass at the same time.)
The other cool thing about hardware pass-through is that you can continue to use all of the little apps that ship with your laptop... I'm talking about the Dell-branded network utility and battery meter and thumbprint reader. Since you're using native drivers with a pass-through hypervisor, all this stuff appears to the guest exactly as it would as physical hardware.
Advantages of hardware pass-through
- Best user experience
- Native performance
Disadvantages of hardware pass-through
- Hardware-specific images
Putting it all together
Now that we've looked at the three flavors of virtualization available to the client hypervisor vendors, let's try to put it all together.
First of all, it's important to point out that a single client hypervisor product can leverage more than one kind of virtualization. Maybe a product will provide pass-through GPU access with paravirtualized network and an emulated disk drive?
Second, there's no reason the client hypervisor can't support more than one type of virtualization for the same part of a computer? Maybe they include the most common drivers for ATI, NVIDIA, and Intel GPUs, so if the VM finds one of those, you get good graphics via pass-through, and if the GPU is not recognized then you just get a generic emulated VGA adapter? You could take that a step further by tossing the CPU and chipset into the mix. Assuming the GPU is recognized, maybe you get pass-through in all VMs if you have Intel VT-x, but if not then you just get GPU pass-through for one VM while the others use emulated generic VGA adapters?
Next steps
The client hypervisor space is so immature it's *almost* not worth thinking about yet. The two products on the market today seem to be updated every few weeks, and the big players don't even have betas out. (And the elephant in the room, Microsoft, hasn't even announced what they'll do in this space?) So most people are sort of holding off another year or so to see how everything shakes out.
That said, client hypervisors are going to be huge, and it's vital that we as desktop nerds understand them.