bloginfo('name');

bloginfo('description');

An Introduction to Virtualisation on Linux

Februar 5th, 2009 by Blu:RayNe

There are several kinds of virtualization techniques which provide similar features but differ in the degree of abstraction and the methods used for virtualization. Here is a little overview I copied and pasted from some websites (links at the end of the article).

Virtual machines (VMs)

Virtual machines emulate some real or fictional hardware, which in turn requires real resources from the host (the machine running the VMs). This approach, used by most system emulators, allows the emulator to run an arbitrary guest operating system without modifications because guest OS is not aware that it is not running on real hardware. The main issue with this approach is that some CPU instructions require additional privileges and may not be executed in user space thus requiring a virtual machines monitor (VMM) to analyze executed code and make it safe on-the-fly.

  • The hardware emulation approach is used by VMWare, QEMU, Virtual PC, VirtualBox and Parallels Workstation.
  • Runs a complete virtualized OS as a separate process, sometimes with a mix of virtual and real hardware.
  • Probably the slowest virtualisation technique, but due to some recent changes to CPU support for virtualisation this can be run a bit faster than it could be before.
  • Does not need root privilege to run.

Paravirtualization

This technique also requires a VMM, but most of its work is performed in the guest OS code, which in turn is modified to support this VMM and avoid unnecessary use of privileged instructions. The paravirtualization technique also enables running different OS on a single server, but requires them to be ported, i.e. they should “know“ they are running under the hypervisor.

  • Used in Xen, UML, CoLinux
  • The Kernel has to be part of the guest OS.
  • Runs as a mix of virtual and real hardware.
  • Xen is often considedered to be buggy so most users prefer therefore UML, but Xen may be faster.
  • A UML guest OS runs around 2x slower than the host OS.
  • Kernel changes are basically not necessary, but often required by the hypervisor and can lower the overhead by taking advantage of the host CPU support for virtualisation.
  • Both Xen and UML have support for Thread Local Storage (introduced by Xen)

Operating system-level virtualization

This method seperates the kernel of an operating system and therefore allows multiple isolated user-space instances, instead of just one. Such instances (often called containers, VEs, VPSs or jails) may look and feel like a real server, from the point of view of its owner. On Unix systems, this technology can be thought of as an advanced implementation of the standard chroot mechanism.

OS-level virtualization systems have been designed to provide the required isolation and security to run multiple applications or copies of the same OS (but different distributions of the OS) on the same server. In addition to isolation mechanisms, the kernel often provides resource management features to limit the impact of one container’s activities on the other containers.

  • OpenVZ, Virtuozzo, Linux-VServer, Solaris Zones and FreeBSD Jails are examples of OS-level virtualization.
  • little or no overhead due to sharing a host kernel
  • not as flexible as other virtualization approaches
  • can not host a guest operating system different from the host OS
  • host system can be detected by intruder
  • good mix between security and speed
  • OpenVZ is probably the fastest solution
  • chroot: Shares process space. File system access is restricted. Further restrictions can be imposed by the use of capabilities.
  • chroot does not virtualize system calls, access to block devices or virtual file systems (such as /proc and /sys on Linux; not provided by default!)
  • vserver: Access to process space is restricted. The use of capabilities and contexts is made simpler by vserver-utils. Needs kernel changes.
  • useful for honeypotting by simulating a real system running network services.

Short comparison

The three techniques differ in complexity of implementation, breadth of OS support, performance in comparison with standalone server, and level of access to common resources. For example, VMs have wider scope of usage, but poor performance. Para-VMs have better performance, but can support fewer OS because of need to modify the original OS.

Virtualization on the OS level provides the best performance and scalability compared to other approaches. Performance difference of such systems can be as low as 1…3%, comparing with that of a standalone server. Virtual Environments are usually also much simpler to administer as all of them can be accessed and administered from the host system. Generally, such systems are the best choice for server consolidation of same OS workloads.

Working under linux UML provides a quick and easy way for creating linux test systems.  For doing the real deal my choice would be OpenVZ, because it is not only the fastest solution but more easy to handle than chroots. If you ever need other operating systems use Zen for productive virtualisation, and the good old Virtual Machines for test systems – i recommand Sun’s VirtualBox, which probably can run a little bit instabil. Therefore use VMWare on windows!

Ah yeah… sorry, i couldn’t test the Solaris and BSD solutions, but i would be very interested in them. I guess Unix is stil a little bit ahead in enterprise features. I wonder what my Red Hat Enterprise pal would say ;)

Here are some links on tutorials, wikis and so on:

Filed under Allgemein having No Comments »

Leave a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.