Sie sind auf Seite 1von 9

Comparison between open source solutions for

paravirtualization and full virtualization: Xen and


KVM








Guillermo de la Puente Allott
gdelapue@hawk.iit.edu



1 of 8

Introduction
Virtualization has become increasingly important in the computing industry in the past couple
of decades. The purpose of virtualization is to allow multiple OSs to run in the same machine,
making use of the same hardware but, in most cases, being isolated of one another. This is a
powerful idea with many uses, such us provide an isolated secure development environment for
programmers and testers and replicate the production environment for employee training.
Virtualized OSs are also very easy to duplicate, send, remove or restore.
However, the most relevant use of virtualization is in data centers and big servers. A very
powerful machine can be split in smaller running OSs, making them available for different
purposes and even to different people. This is the use that has made virtualization so popular, as
Internet keeps growing. Probably, its growth will continue exponentially during the next ones.
Virtualization can be achieved using different techniques, each one of them with its advantages
and disadvantages. The choice of which one to use only depends on the system requirements.
For server partitioning, the most adequate are paravirtualization and full virtualization. The
difference is only in implementation details: how the virtualized OSs are managed and how do
they make use of the machine hardware resources. However, since virtualization is getting more
important every day, its useful to know them both in order to choose the most appropriate one
and know better how data centers and Internet web servers work.
There are many virtualization solutions, some of them proprietary and some others open source.
With open source projects gaining more popularity, the two most famous open source tools
nowadays are Xen and KVM. While Xen is the best example of paravirtualization solution, KVM
only offers full virtualization. The competition between these two projects has been very
interesting to follow. KVMs popularity increases despite the fact that its less mature than Xen,
which is already implemented by many Internet giants who have invested lots of resources in
this solution.




2 of 8

Paravirtualization
Characterized for improving a lot the performance compared to bare virtualization, this
technique is very old. The first commercial use of it was by IBM in 1972 with its operating
system VM.
A software layer is placed between the guest OSs and the hypervisor. Its objective is reducing the
amount of time spent executing difficult tasks. These tasks, which might require a lot of
processing time, executed in the software layer, are processed substantially faster than in the
virtual environment due to overheads and instruction translations. The mechanism followed is
that the guest OSs can communicate with the software layer, so they must be aware about being
executed in a virtual environment.
The hypervisor, which is the layer right on top of the hardware that translates the OSs calls to
the specific hardware architecture, will be simpler with this technique. These calls are often
referred as hypercalls.
The main limitation of paravirtualization is also what produces the advantage. Since the guest
OS needs to know that its in a virtual environment, the OS kernel must have this implemented.
In some cases, separate components are available to allow virtualization of an incompatible OS.

Full virtualization
When using full virtualization, the guest OSs dont know that they are being executed in a virtual
environment. They believe the entire machine is for them to use, no hardware sharing with
other running operating systems.
In contrast with paravirtualization, any OS can run in a full virtual environment. Since it doesnt
know that its communicating with a hypervisor instead of directly with the hardware, theres no
need for specific functions. The kernels dont need to be modified or components installed. The
hypervisor keeps the guest OSs isolated and balances the load among them.
A disadvantage of this technique is that every virtual machine needs to have the full instruction
set, drivers and any elements that if would require to be run on bare software, while in
paravirtualization this can be avoided by sharing the common elements between operating
systems.
3 of 8

Full virtualization would slow things down a lot unless theres specific hardware collaboration.
The components that make this possible are the Intel VT-x and AMD-V extensions, which allow
a virtual guest to access directly hardware. Thats extremely important in network
communications and hard drive accesses. Intel and AMD added this capability to their
processors in 2006. Before that, full virtualization without a software layer was not an option.

Xen
The most extended open source solution for paravirtualization is Xen. Besides any guest OSs
configured, it requires an additional virtual machine with special privileges which reduces the
load in the other ones.
Published in 2003, Xen has had time to expand and become one of the most used solutions for
server virtualization. At first, it only supported paravirtualization, but in 2005 they added
support for Intel VT Technology making full virtualization also possible. Since 2007 it used to
belong to Citrix, who continued developing Xen as a free software project but also sold
enterprise versions. On April 2013, the Xen project was acquired by the Linux Foundation as a
Collaborative Project, so it will continue growing completely open source under GPLv2
licensing.
Xens approach consists in using a virtual machine, or domain in Xens technical vocabulary,
running a Linux OS as the software layer typical from paravirtualization. This virtual machine,
called dom0, has privileged access to the hypervisor and can perform certain tasks that the other
domains cant.
The regular domains, called domU, communicate with the dom0 to access privileged tasks or
load drivers, which are stored only in dom0 with the idea of them being shared among all the
other domains. For example, the dom0 has the Network Backend Driver and the Block Backend
Driver, so when a domU needs to access the hard drive interface, it just uses the drivers installed
in the dom0.
Xen supports both paravirtualization (PV) and full virtualization (HVM), but its better known
because of its paravitualization. When using full virtualization, the domU doesnt need to
interact with the dom0, since the guest OS doesnt know about it being executed in a virtual
4 of 8

machine. Simpler solutions that only support full virtualization are available, such as KVM.
Thats why Xen might not be the best solution if only full virtualization is required.

Figure 1. Xen architecture
KVM
KVM stands for Kernel-based Virtual Machine, and its a full virtualization solution for Linux in
hardware containing virtualization extensions, VT-x for Intel or AMD-V for AMD products.
KVM is a relatively new tool, first released in 2007. Probably, it wouldnt have become as
popular if it hadnt been included in the 2.6.20 Linux kernel. At first it was a project from a
startup company, but Red Hat acquired it in 2008. It is maintained as a free open source
project, some parts licensed under LPGL v2 and others under GPL v2. Despite being very young,
its simplicity and the fact that its only focused in full virtualization have made it a very
successful project.
Its included in the Linux kernel as a module, so its very easy to start using it. The module
doesnt perform any emulation by itself, only exposes the /dev/kvm interface. This way, theres
no complex hypervisor needed because the Linux kernel acts as the hypervisor. Virtual machines
running with KVM are Linux processes. These processes execute in guest mode, a new execution
mode that KVM introduced, but generally speaking its like any other regular process in the OS.
5 of 8

KVM can work as hypervisor in machines that dont have the virtualization extensions, but that
is very inefficient. With QEMU, any architecture can be simulated. However, simulating very
different architectures than the one underneath can lead to poor performances.

Figure 2. KVM architecture

Xen and KVM comparison
There are four well known solutions in the marketplace right now: Xen, KVM, Microsoft Hyper-
V and VMware. The first two are open source and count with lots of support from the
community, and the last two are proprietary software. They have less community collaboration,
but obviously offer services that the free ones dont.
Talking only about the open source alternatives, both Xen and KVM are very similar in
performance. Only in specific environments where performance is critical, the solution chosen is
really important.
Other factors are also present such as easier deployment and management with KVM. In fact,
where Xen is running a privileged guest OS and requires the other virtual machines to
communicate with the privileged one, KVM runs in a regular Linux distribution with just a
different process for each virtual machine. If we are guided by the KISS principle, which is Keep
It Simple, Stupid!, we would go with KVM.
6 of 8

However, in a collaborative environment, the guest OSs could use the resources more efficiently.
Thats the Xen approach. The dom0 doesnt just assign resources and balances the load, it
makes the guest OSs to coordinate by themselves.
From a very wide point of view, its a matter of simplicity versus complexity. Now that both Xen
and KVM are ligated to the evolution of Linux, they will focus themselves on the things that
make them better than the other. KVM will continue the philosophy of being easy to deploy and
make efforts to improve its full virtualization, while the Xen Project will be focused in improving
paravirtualization performance with its collaborative model.
Even if KVM proves to be much better than the other, Xen wont disappear since a few big
companies have invested lots of money in it. For example, Amazon Web Services uses Xens
virtualization for its Elastic Compute Cloud. With expensive proprietary competitors, some big
companies decided to use Xen because it has been the best solution for many years, good
performance at low cost.
Amazon chose Xen not only for being cheap to deploy, but for being open source. That way, its
been able to use modified versions of Xen to meet their needs. In fact, their EC2 network has
multiple Xen modified versions coexisting. Also, in a video interview to Wener Vogels, Amazons
CTO, he said that another key factor when deciding to use Xen was its active community, which
was really helpful to solve any kind of problems related with virtualization that they came
across.
KVM would have been a good alternative, also free and open source, but it was released in 2007.
Amazon and most of the computing companies had already started using Xen by that time.
KVM is now where Xen was when these big companies started using and supporting it. Well see
where is KVM five years from now, when it has had time to mature.






7 of 8

References
Paravirtualization. Wikipedia. Retrieved on August 25, 2013 from
(http://en.wikipedia.org/wiki/Paravirtualization)
Xen. Wikipedia. Retrieved on August 25, 2013 from (http://en.wikipedia.org/wiki/Xen)
Kernel-based Virtual Machine. Wikipedia. Retrieved on August 25, 2013 from
(http://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine)
How does Xen work? Xen Project. Retrieved on August 25, 2013 from
(http://www-archive.xenproject.org/files/Marketing/HowDoesXenWork.pdf)
A Survey of Virtualization Technologies With Performance Testing. Joshua S. White, Adam W.
Pilbeam. Retrieved on August 25, 2013 from
(http://arxiv.org/ftp/arxiv/papers/1010/1010.3233.pdf)
Takemura, Chris and Crawford, Luke (2009) The book of Xen: a practical guide for the system
administrator.
Brodkin, Jon. (2013) Linux Foundation takes over Xen, enlists Amazon in war to rule the cloud.
Ars Technica, April 15. Retrieved on August 25, 2013 from
(http://arstechnica.com/information-technology/2013/04/linux-foundation-takes-over-
xen-enlists-amazon-in-war-to-rule-the-cloud/)
Zemlin, Jim. (2013) Welcome Xen as a Linux Foundation Collaborative Project. Linux
Foundation Zemlins blog, April 14. Retrieved on August 25, 2013 from
(http://www.linuxfoundation.org/news-media/blogs/browse/2013/04/welcome-xen-
linux-foundation-collaborative-project)
Colomer, Paco. (2013) Qu virtualizacin es mejor Xen o KVM? NESSYS Blog, July 8.
Retrieved on August 26, 2013 from (http://blog.nessys.es/xen-vs-kvm/)
Karafilis, Lefteris. (2010) Virtualization, Paravirtualization, whatever you say!?!? IT Bully,
October 11. Retrieved on August 26, 2013 from
(http://www.itbully.com/articles/virtualization-paravirtualization-whatever-you-say)
Habib, Irfan. (2008) Virtualization with KVM. Linux Journal, February 1. Retrieved on August
26, 2013 from (http://www.linuxjournal.com/article/9764)
8 of 8

Wolski, Rich. (2008) Interview to Eucalyptus director Rich Wolski on open source cloud
computing, Xen and Amazons EC2. Retrieved on August 28, 2013 from
(http://vimeo.com/1296719)
Ideler, Hugo. (2013). Digging into Xen at EC2. Hugo Idelers Blog, January 11. Retrieved on
August 28, 2013 from (http://hugoideler.com/2013/01/digging-into-xen-at-ec2/)
Vogels, Werner. (2008) Interview to Werner Vogels, CTO Amazon.com. Retrieved on August 28,
2013 from (http://vimeo.com/1412282)

Das könnte Ihnen auch gefallen