Rate This Document
Findability
Accuracy
Completeness
Readability

Introduction

KVM Overview

Kernel-based Virtual Machine (KVM) is a virtualization architecture in the Linux kernel. It allows the kernel to function as a hypervisor.

KVM contains a kernel module kvm.ko for implementing kernel virtualization functions and a processor-related module, such as kvm-amd.ko. KVM does not provide processor emulation. It exposes the /dev/kvm interface, through which a host machine can create vCPUs, allocate virtual memory address space, read and write vCPU registers, and run vCPUs. With KVM, the CPU instructions of the guest OS can run directly without being translated by the Quick EMUlator (QEMU), which greatly improves the running speed.

The KVM implements CPU and memory virtualization, but it cannot provide emulation of other devices. A tool running in the user space is required. KVM developers use the mature open-source virtualization software QEMU as this tool. QEMU simulates I/O devices (such as NICs and drives). QEMU-KVM is developed based on QEMU.

In QEMU-KVM, KVM runs in the kernel space, and QEMU runs in the user space to simulate the creation and management of various virtual hardware. QEMU integrates the KVM, and invokes the /dev/kvm through the /ioctl to enable some CPU instructions to be executed by kvm.ko. KVM implements CPU and memory virtualization, and QEMU simulates I/O devices (such as drives, NICs, and video cards). In this way, KVM and QEMU together implement server virtualization.

Recommended Versions

Table 1 Recommended versions

Software

Recommended Version

QEMU (CentOS)

qemu-2.12.0 or later

libvirt (CentOS)

libvirt-4.5.0 or later

QEMU (openEuler 20.03 LTS SP1)

qemu-4.1.0 or later

libvirt (openEuler 20.03 LTS SP1)

libvirt-6.2.0 or later