Kernel-based Virtual Machine [KVM]

KVM (for Kernel-based Virtual Machine) is open source software (OSS) which provides a full virtualization solution for Linux on x86 hardware that has virtualization extensions (Intel VT or AMD-V).  It consists of a loadable kernel module, kvm.

NOTE: KVM is part of Linux. KVM was first announced in 2006 and merged into the mainline Linux kernel version a year later.

KVM is incorporated in the recent versions of most distros, check the docs of your chosen distro.


As the kernel component of KVM is included in mainline Linux, as of 2.6.20, if you are running Linux 2.6.20 or newer, you have KVM included.

As KVM is part of existing Linux code, it immediately benefits from every new Linux feature, fix, and advancement without additional engineering.

KVM lets you ‘convert’ Linux into a hypervisor.

What are the CPU technology requirements for KVM?

The KVM hypervisor requires:

  • an Intel processor with the Intel VT-x and Intel 64 virtualization extensions for x86-based systems, or
  • an AMD processor with the AMD-V and the AMD64 virtualization extensions.

What is a Hypervisor?

That means that the host computer running Linux can then run multiple, isolated virtual environments called guests or virtual machines (VMs).

Components of KVM

KVM consists of a loadable kernel module, kvm.ko, that provides the core virtualization infrastructure and a processor specific module, kvm-intel.ko or kvm-amd.ko.

KVM also requires a modified QEMU (QEMU provides an interface to KVM).

QEMU

Qemu is a machine emulator that can run operating systems and programs for one machine on a different machine. So, what actually is QEMU machine emulators and tools?

QEMU is a free and open-source emulator.

QEMU emulates the machine’s processor through dynamic binary translation,
and
provides a set of different hardware and device models for the machine.

This enables a machine to run a variety of guest operating systems.

Mostly it is not used as emulator but as a virtualizer in collaboration with KVM kernel components. In that case it utilizes the virtualization technology of the hardware to virtualize guests. This combination may change in the future as work is underway to incorporate the functionality which QEMU provides ‘upstream’.

QEMU Host and target

The host is the platform and architecture which QEMU is running on, usually an x86 machine.

The target is the architecture which is emulated by QEMU.

What CPUs can QEMU emulate?

QEMU can emulate both 32-bit and 64-bit Arm CPUs.

For example, to simulate a 64-bit Arm machine, the qemu-system-aarch64 executable is used.

Why Use KVM?

Using KVM, one can run multiple virtual machines running unmodified Linux or Windows images. Each virtual machine has private virtualized hardware: a network card, disk, graphics adapter, etc.

For further info visit linux-kvm.org

Understanding Virtual Machines (VMs)

Does a virtual machine have a kernel?

In contrast to containers, VMs run a complete operating system, including its own kernel.

Every VM is implemented as a regular Linux process, scheduled by the standard Linux scheduler, with dedicated virtual hardware such as a network card, graphics adapter, CPU(s), memory, and disks.

What types of functionality can be virtualized?

Network functions virtualization

Isolated, virtual networks can be created from 1 original network.Learn more

Server virtualization

A single server can be made to act like a couple—or hundreds.Watch the video

Operating system virtualization

1 computer can run multiple different operating systems.Learn more

Upgrading PHP on CentOS Linux

It is a simple task to upgrade (or install) PHP on Centos. You can either install or upgrade PHP with a single command, as follows: To upgrade PHP...

Linux Foundational Commands

Linux has many commands, but to start working with Linux as a user or new Admin, there are several commands which you will use very regularly. Here...