Kernel-based Virtual Machine

Last updated
KVM
Original author(s) Qumranet
Developer(s) The Linux Kernel community
Repository
Written in C
Operating system Unix-like
Platform ARM, PowerPC, ESA/390, IA-32, x86-64
Type Hypervisor
License GNU GPL or LGPL
Website www.linux-kvm.org

Kernel-based Virtual Machine (KVM) is a free and open-source virtualization module in the Linux kernel that allows the kernel to function as a hypervisor. It was merged into the mainline Linux kernel in version 2.6.20, which was released on February 5, 2007. [1] KVM requires a processor with hardware virtualization extensions, such as Intel VT or AMD-V. [2] KVM has also been ported to other operating systems such as FreeBSD [3] and illumos [4] in the form of loadable kernel modules.

Contents

KVM was originally designed for x86 processors but has since been ported to ESA/390, [5] PowerPC, [6] IA-64, and ARM. [7] [8] The IA-64 port was removed in 2014. [9]

KVM supports hardware-assisted virtualization for a wide variety of guest operating systems including BSD, Solaris, Windows, Haiku, ReactOS, Plan 9, AROS, macOS, and even other Linux systems. [10] [11] In addition, Android 2.2, GNU/Hurd [12] (Debian K16), Minix 3.1.2a, Solaris 10 U3 and Darwin 8.0.1, together with other operating systems and some newer versions of these listed, are known to work with certain limitations. [13]

Additionally, KVM provides paravirtualization support for Linux, OpenBSD, [14] FreeBSD, [15] NetBSD, [16] Plan 9 [17] and Windows guests using the VirtIO API. [18] This includes a paravirtual Ethernet card, disk I/O controller, [19] balloon driver, and a VGA graphics interface using SPICE or VMware drivers.

History

Avi Kivity began the development of KVM in mid-2006 at Qumranet, a technology startup company [20] that was acquired by Red Hat in 2008. [21]

KVM surfaced in October 2006 [22] and was merged into the Linux kernel mainline in kernel version 2.6.20, which was released on 5 February 2007. [1]

KVM is maintained by Paolo Bonzini. [23]

Internals

A high-level overview of the KVM/QEMU virtualization environment Kernel-based Virtual Machine.svg
A high-level overview of the KVM/QEMU virtualization environment

KVM provides device abstraction but no processor emulation. It exposes the /dev/kvm interface, which a user mode host can then use to:

Originally, a forked version of QEMU was provided to launch guests and deal with hardware emulation that is not handled by the kernel. That support was eventually merged into the upstream project. There are now numerous Virtual Machine Monitors (VMMs) which can utilise the KVM interface including kvmtool, crosvm and Firecracker and numerous specialised VMMs build with frameworks such as rust-vmm.

Internally, KVM uses SeaBIOS as an open source implementation of a 16-bit x86 BIOS. [25]

Features

KVM has had support for hot swappable vCPUs, [26] dynamic memory management, [27] and Live Migration since February 2007. [28] [29] It also reduces the impact that memory write-intensive workloads have on the migration process. [30]

Emulated hardware

KVM itself emulates very little hardware, instead deferring to a higher level client application such as QEMU, crosvm, or Firecracker for device emulation.

KVM provides the following emulated devices:

Graphical management tools

libvirt supports KVM Libvirt support.svg
libvirt supports KVM

Licensing

The kernel-mode component of KVM is a part of Linux kernel, itself licensed under GNU General Public License, version 2. [32]

See also

Related Research Articles

<span class="mw-page-title-main">Virtual machine</span> Software that emulates an entire computer

In computing, a virtual machine (VM) is the virtualization or emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. Their implementations may involve specialized hardware, software, or a combination of the two. Virtual machines differ and are organized by their function, shown here:

<span class="mw-page-title-main">Xen</span> Type-1 hypervisor

Xen is a free and open-source type-1 hypervisor, providing services that allow multiple computer operating systems to execute on the same computer hardware concurrently. It was originally developed by the University of Cambridge Computer Laboratory and is now being developed by the Linux Foundation with support from Intel, Citrix, Arm Ltd, Huawei, AWS, Alibaba Cloud, AMD, Bitdefender and epam.

A hypervisor, also known as a virtual machine monitor (VMM) or virtualizer, is a type of computer software, firmware or hardware that creates and runs virtual machines. A computer on which a hypervisor runs one or more virtual machines is called a host machine, and each virtual machine is called a guest machine. The hypervisor presents the guest operating systems with a virtual operating platform and manages the execution of the guest operating systems. Unlike an emulator, the guest executes most instructions on the native hardware. Multiple instances of a variety of operating systems may share the virtualized hardware resources: for example, Linux, Windows, and macOS instances can all run on a single physical x86 machine. This contrasts with operating-system–level virtualization, where all instances must share a single kernel, though the guest operating systems can differ in user space, such as different Linux distributions with the same kernel.

<span class="mw-page-title-main">QEMU</span> Free virtualization and emulation software

QEMU is a free and open-source emulator. It emulates a computer's processor through dynamic binary translation and provides a set of different hardware and device models for the machine, enabling it to run a variety of guest operating systems. It can interoperate with Kernel-based Virtual Machine (KVM) to run virtual machines at near-native speed. QEMU can also do emulation for user-level processes, allowing applications compiled for one processor architecture to run on another.

Platform virtualization software, specifically emulators and hypervisors, are software packages that emulate the whole physical computer machine, often providing multiple virtual machines on one physical platform. The table below compares basic information about platform virtualization hypervisors.

OS-level virtualization is an operating system (OS) virtualization paradigm in which the kernel allows the existence of multiple isolated user space instances, called containers, zones, virtual private servers (OpenVZ), partitions, virtual environments (VEs), virtual kernels, or jails. Such instances may look like real computers from the point of view of programs running in them. A computer program running on an ordinary operating system can see all resources of that computer. However, programs running inside of a container can only see the container's contents and devices assigned to the container.

virt-manager Virtualisation software

virt-manager is a desktop virtual machine monitor primarily developed by Red Hat.

These tables compare free software / open-source operating systems. Where not all of the versions support a feature, the first version which supports it is listed.

The following is about virtualization development. In computing, virtualization is the use of a computer to simulate another computer. Through virtualization, a host simulates a guest by exposing virtual hardware devices, which may be done through software or by allowing access to a physical device connected to the machine.

<span class="mw-page-title-main">Fiwix</span> Operating system

Fiwix is an operating system kernel based on the UNIX architecture and fully focused on being POSIX compatible. It is designed and developed mainly as a hobbyist operating system, but it also serves for educational purposes. It runs on the i386 hardware platform and is compatible with a good base of existing GNU applications. It follows the UNIX System V application binary interface and is also mostly Linux 2.0 system call ABI compatible.

oVirt Free, open-source virtualization management platform

oVirt is a free, open-source virtualization management platform. It was founded by Red Hat as a community project on which Red Hat Virtualization is based. It allows centralized management of virtual machines, compute, storage and networking resources, from an easy-to-use web-based front-end with platform independent access. KVM on x86-64, PowerPC64 and s390x architecture are the only hypervisors supported, but there is an ongoing effort to support ARM architecture in a future releases.

libvirt Management tool

libvirt is an open-source API, daemon and management tool for managing platform virtualization. It can be used to manage KVM, Xen, VMware ESXi, QEMU and other virtualization technologies. These APIs are widely used in the orchestration layer of hypervisors in the development of a cloud-based solution.

libguestfs is a C library and a set of tools for accessing and modifying virtual disk images used in platform virtualization. The tools can be used for viewing and editing virtual machines (VMs) managed by libvirt and files inside VMs, scripting changes to VMs, creating VMs, and much else besides. It was created because of security issues, when virtual disk images are mounted directly on the host system.

In computing, SPICE is a remote-display system built for virtual environments which allows users to view a computing "desktop" environment – not only on its computer-server machine, but also from anywhere on the Internet – using a wide variety of machine architectures.

<span class="mw-page-title-main">SeaBIOS</span> Open-source implementation of x86 BIOS

SeaBIOS is an open-source implementation of an x86 BIOS, serving as a freely available firmware for x86 systems. Aiming for compatibility, it supports standard BIOS features and calling interfaces that are implemented by a typical proprietary x86 BIOS. SeaBIOS can either run on bare hardware as a coreboot payload, or can be used directly in emulators such as QEMU and Bochs.

<span class="mw-page-title-main">NetBSD</span> Free and open-source Unix-like operating system

NetBSD is a free and open-source Unix-like operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was forked. It continues to be actively developed and is available for many platforms, including servers, desktops, handheld devices, and embedded systems.

Second Level Address Translation (SLAT), also known as nested paging, is a hardware-assisted virtualization technology which makes it possible to avoid the overhead associated with software-managed shadow page tables.

<span class="mw-page-title-main">Open Virtualization Alliance</span> Organization

The Open Virtualization Alliance (OVA) was a Linux Foundation Collaborative Project committed to foster the adoption of free and open-source software virtualization solutions including KVM, but also software to manage such, e.g. oVirt. The consortium promoted examples of customer successes, encouraged interoperability and accelerated the expansion of the ecosystem of third party solutions around KVM.

<span class="mw-page-title-main">SmartOS</span> Operating system

SmartOS is a free and open-source SVR4 hypervisor based on the UNIX operating system that combines OpenSolaris technology with bhyve and KVM virtualization. Its core kernel contributes to the illumos project. It features several technologies: Crossbow, DTrace, bhyve, KVM, ZFS, and Zones. Unlike other illumos distributions, SmartOS employs NetBSD pkgsrc package management. SmartOS is designed to be particularly suitable for building clouds and generating appliances. It was originally developed for and by Joyent, who announced in April 2022 that they had sold their business supporting and developing of Triton Datacenter and SmartOS to MNX Solutions. It is open-source and free for anyone to use.

<span class="mw-page-title-main">Open vSwitch</span> Virtual network switch

Open vSwitch (OVS) is an open-source implementation of a distributed virtual multilayer switch. The main purpose of Open vSwitch is to provide a switching stack for hardware virtualization environments, while supporting multiple protocols and standards used in computer networks.

References

  1. 1 2 "Linux kernel 2.6.20, Section 2.2. Virtualization support through KVM". kernelnewbies.org. 2007-02-05. Retrieved 2014-06-16.
  2. KVM FAQ: What do I need to use KVM?
  3. "FreeBSD Quarterly Status Report: Porting Linux KVM to FreeBSD".
  4. "KVM on illumos".
  5. "Gmane - Mail To News And Back Again". Archived from the original on 2007-09-29. Retrieved 2007-05-07.
  6. Gmane Loom Archived 2007-09-29 at the Wayback Machine
  7. "KVM/ARM Open Source Project". Archived from the original on 2013-03-10. Retrieved 2017-11-01.
  8. Christoffer Dall; Jason Nieh (2014). "KVM/ARM: The Design and Implementation of the Linux ARM Hypervisor". ACM International Conference on Architectural Support for Programming Languages and Operating Systems.
  9. "kernel/git/torvalds/linux.git: KVM: ia64: remove".
  10. "KVM wiki: Guest support status" . Retrieved 2007-05-27.
  11. "Running Mac OS X as a QEMU/KVM Guest" . Retrieved 2014-08-20.
  12. "status". Gnu.org. Retrieved 2014-02-12.
  13. "Guest Support Status - KVM". Linux-kvm.org. Retrieved 2014-02-12.
  14. "OpenBSD man page virtio(4)" . Retrieved 2018-02-04.
  15. "virtio binary packages for FreeBSD" . Retrieved 2012-10-29.
  16. "NetBSD man page virtio(4)". Archived from the original on 2019-11-13. Retrieved 2013-07-15.
  17. "plan9front" . Retrieved 2013-02-11.
  18. "An API for virtual I/O: virtio". LWN.net. 2007-07-11. Retrieved 2014-04-16.
  19. "SCSI target for KVM wiki". linux-iscsi.org. 2012-08-07. Archived from the original on 2020-06-05. Retrieved 2012-08-12.
  20. Interview: Avi Kivity Archived 2007-04-26 at the Wayback Machine on KernelTrap
  21. "Red Hat Advances Virtualization Leadership with Qumranet, Inc. Acquisition". Red Hat. 4 September 2008. Retrieved 16 June 2015.
  22. "KVM 15 equipped with live migration | IT World Canada News". 7 March 2007.
  23. Libby Clark (7 April 2015). "Git Success Stories and Tips from KVM Maintainer Paolo Bonzini". Linux.com. Archived from the original on 15 March 2016. Retrieved 17 June 2015.
  24. Khoa Huynh; Stefan Hajnoczi (2010). "KVM/QEMU Storage Stack Performance Discussion" (PDF). IBM. Linux Plumbers Conference. Retrieved January 3, 2015.[ permanent dead link ]
  25. "SeaBIOS". seabios.org. 2013-12-21. Retrieved 2014-06-16.
  26. "Hot Plugging Virtual CPUs with Red Hat Enterprise Virtualization Manager".
  27. "Faq - KVM".
  28. "KVM-15 release [LWN.net]".
  29. "Migration - KVM".
  30. "Daniel P. Berrangé » Blog Archive » Analysis of techniques for ensuring migration completion with KVM".
  31. "The Definitive KVM (Kernel-based Virtual Machine) API Documentation — the Linux Kernel documentation".
  32. "Linux kernel licensing rules — The Linux Kernel documentation". www.kernel.org. Archived from the original on 7 March 2020. Retrieved 2020-01-06.

Bibliography