+4 votes
209 views
in Know how by (242k points)
reopened
KVM? Virtualization in the Linux kernel

1 Answer

+5 votes
by (1.6m points)
edited
 
Best answer

What is Linux KVM?
How Linux KVM works in detail
What components make up the Kernel-based Virtual Machine?
KVM application areas
Advantages and disadvantages of KVM
Alternatives to Linux KVM
In summary

image

KVM? Virtualization in the Linux kernel

In the business context and when using professional servers, virtualization is already essential. Thanks to this technology, several guest operating systems can be run on the same physical computer, which has many advantages, including the following:

  • Systems can be run separately based on the type of task they perform without the need for additional hardware . For example, an email server, a file server, and an application server could be running.
  • To protect against potential changes, guest systems can easily be frozen , so to speak, and then restored again .
  • The migration to new devices hardware requires little time.
  • Guest systems are scalable at all levels , allowing you to react to fluctuations in your utilization rate.
  • All guest systems have a common hardware base , thus preventing possible conflicts between drivers .

While it is rare to find Linux, the open source operating system, on desktops and home computers, in the server realm, it has long been widespread. In the same way, it has also acquired a very important role as a basis for virtualization strategies..

Index
  1. What is Linux KVM?
  2. How Linux KVM works in detail
  3. What components make up the Kernel-based Virtual Machine?
  4. KVM application areas
  5. Advantages and disadvantages of KVM
  6. Alternatives to Linux KVM
  7. In summary

What is Linux KVM?

The so-called Kernel-based Virtual Machine (KVM) was introduced by the Qumranet company in 2000 and at the beginning of 2007 it had already been included in the Linux kernel 2.6.20. The following year, RedHat, a Linux distributor, acquired Qumranet. In order to continue developing this technology, RedHat founded, together with IBM, the Open Virtualization Alliance (OVA) project, in which companies such as Suse, Intel and HP participated.

KVM is closely related to QEMU emulation software . The latter typically offers hardware virtualization features , while Linux KVM handles resource allocation to guest systems. Therefore, it is common to come across the term KVM / QEMU as well. Since KVM is an essential component of Linux , it cannot be integrated into Windows devices. However, Windows can be run through the virtualization solution, as can most Unix systems, such as Linux, Solaris, and BSD. KVM is included by default in most Linux distributions, but it must be activated first..

How Linux KVM works in detail

To understand how this virtual machine works, it is necessary to first understand virtualization. Virtualization is the execution of one or more complete operating systems (guest systems) on the same host device ( host ) . The host computer then requires additional hardware services : these can either be emulated by software , or they can be located on other physical devices and controlled by a hypervisor, that is, a management and translation layer between the real and virtual hardware. . Depending on the type of virtualization, it may be necessary to translate the requirements to the actual hardware or it may be enough to assign the necessary actions, such as a computation in the processor.

There are the following types of virtualization:

  • Full virtualization : the hardware is fully emulated by software . In this way, interaction with real hardware is not necessary , which makes it possible to do without the corresponding drivers . Compared to the rest, it is the slowest variant.
  • Paravirtualization : the guest system interacts directly with the hypervisor and requires specialized drivers for this .
  • Paravirtualization assisted by hardware : assistance with hardware is already built into the processor, thereby increasing efficiency and adaptation effort they have to make the guest systems is reduced. Modern processors from Intel (Intel-VT-x) and AMD (AMD-V) offer this feature, although it may need to be enabled in BIOS / UEFI.

In addition, there are two types of hypervisors:

  • Type 1 ( bare metal ) : the hypervisor runs directly on the hardware used, without being integrated into an operating system.
  • Type 2 ( hosted ) : The hypervisor is built into the host operating system and is activated from it.

Linux KVM belongs to the second type of monitor and uses hardware- assisted paravirtualization . What makes it special, however, is that it is built directly into the kernel ..

Note

Kernel is the English term equivalent to kernel : we are talking, therefore, of the kernel of an operating system , in which the basic functions of the system are integrated, such as, for example, access to hardware and the allocation of computing time to processors in a multitasking system . Access to the kernel is specially protected ( kernel mode ) and the requests that reach it receive privileged treatment by the processors.

Due to its direct link with the kernel, it is debated whether this system would even have the characteristics of the first type of hypervisors.

What components make up the Kernel-based Virtual Machine?

The KVM as a whole is made up of several elements:

  • Kernel extension : Contains the extension itself, kernel.ko . This is the translation layer between real and virtual hardware . In addition, it includes the kvm-amd and kvm-intel modules , adapted to the characteristics of the processors.
  • Libvirt : is the programming interface (API) to communicate with virtual machines, which can be controlled and managed through it. Libvirt also offers tools such as a command line called virsh and the Virtual Machine Manager graphical interface.
  • QEMU : it is mainly a standalone program to emulate computers and manage virtual machines. Linux KVM uses this feature to emulate hardware, thereby improving speed through paravirtualization. Many distributions include both components in the same installation package.
  • Kvmtool : An alternative to QEMU that requires fewer resources, but has not yet been able to unseat its opponent.
  • VirtIO drivers : special drivers for guest systems that adjust to the requirements of the hypervisor and make paravirtualization possible.

KVM application areas

The Kernel-based Virtual Machine is used especially frequently when operating with dedicated professional servers . In 2017, a security study conducted by the German Federal Office for Information Security (BSI) defined KVM as the most important virtualization solution in the field of open source or open source tools .

In addition, Linux KVM has additional relevance because it can be integrated as a hypervisor in the popular OpenStack cloud software service.

Advantages and disadvantages of KVM

Finally, we briefly present some advantages and disadvantages of this virtualization tool.

Advantages :

  • Mature and consolidated system
  • Already included in most Linux distributions
  • Free and open source
  • With a single real Kernel Virtual Machine, which guarantees performance and stability
  • Developed by prestigious companies
  • Libvirt makes automatic administration possible

Disadvantages :

  • Only available for Linux systems
  • Requires high-performance hardware for the host computer
  • A familiarization effort is necessary to handle it
  • The centralization of the hardware increases the risk of losses in case of failure ( single point of failure , which can however be compensated with a good backup strategy )

Alternatives to Linux KVM

In the field of the software open source and with similar functions, XEN is the most important alternative. It is a virtualization tool that is also closely related to Linux, but does not integrate into the kernel .

For its part, in the commercial market, the consolidated manufacturer VMWare offers alternatives for paravirtualization with its ESXi servers and full virtualization with its workstation . Additionally, VMWare Player is free for home users.

Virtualbox is another full virtualization alternative that can be used on all common operating systems.

Microsoft also has a paravirtualization tool for Windows: the Hyper-V system, which works in a similar way to Linux KVM. It has a dedicated Windows Hyper-V server and works seamlessly with the server operating systems. Hiper-V is also included in Windows 10 Professional and Enterprise versions.

In summary

Flexibility and scalability are two indisputable arguments in favor of virtualization. Guest operating systems can thus be maintained without consuming many resources and run for specific purposes. If, in addition, systems are backed up to other physical media on a regular basis, the risk of loss in the event of a failure practically disappears.

If you run Linux on your server, you have little reason not to consider at least KVM. Its integration into the core of the system and the prestige enjoyed by its developers are very good reasons to decide to use this tool.


...