Have you ever realized that some
virtual machines are faster than others? This is generally due to how they are devised โ either through a technique called
full virtualization or
paravirtualization. If you have used a
hypervisor system such as
VMware,
VirtualBox, or
KVM, you will have come across these terms. Letโs explain them in the simplest way possible.
What Is Full Virtualization?
Think of
full virtualization as a computer, acting like it is another computer. The
virtual machine (VM) believes it is talking to real hardware, but it is in fact talking to a software layer called a
hypervisor.
The
hypervisor simulates the hardware and the guest operating system (
Windows or
Linux) is unaware this is not real hardware.
Examples:
- VMware ESXi
- Microsoft Hyper-V
- Oracle VirtualBox
Pros - You can install any operating system and it does not get converted to the hypervisor.
Cons - It is slower, as your system uses processing power to "fool" the hardware.
What Is Paravirtualization?
Paravirtualization is different. In this case, the guest
OS understands that it is in a virtual machine. Instead of lying to the operating system, it communicates directly with the
hypervisor to do tasks more efficiently.
The operating system is only slightly changed to communicate with the hypervisor using special
API calls. In this case, we can think of the OS as saying โHey, I think Iโm virtual- why donโt we make this work together?โ
Examples:
- Xen
- KVM (using special drivers)
The good: Faster and requires less resources.
The bad: The operating system must be modified to work in this way, therefore not all operating systems can work together.
Which One Should You Choose?
If you wish to run
multiple types of operating systems,
full virtualization makes sense. However, if you want as fast of an experience with the least impact on resources,
paravirtualization is the way to go.
Personally, I bundled
KVM because it gives you both -
KVM allows you to run full
virtualization, while also allowing you to use
paravirtual drivers so you can have the best of both worlds.
In Conclusion
In a nutshell, both
paravirtualization and
full virtualization essentially provide the same outcome - running multiple systems on a single machine, using a different approach.
So the next time you are provisioning a
VM you will want to ask yourself - "do I want speed? or flexibility?" Once you figure that out, your choice will be clear.