Hypervisor vs. Container
Since virtualization is becoming increasingly prevalent in the home users, an auspicious introductory article to this domain becomes more necessary than ever.
What is virtualization exactly? In simple terms, virtualization is a method that allows the running of one or more “computers” on a single hardware platform, or even easier, two different operating systems on a single PC. For example, a PC can run both a Windows and a Linux OS, or a Windows 98 installation as well as an XP one.
A more complex explanation would be the following: virtualization frees users and applications from the specific hardware features of the operating systems.
There are three types of virtualization:
- Virtualization of Operating Systems
- Hardware Emulation
OS virtualization involves running over a host OS of containers in running other operating systems, with the latter (i.e. container) running applications. What must be understood is that these applications interact only with the OS container and consider it a living on that instance.
Therefore, it is the only one controlling system resources, since the applications installed on it cannot “see” the applications or resources from another container.
The advantage of this type of virtualization is that it shows the ease with which you can install and use the necessary software. Also, resource consumption of the servers is reduced which means that they are available almost exclusively guest operating systems (containers).
The disadvantage (of containers) is that they limit the types of operating systems installed. The containers involved as guest systems need to be identical with the host, sometimes even up to a patch level which can cause problems when trying to use programs that have strict OS requirements. However, for homogeneous systems this is the best solution.
In hardware emulation, software virtualization (usually called hypervisor) presents an emulated hardware that guests the operating systems’ work. In this regard, the emulated hardware is usually called virtual machine monitor (VMM).
VMM provides the standard hardware that interacts with the guest OS. Since the OS and the VMM form a unit, they can be moved from one system to another even if their actual hardware configurations are different (one of the major advantages of hypervisor). This unit, which lies between the physical hardware and VMM, translates the instructions from the specific resources of the physical machine in order for the server to use them effectively.
This method enables applications to run in a really isolated OS. The VMM allows the use of different guest OS’s, both at low (patch level) and high level (can run completely different OS’s like Windows and Linux simultaneously).
The downside is the fact that applications run slowly on a virtual system compared to a normal one. Also, another disadvantage is linked to the precisely standardized hardware interface (the VMM), which the hypervisor software provides a direct interface to. This translates to a higher usage of system resources. In other words, the hypervisor must include interfaces to the machine on which the executable resources are (these interfaces are called drivers).
If you have ever installed an operating system or a new component on a PC than you know that most often you need to install a driver for the new hardware and the OS to communicate. The problem occurs when the hypervisor does not contain drivers for devices in the system, because you cannot install a hypervisor without the operating system to “see” it.
Thus, if your computer has hardware parts for which the hypervisor does not have drivers for, than the virtualization software will not run on that machine. The problem is even more acute when trying to upgrade to a new device and component for which you have no hypervisor drivers.
The most popular virtualization software of this type is VMware, but offer Microsoft offers an alternative in the form of MS Virtual Server.
In paravirtualization, virtualization software acts as a layer to multiply operating systems access to the machine’s physical resources (e.g. send multiple messages simultaneously through a single communication channel, instead of fully emulating the hardware).
This approach has two major advantages:
First, it consumes fewer resources due to the reduced amount of code. If you remember, hardware emulation inserts a full emulation layer between the guest operating system (container) and the physical hardware.
By comparison, the software layer used by paravirtualization acts more like a traffic cop, leaving a guest OS to access natural resources and stopping all other OS’s from accessing the same resources at the same time.
The second advantage of paravirtualization is that it does not limit you to the drivers contained in virtualization software, in fact, paravirtualization contains no driver but uses drivers from one of the guest operating systems, called privileged guests. This helps to upgrade the physical hardware of the virtualized systems after installation even if you have no special drivers (for hardware emulation that was impossible).
Although it seems that paravirtualization is the primary way to address existing impediments, because it is a small code which acts as hardware multiplier, guest operating systems need to be modified in order to interact with its interfaces. Or, this can be achieved only if we have access to the source code of the guest system.
This access is possible through Open Source OS’s like Linux or Solaris OS and is only possible for sites that support the Microsoft Source Code Access.
Therefore, the main battle remains between the hardware emulation technologies, namely hypervisor and container. Each has its own advantages and disadvantages, as described above, and each one will serve best depending on the case when it is used.
For instance, if you want to run multiple operating systems on a machine and care less about the resource usage, than hypervisor based virtualization is the technology which will suit your needs. On the other hand, if you want a more limited selection of OS’s but better resource usage and a higher consolidation ratio, than you should have your eyes set on the container technology.
Hypervisor virtualization technologies: KVM, VMware Workstation, Xen and Hyper-V
Container virtualization technologies: Virtuozzo, OpenVZ
Photo Credit: Flickr/IvanWalsh.com