KVM – virtualization in the Linux kernel

Virtualization has been an integral part of the corporate world and professional server operations for a long time. Multiple virtual guest systems can be operated on a single physical computer. This has some important advantages:

  • Systems can be neatly separated by task without requiring additional hardware (e.g. mail servers, file servers, and application servers).
  • A guest system can be backed up (also referred to as “frozen”) and recovered at the push of a button.
  • It is possible to migrate to new hardware very quickly.
  • The guest systems can be scaled as needed which allows for flexible reactions to peak loads.
  • A single hardware platform is provided for all guest systems. Driver conflicts are eliminated at the outset.

While the open-source operating system Linux can seem rather exotic for desktop computers and private users, it has long been considered mainstream for servers. It, therefore, plays an important role as a platform for virtualization.

What is KVM?

The Kernel-based Virtual Machine (KVM) launched by the company Qumranet in 2006 was officially adopted in the Linux kernel 2.6.20 in early 2007. In the following year, Qumranet was bought by the Linux distributor RedHat. To further develop the technology, RedHat founded the Open Virtualization Alliance (OVA) with IBM. This alliance included companies such as SUSE, Intel, and HP.

KVM is closely linked with the emulation software QEMU. QEMU mostly provides functions for virtualizing the hardware, while Linux KVM manages the allocation of resources from the host system. This is why the term KVM/QEMU is often used. Since KVM is integral to Linux, this virtualization solution cannot be used on Windows computers. However, Windows is supported as a guest system along with most Unix-like operating systems, such as Linux, Solaris, and BSD. While KVM is standard in most Linux distributions, it still needs to be enabled.

KVM Linux functions in detail

To understand the Kernel-based Virtual Machine’s functions, you must first understand the basics of virtualization. Virtualization means that one or more full operating systems (guest systems) can be run on a single host computer. The hardware provided for the guest systems is either emulated by software or controlled by a hypervisor and allocated to real hardware resources. The hypervisor is a management or translation layer between the real and virtual hardware. Depending on the type of virtualization, it may be necessary to translate all the requirements of the real hardware or just the allocation of the required actions (e.g. a calculation in the processor).

Here are the different types of virtualization:

  • Full virtualization: The hardware is completely emulated on the software side. Therefore, no interaction with the real hardware is necessary, which also makes corresponding drivers unnecessary. This type is comparatively slow.
  • Para-virtualization: The guest system interacts directly with the hypervisor and requires specially designed drivers.
  • Hardware-assisted para-virtualization: The hardware support is already integrated in the processor. This increases efficiency and reduces the amount of customization required for guest systems. Modern processors made by Intel (Intel-VT-x) and AMD (AMD-V) have this functionality. Under certain circumstances, this may need to be activated in the BIOS/UEFI.

In addition, there are two different types of hypervisors:

  • Type 1 (bare metal): This hypervisor runs directly on the hardware being used without being embedded in an operating system.
  • Type 2 (hosted): This hypervisor is embedded in the host operating system and is enabled from there.

Linux KVM is a type 2 hypervisor and uses hardware-assisted para-virtualization. However, it is unique in that it is directly integrated into the kernel.

Note

The “kernel” is the core of the operating system. The operating system’s basic functions are integrated into it, such as accessing the hardware and allocating computing time to processors in a multi-tasking system. Access to the kernel is highly secured, and the requirements placed on it are handled by processors with maximum privileges.

Due to its integration in the kernel, it has been debated whether the system might have elements of a type 1 hypervisor.

What are the components of the Kernel-based Virtual Machine?

The complete KVM package consists of multiple components:

  • Kernel extension: Contains the actual kernel.ko extension. This is the translation layer between the real and virtual hardware. It also includes the modules kvm-amd and kvm-intel which are adapted to the processors.
  • Libvirt: The application programming interface (API) for interfacing with the virtual machines. It is used to control and manage them. Libvirt also includes tools such as the command “virsh” and the Virtual Machine Manager graphical interface.
  • QEMU: This is basically an independent program for emulating computers and managing virtual machines. Linux KVM uses this functionality to emulate hardware and improves its speed through para-virtualization. In many distributions, both components are offered in a single installation package.
  • KVMTool: A leaner alternative to QEMU which QEMU has not yet been able to replace.
  • VirtIO drivers: Special drivers for guest systems that are designed for the hypervisor and enable para-virtualization.

Applications of KVM

The Kernel-based Virtual Machine is frequently used for running professional server systems in particular. The Linux KVM is accorded even more importance due to its integration as a hypervisor in the popular cloud software solution OpenStack.

Advantages and disadvantages of KVM

As we wrap this up, let us take a look at some of the advantages and disadvantages of this virtualization solution:

Advantages:

  • Mature established system
  • Already included in most Linux distributions
  • Free of charge and open source
  • The only genuine Kernel-based Virtual Machine which ensures performance and stability
  • Developed by reputable companies
  • Automated administration possible through libvirt

Disadvantages:

  • Only available for Linux systems
  • Powerful hardware required for the host computer
  • Requires a learning period to be able to use it
  • Centralization of the hardware increases the risk in the event of a system failure (i.e. a single point of failure, but this risk can be reduced with a smart backup strategy)

Alternatives to Linux KVM

When it comes to freely available software with similar functionality, one alternative is XEN – a virtualization solution closely linked to Linux but not integrated in the kernel.

The established commercial provider VMware offers alternatives to para-virtualization with its ESXi servers and full virtualization with its workstation. The VMware player is available for private use free of charge.

VirtualBox is another free alternative to full virtualization which is available as the basis for all common operating systems.

Hyper-Vis the Microsoft Windows virtualization solution for para-virtualization, which has similar functionality to Linux KVM. It has a dedicated Windows Hyper-V server and embedded functionality in server operating systems. Hyper-V is included in both Windows 10 Professional and Enterprise.

Conclusion

Flexibility and scalability are two almost unbeatable arguments for the use of virtualization. Guest operating systems can be kept lean and used for specific application purposes. If the systems are regularly backed up to storage media in separate locations, the risk associated with system failure is negligible.

If you use Linux for your server, you should at least consider using KVM. The fact that it is integrated in the kernel and was developed by reputable publishers are good arguments in favor of it.


Wait! We’ve got something for you!
Have a look at our great prices for different domain extensions.


Enter the web address of your choice in the search bar to check its availability.
.org
$1/1st year
then $20/year
.com
$1/1st year
then $15/year
.info
$1/1st year
then $20/year
.me
$1/1st year
then $20/year