Xen

Xen is a hypervisor virtual machine that runs multiple open-source operating systems.
Hypervisor

Xen is a virtual machine hypervisor. That is, it doesn't run on any OS, it makes an OS run on it! Xen runs at the highest priority level the x86 architecture allows (called Ring 0). It makes the OS get the second-highest priority in x86 architecture (called Ring 1).

Xen provides certain libraries to which the OS kernel has to be ported in order to work with Xen. Porting an OS to run on Xen is similar to porting the OS to a new hardware platform; however, the process is simplified because the paravirtual machine architecture is very similar to the underlying native hardware. Although the kernel has to be ported, Xen does not require any modification to user applications, which can run unaltered on a Xen system.

So far, only open-source operating systems have been ported to Xen. Unless Microsoft releases a Xen-enabled Windows version, we might not get the benefit of a completely virtualized MS Windows. So far, Linux ports are available, and FreeBSD, NetBSD and Solaris 10 ports are underway.

The developers of Xen had to overcome some major challenges to partition successfully a modern machine's resources amongst multiple guest operating systems. First, virtual machines had to be isolated from one another—that is, problems in one machine must not affect the working of other virtual machines. Second, it was necessary to support a variety of different operating systems to accommodate the heterogeneity of popular applications, such as enterprises commonly using a mix of Linux and MS Windows installations to support their working. Third, the performance overhead introduced by virtualization should be small. Xen's approach addresses each one of these challenges successfully. See “Xen and the Art of Virtualization” at www.cl.cam.ac.uk/Research/SRG/netos/papers/2003-xensosp.pdf, which discusses Xen's approach in detail.

We'll go through some salient features of Xen's approach.

As stated earlier, Xen is a hypervisor that uses paravirtualization, when an operating system is ported to Xen. Xen has access to some internal OS kernel information in order to manage the system. This porting also gives the guest OS kernel access to real as well as virtual information, which has specific advantages for time-critical tasks. Paravirtualization permits very high-performance virtualization, even on architectures like x86 that don't inherently support virtualization.

Paravirtualization enables Xen to multiplex physical resources at the granularity of an entire operating system and is able to provide performance isolation between each VM. This also allows a range of guest operating systems to coexist, without having any effect on each other. Xen's paravirtualization approach allows users to run applications in a resource-controlled fashion. Furthermore, it provides an extremely high level of flexibility, because users can create dynamically the precise execution environment their software requires. Unfortunate configuration interactions between various services and applications are avoided.

Try It Yourself

As mentioned previously, Xen is primarily developed for the x86 architecture; however, it does not support all x86-based processors—only those that are P6 or newer, including Pentium Pro to Pentium 4 and Intel Celeron and Intel Pentium Xeon processors. Apart from Intel, AMD processors from Athlon to AthlonXP and FX processors are supported, as well as the AMD Duron.

Interested readers may want to try out Xen for themselves, without installing the entire system. The Xen Project provides a live CD demonstration of Xen, which comes with both Debian and CentOS. The live CD version can be a powerful tool for demonstrating the features of Xen. It is possible to boot in to any of the provided distributions and start new instances of either distribution, as many times as the system memory allows.

It is also possible, in the live CD version, to monitor the resource usage of all virtual machines in real time and start applications in each virtual machine.

Installing Xen

For power users who want to get down to installing Xen, the following is a brief guide. Installing Xen is a three-way process. You install Xen and its user-level tools, then configure your bootloader and, finally, define the VM configuration files for each guest OS.

Installing from binary tarballs or an RPM package is the easiest way to install Xen. For binary tarballs, simply do this:


bash# tar zxvf xen-3.0-install.tgz
bash# cd xen-3.0-install
bash# sh ./install.sh

For an RPM package, do this:


bash# rpm -iv xen-3.0-i686.rpm

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Mr. Habib: You mention in

moschlegel's picture

Mr. Habib:

You mention in the article:

"VMware's approach does have one large advantage over Xen's approach. VMware is capable of virtualizing proprietary operating systems. As I discuss later in this article, you have to port an operating system's kernel to Xen for it to work with Xen. You cannot run an operating system on Xen otherwise."

I'm not sure this is exactly correct, in the case of Xen running
on a cpu with AMD-v or Intel VT hardware extentions, you can
run proprietary OS's raw with no porting of the guest OS to xen.
In the case of AMD, you'd have to use a AM2 or later chip or
with Intel any of the recent Core 2, Xeon or other chips with
Vanderpool support.
Mark Schlegel

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix