Kernel-based Virtual Machine: Difference between revisions

Content deleted Content added
m updated citation link
mNo edit summary
Line 1:
<!-- {{Redirect|KVM}} -->
{{Infobox software
| name = KVM
| logo = Kvmbanner-logo2 1.png
| logo size = 160px
| screenshot = Kvm running various guests.png
| screenshot size = 300px
| caption = Screenshot of QEMU/KVM running [[NetBSD]], [[OpenSolaris]] and [[Kubuntu]] guests on an [[Arch Linux]] host.
| author = [[Qumranet]]
| developer = [[Open Virtualization Alliance]] (OVA)
| operating_system = [[Unix-like]]
| programming_language = [[C (programming language)|C]]
| platform = [[ARM architecture|ARM]], [[IA-64]], [[PowerPC]], [[IBM ESA/390|S/390]], [[x86]], [[x86-64]]
| genre = [[Hypervisor]]
| license = [[GNU General Public License|GNU GPL]] or [[GNU Lesser General Public License|LGPL]]
| website = {{URL|www.linux-kvm.org}}
}}
{{Distinguish|KVM switch}}
 
'''Kernel-based Virtual Machine''' ('''KVM''') is a [[virtualization]] module in the [[Linux kernel]] that allows the kernel to function as a [[hypervisor]]. It was merged into the Linux kernel mainline in kernel 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
| accessdate = 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}}</ref> in the form of loadable kernel modules.
| 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}}</ref> in the form of loadable kernel modules.
 
KVM was originally designed for [[x86]] processors and has since been [[porting|ported]] to [[IBM ESA/390|S/390]],<ref>{{Cite web |url=http://article.gmane.org/gmane.comp.emulators.kvm.devel/2570 |title=Gmane - Mail To News And Back Again<!-- Bot generated title --> |access-date=2007-05-07 |archive-url=https://web.archive.org/web/20070929124348/http://article.gmane.org/gmane.comp.emulators.kvm.devel/2570 |archive-date=2007-09-29 |url-status=dead }}</ref> [[PowerPC]],<ref>[http://news.gmane.org/gmane.comp.emulators.kvm.devel/2595 Gmane Loom<!-- Bot generated title -->] {{webarchive|url=https://web.archive.org/web/20070929103042/http://news.gmane.org/gmane.comp.emulators.kvm.devel/2595 |date=2007-09-29 }}</ref> [[IA-64]], and [[ARM architecture|ARM]].<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>
Line 29:
KVM provides [[hardware-assisted virtualization]] for a wide variety of guest operating systems including Linux, BSD, [[Solaris (operating system)|Solaris]], [[Microsoft Windows|Windows]], [[Haiku (operating system)|Haiku]], [[ReactOS]], [[Plan 9 from Bell Labs|Plan 9]], [[AROS Research Operating System]]<ref>{{cite web | url = http://www.linux-kvm.org/page/Guest_Support_Status | title = KVM wiki: Guest support status | accessdate =2007-05-27 }}</ref> and [[macOS]].<ref>{{cite web|url=http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/|title=Running Mac OS X as a QEMU/KVM Guest|accessdate=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 |date= |accessdate=2014-02-12}}</ref> (Debian K16), [[MINIX 3|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.<ref>{{cite web|url=http://www.linux-kvm.org/page/Guest_Support_Status |title=Guest Support Status - KVM |publisher=Linux-kvm.org |date= |accessdate=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) |accessdate=2018-02-04}}</ref> FreeBSD,<ref>{{cite web |url=http://people.freebsd.org/~kuriyama/virtio/|title=virtio binary packages for FreeBSD|accessdate=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) |accessdate=2013-07-15}}</ref> Plan 9<ref>{{cite web |url=https://code.google.com/p/plan9front/wiki/qemu |title=plan9front |accessdate=2013-02-11}}</ref> and Windows guests using the VirtIO<ref>{{cite web |url=https://lwn.net/Articles/239238/ |title=An API for virtual I/O: virtio |date=2007-07-11 |accessdate=2014-04-16 |publisher=[[LWN.net]]}}</ref> API. 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 |accessdate=2012-08-12}}</ref> balloon device, 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
| accessdate = 16 June 2015
| publisher = [[Red Hat]]}}</ref>
}}</ref>
 
KVM surfaced in October, 2006<ref>https://www.itworldcanada.com/article/kvm-15-equipped-with-live-migration/7901</ref> and was merged into the Linux kernel mainline in kernel version 2.6.20, which was released on 5 February 2007.<ref name="2620notes" />
 
KVM is maintained by Paolo Bonzini.<ref>{{cite web
| url = http://www.linux.com/news/featured-blogs/200-libby-clark/821899-git-success-stories-and-tips-from-kvm-maintainer-paolo-bonzini
{{cite web
| title = Git Success Stories and Tips from KVM Maintainer Paolo Bonzini
| url = http://www.linux.com/news/featured-blogs/200-libby-clark/821899-git-success-stories-and-tips-from-kvm-maintainer-paolo-bonzini
| date = 7 April 2015
| title = Git Success Stories and Tips from KVM Maintainer Paolo Bonzini
| dateaccessdate = 717 AprilJune 2015
| author = Libby Clark
| accessdate = 17 June 2015
| publisher = [[Linux.com]]
| author = Libby Clark
| archive-url = https://web.archive.org/web/20160315095510/http://www.linux.com/news/featured-blogs/200-libby-clark/821899-git-success-stories-and-tips-from-kvm-maintainer-paolo-bonzini
| publisher = [[Linux.com]]
| archive-url = https://web.archive.org/web/20160315095510/http://www.linux.com/news/featured-blogs/200-libby-clark/821899-git-success-stories-and-tips-from-kvm-maintainer-paolo-bonzini
| archive-date = 15 March 2016
| url-status = dead
| df = dmy-all}}</ref>
}}
</ref>
 
== 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
| accessdate = January 3, 2015
| author1 = Khoa Huynh
| author2 = Stefan Hajnoczi
| publisher = Linux Plumbers Conference
| website = ibm.comIBM
| format = PDF}}{{dead link
| date = January 2018
}}{{dead link|date=January 2018 |bot=InternetArchiveBot |fix-attempted=yes }}</ref>{{rp|3}}]]
| bot = InternetArchiveBot
| fix-attempted = yes}}</ref>{{rp|3}}]]
 
KVM provides device abstraction but no processor emulation. It exposes the <tt>/dev/kvm</tt> 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.
Line 78 ⟶ 77:
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 |accessdate=2014-06-16}}</ref>
 
== Features ==
KVM supports [[hot plug vCPUs]] ,<ref>https://access.redhat.com/articles/1339413</ref>, dynamic memory management,<ref>https://www.linux-kvm.org/page/FAQ#Is_dynamic_memory_management_for_guests_supported.3F</ref> and [[Live Migration]] since February 2007.<ref>https://lwn.net/Articles/223754/</ref><ref>https://www.linux-kvm.org/page/Migration</ref>, memory write intensive workload impacts in migration process<ref>https://www.berrange.com/posts/2016/05/12/analysis-of-techniques-for-ensuring-migration-completion-with-kvm/</ref>.
 
== Emulated hardware ==
 
== Emulated hardware ==
{{Confusing|reason=previous sections says KVM does no emulate anything by itself, but this section lists emulated hardware. Some clarification from experts is welcome.|date=February 2019}}
 
{| class="wikitable"
|-
! Class !! Device
|-
| [[Video card]] || Cirrus CLGD 5446 PCI VGA card, dummy VGA card with [[Bochs]] [[VESA]] extensions,<ref name=qemu-doc>[http://wiki.qemu.org/download/qemu-doc.html wiki.qemu.org – QEMU Emulator User Documentation], read 2010-05-06</ref> or [[Virgil (software)|Virgil]] as a virtual 3D GPU<ref>{{cite web|url=http://airlied.livejournal.com/77553.html |title=Introducing Virgil - 3D virtual GPU for qemu |date=2013-07-18 |url-status=dead |archiveurl=https://web.archive.org/web/20130725063318/http://airlied.livejournal.com/77553.html |archivedate=2013-07-25 }}</ref>
|-
| [[PCI (bus)|PCI]] || [[Intel 440FX|i440FX]] host [[Conventional PCI#PCI bus bridges|PCI bridge]] and [[PIIX3]] PCI to ISA bridge<ref name=qemu-doc/>
|-
| [[Input device]] || [[PS/2 connector|PS/2]] Mouse and Keyboard<ref name=qemu-doc/>
|-
| [[Sound card]] || [[Sound Blaster 16]], ENSONIQ AudioPCI [[ES1370]], [[Gravis Ultrasound GF1]], CS4231A compatible<ref name=qemu-doc/>
|-
| [[Ethernet]] [[Network card]] || AMD Am79C970A ([[Am7990]]), E1000 (Intel 82540EM, 82573L, 82544GC), [[NE2000]], and Realtek [[RTL8139]]
Line 106 ⟶ 104:
|}
 
== Graphical management tools ==
[[File:Libvirt support.svg|thumb|300px|[[libvirt]] supports KVM]]
 
Line 124 ⟶ 122:
* BIOS files (bios.bin, vgabios.bin and vgabios-cirrus.bin): LGPL v2 or later
 
== See also ==
{{Portal|Free and open-source software|Linux}}
 
Line 147 ⟶ 145:
{{Reflist|30em}}
 
== Bibliography ==
 
* {{cite web|accessdate=2017-02-10|title=Ten years of KVM|url=https://lwn.net/Articles/705160/|website=lwn.net|author=Amit Shah|date=2016-11-02}}