Content deleted Content added
No edit summary Tags: references removed Visual edit Mobile edit Mobile web edit |
Guy Harris (talk | contribs) Better reference for z/Architecture and PPC, and also a reference for IA-64. Add another reference for "s390" really meaning "s390x", i.e. z/Architecture. |
||
(85 intermediate revisions by 48 users not shown) | |||
Line 1:
{{short description|Virtualization module in the Linux kernel}}
{{Distinguish|KVM switch}}
{{Infobox software
| name = KVM
| logo = Kvmbanner-logo2 1.png
| logo size = 160px
| screenshot = QEMU 6.2 running NetBSD and OpenIndiana screenshot.png
| screenshot size = 300px
| caption = Screenshot of QEMU/KVM running [[NetBSD]] and [[OpenIndiana]] guests on an [[Arch Linux]] host.
| author = [[Qumranet]]
| developer = The [[Linux Kernel]] community
| operating_system = [[Unix-like]]
| programming_language = [[C (programming language)|C]]
| platform = [[ARM architecture|ARM]], [[PowerPC]], [[z/Architecture]], [[IA-32]], [[x86-64]], [[RISC-V]]
| genre = [[Hypervisor]]
| license = [[GNU General Public License|GNU GPL]] or [[GNU Lesser General Public License|LGPL]]
| website = {{URL|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 (operating system)|kernel]] to function as a [[hypervisor]]. It was merged into the [[Mainline Linux|mainline Linux kernel]] in version 2.6.20, which was released on February 5, 2007.<ref name="2620notes">{{cite web
| url = http://kernelnewbies.org/Linux_2_6_20#head-bca4fe7ffe454321118a470387c2be543ee51754
| title = Linux kernel 2.6.20, Section 2.2. Virtualization support through KVM
| date = 2007-02-05
| access-date = 2014-06-16
| website = kernelnewbies.org}}</ref> KVM requires a processor with [[hardware virtualization]] extensions, such as [[Intel VT]] or [[AMD-V]].<ref>[http://www.linux-kvm.org/page/FAQ#What_do_I_need_to_use_KVM.3F KVM FAQ: What do I need to use KVM?]</ref> KVM has also been ported to other operating systems such as [[FreeBSD]]<ref>{{cite web|url=http://www.freebsd.org/news/status/report-2007-07-2007-10.html#Porting-Linux-KVM-to-FreeBSD|title=FreeBSD Quarterly Status Report: Porting Linux KVM to FreeBSD}}</ref> and [[illumos]]<ref>{{cite web|url=http://dtrace.org/blogs/bmc/2011/08/15/kvm-on-illumos/|title=KVM on illumos|date=15 August 2011 }}</ref> in the form of loadable kernel modules.
KVM was originally designed for [[x86]] processors but has since been [[porting|ported]] to [[z/Architecture]],<ref name="2626notes">{{cite web
| url = https://kernelnewbies.org/Linux_2_6_26#KVM_ported_to_IA64.2C_PPC_and_S390
| title = Linux_2_6_26
| at = 1.2. KVM ported to IA64, PPC and S390
| date = 2008-07-13
| access-date = 2025-08-23
| website = kernelnewbies.org}}</ref><ref>{{cite web |url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b0c632db637d68ad39d9f97f452ce176253f5f4e |title=KVM: s390: arch backend for the kvm kernel module |date=2008-04-27}}</ref> [[PowerPC]],<ref name="2626notes" /> [[IA-64]],<ref name="2626notes" /> and [[ARM architecture|ARM]].<ref>{{cite web |url=https://systems.cs.columbia.edu/projects/kvm-arm/ |title=KVM/ARM: An Open-Source ARM Virtualization System}}</ref><ref>{{Cite web |url=https://columbia.github.com/linux-kvm-arm |title=KVM/ARM Open Source Project |access-date=2017-11-01 |archive-url=https://web.archive.org/web/20130310052146/http://columbia.github.com/linux-kvm-arm/ |archive-date=2013-03-10 |url-status=dead }}</ref><ref>{{Cite journal|url=https://dl.acm.org/doi/10.1145/2654822.2541946 | title = KVM/ARM: The Design and Implementation of the Linux ARM Hypervisor | author1 = Christoffer Dall | author2 = Jason Nieh | journal = SIGARCH Comput. Archit. News | publisher = ACM International Conference on Architectural Support for Programming Languages and Operating Systems | date = 2014| volume = 42 | issue = 1 | pages = 333–348 | doi = 10.1145/2654822.2541946 }}</ref>
The IA-64 port was removed in 2014.<ref>{{Cite web|url=https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=003f7de6258900e17f6206e8e417d76c75ca549f | title=kernel/git/torvalds/linux.git: KVM: ia64: remove}}</ref>
KVM supports [[hardware-assisted virtualization]] for a wide variety of guest operating systems including [[BSD]], [[Solaris (operating system)|Solaris]], [[Microsoft Windows|Windows]], [[Haiku (operating system)|Haiku]], [[ReactOS]], [[Plan 9 from Bell Labs|Plan 9]], [[AROS Research Operating System|AROS]], [[macOS]], and even other Linux systems.<ref>{{cite web | url = http://www.linux-kvm.org/page/Guest_Support_Status | title = KVM wiki: Guest support status | access-date =2007-05-27 }}</ref><ref>{{cite web|url=http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/|title=Running Mac OS X as a QEMU/KVM Guest|access-date=2014-08-20}}</ref> In addition, Android 2.2, [[GNU/Hurd]]<ref>{{cite web|url=https://www.gnu.org/software/hurd/hurd/status.html |title=status |publisher=Gnu.org |access-date=2014-02-12}}</ref> ([[Debian]] K16), [[MINIX 3|Minix]] 3.1.2a, Solaris 10 U3 and [[Darwin (operating system)|Darwin]] 8.0.1, together with other operating systems and some newer versions of these listed, are known to work with certain limitations.<ref>{{cite web|url=http://www.linux-kvm.org/page/Guest_Support_Status |title=Guest Support Status - KVM |publisher=Linux-kvm.org |access-date=2014-02-12}}</ref>
Additionally, KVM provides [[paravirtualization]] support for Linux, [[OpenBSD]],<ref>{{cite web |url=https://man.openbsd.org/virtio.4|title=OpenBSD man page virtio(4) |access-date=2018-02-04}}</ref> FreeBSD,<ref>{{cite web |url=http://people.freebsd.org/~kuriyama/virtio/|title=virtio binary packages for FreeBSD|access-date=2012-10-29}}</ref> [[NetBSD]],<ref>{{cite web |url=http://netbsd.gw.com/cgi-bin/man-cgi?virtio++NetBSD-current |title=NetBSD man page virtio(4) |access-date=2013-07-15 |archive-date=2019-11-13 |archive-url=https://web.archive.org/web/20191113035952/https://netbsd.gw.com/cgi-bin/man-cgi?virtio++NetBSD-current |url-status=dead }}</ref> Plan 9<ref>{{cite web |url=https://code.google.com/p/plan9front/wiki/qemu |title=plan9front |access-date=2013-02-11}}</ref> and Windows guests using the VirtIO [[API]].<ref>{{cite web |url=https://lwn.net/Articles/239238/ |title=An API for virtual I/O: virtio |date=2007-07-11 |access-date=2014-04-16 |publisher=[[LWN.net]]}}</ref> This includes a paravirtual [[Ethernet card]], disk I/O controller,<ref>{{cite web |url=http://linux-iscsi.org/wiki/vHost |title=SCSI target for KVM wiki |publisher=linux-iscsi.org |date=2012-08-07 |access-date=2012-08-12 |archive-date=2020-06-05 |archive-url=https://web.archive.org/web/20200605120413/http://linux-iscsi.org/wiki/VHost |url-status=dead }}</ref> [[balloon driver]], and a [[VGA]] graphics interface using [[SPICE (protocol)|SPICE]] or [[VMware]] drivers.
==History==
[[Avi Kivity]] began the development of KVM in mid-2006 at [[Qumranet]], a technology [[startup company]]<ref>[http://kerneltrap.org/node/8088 Interview: Avi Kivity] {{webarchive|url=https://web.archive.org/web/20070426033902/http://kerneltrap.org/node/8088 |date=2007-04-26 }} on [[KernelTrap]]</ref> that was acquired by [[Red Hat]] in 2008.<ref>{{cite web
| url = http://www.redhat.com/en/about/press-releases/qumranet
| title = Red Hat Advances Virtualization Leadership with Qumranet, Inc. Acquisition
| date = 4 September 2008
|
| publisher = [[Red Hat]]}}</ref>
KVM surfaced in October
KVM is maintained by Paolo Bonzini.<ref>{{cite web
Line 22 ⟶ 53:
| title = Git Success Stories and Tips from KVM Maintainer Paolo Bonzini
| date = 7 April 2015
|
| author = Libby Clark
| publisher = [[Linux.com]]
Line 31 ⟶ 62:
== Internals ==
[[File:Kernel-based Virtual Machine.svg|thumb|right|upright=1.8|A high-level overview of the KVM/QEMU virtualization environment<ref>{{cite web
| url = http://www-01.ibm.com/support/knowledgecenter/api/content/nl/en-us/linuxonibm/liaav/LPCKVMSSPV2.1.pdf
| title = KVM/QEMU Storage Stack Performance Discussion
| year = 2010
| access-date = January 3, 2015
| author1 = Khoa Huynh
| author2 = Stefan Hajnoczi
| publisher = Linux Plumbers Conference
| website = IBM
}}{{dead link
| date = January 2018
| bot = InternetArchiveBot
| fix-attempted = yes}}</ref>{{rp|3}}]]
KVM provides device abstraction but no processor emulation. It exposes the {{mono|/dev/kvm}} interface, which a user mode host can then use to:
* Set up the guest VM's address space. The host must also supply a firmware image (usually a custom BIOS when emulating PCs) that the guest can use to bootstrap into its main OS.
* Feed the guest simulated I/O.
* Map the guest's video display back onto the system host.
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_(software)|Firecracker]] and numerous specialised VMMs built with frameworks such as rust-vmm.
Internally, KVM uses [[SeaBIOS]] as an open source implementation of a 16-bit x86 [[BIOS]].<ref>{{cite web|url=http://www.seabios.org/SeaBIOS |title=SeaBIOS |publisher=seabios.org |date=2013-12-21 |access-date=2014-06-16}}</ref>
==Features==
KVM
==Emulated hardware==
KVM itself emulates very little hardware, instead deferring to a higher level client application such as [[QEMU]], crosvm, or [[Firecracker (software)|Firecracker]] for device emulation.
KVM provides the following emulated devices:
* Virtual [[CPU]] and memory<ref>{{cite web | url=https://www.kernel.org/doc/html/latest/virt/kvm/api.html#kvm-create-irqchip | title=The Definitive KVM (Kernel-based Virtual Machine) API Documentation — the Linux Kernel documentation }}</ref>
* VirtIO
==Graphical management tools==
Line 73 ⟶ 103:
* [[Virtual Machine Manager]]{{snd}} supports creating, editing, starting, and stopping KVM-based virtual machines, as well as live or cold drag-and-drop migration of VMs between hosts.
* [[Proxmox Virtual Environment]]{{snd}} an open-source virtualization management package including KVM and [[LXC]]. It has a bare-metal installer, a web-based remote management GUI, a HA cluster stack, unified storage, flexible network, and optional commercial support.
* [[OpenQRM]]{{snd}} management platform for managing heterogeneous data center infrastructures
* [[GNOME Boxes]]{{snd}} Gnome interface for managing libvirt guests on Linux
* [[oVirt]]{{snd}} open-source virtualization management tool for KVM built on top of [[libvirt]]
==Licensing==
The kernel-mode component of KVM is a part of the [[Linux kernel]], itself licensed under [[GNU General Public License#Version 2|GNU General Public License, version 2]].<ref name="Linux_Licensing">{{Cite web|url=https://www.kernel.org/doc/html/latest/process/license-rules.html#kernel-licensing|title=Linux kernel licensing rules — The Linux Kernel documentation|website=www.kernel.org|access-date=2020-01-06|archive-date=7 March 2020|archive-url=https://web.archive.org/web/20200307065451/https://www.kernel.org/doc/html/latest/process/license-rules.html#kernel-licensing|url-status=live}}</ref>
==See also==
Line 91 ⟶ 116:
* [[CloudStack]]
* [[Comparison of platform virtualization software]]
* [[Hyper-V]]
* [[Kernel same-page merging]] (KSM)
* [[Lguest]]
* [[libguestfs]]
* [[Open Virtualization Alliance]]
* [[OpenNebula]]
* [[OpenStack]]
* [[Red Hat Virtualization]]
* [[Vx32]]
Line 109 ⟶ 132:
==Bibliography==
* {{cite web|
==External links==
* [http://public.dhe.ibm.com/software/dw/linux390/perf/ZSW03346USEN.pdf Best practices for the Kernel-based Virtual Machine] {{Webarchive|url=https://web.archive.org/web/20191106035557/http://public.dhe.ibm.com/software/dw/linux390/perf/ZSW03346USEN.pdf |date=2019-11-06 }}, IBM, second edition, April 2012
* [https://web.archive.org/web/20141021055601/http://www.linux-kvm.org/wiki/images/f/f9/2012-forum-virtio-blk-performance-improvement.pdf Virtio-blk Performance Improvement], KVM Forum 2012, November 8, 2012, by Asias He
* [https://web.archive.org/web/20101128114720/http://qemu-buch.de/e/Content Wikibook QEMU & KVM]
* [https://chromium.googlesource.com/chromiumos/platform/crosvm/ crosvm - Chrome OS virtual machine monitor]
* [https://firecracker-microvm.github.io/ Firecracker VMM for KVM]
{{Virtualization products}}
Line 128 ⟶ 152:
[[Category:Linux kernel features]]
[[Category:Virtualization software]]
[[Category:Virtualization
[[Category:Red Hat software]]
|