19

What is the difference between KVM and Qemu? As I understand, latter is able to provide "user mode emulation" which means that one can run a single executable built for some other architecture like this:

# file busybox-sparc 
busybox-sparc: ELF 32-bit MSB executable, SPARC, version 1 (SYSV), statically linked, stripped
# qemu-sparc busybox-sparc ls
Packages_arm     Packages_i386    arm              busybox-armv6l   busybox-i686     busybox-powerpc  busybox-sparc    busybox-x86_64   i386
# 

..and "computer emulation", which means that not only dynamic binary translation is performed, but whole virtual machine is emulated(video card, sound card, network cards, optical devices etc). For example:

# qemu-system-sparc64 -hda hda.img -cdrom debian-6.0.5-sparc-CD-1.iso -boot d

As I have understood, Qemu does not know how to take advantage of hardware virtualization(for example Intel VT-x or AMD-V solutions on x86 architecture) and this is the case where KVM can help- one can start Qemu with KVM support. However, does KVM provide any other functionality besides access for emulation programs to hardware-assisted virtualization on specific hardware architectures? Is it possible to create whole(CPU, video card, I/O devices etc) virtual machine using only KVM? If yes, then which programs should one use for creating and controlling this virtual machine?

Martin
  • 332
  • 3
  • 10
  • 28
  • 2
    possible duplicate of [Difference between KVM and QEMU](http://serverfault.com/questions/208693/difference-between-kvm-and-qemu) –  Feb 12 '15 at 11:57
  • There is also the [QEMU book](http://qemu-buch.de/) which has the official title of **QEMU, Kernel-based Virtual Machine (KVM), Xen & libvirt** ... but it is entirely in German. However, there is a link to [a google-translated English version](http://translate.google.de/translate?hl=en&ie=UTF-8&sl=de&tl=en&u=http://qemu-buch.de/de/index.php/QEMU-KVM-Buch/_Grundlagen). (Please don't let this discourage you: The translation follows the German text with high confidence, which is also an indicator of tremendous effort by the authors to explain such a complex topic in simple terms and sentences.) – toraritte Aug 21 '21 at 12:14

2 Answers2

17

You are partially correct. Just be careful, as there can be some confusion. KVM is the name of the virtualization technology in the Linux kernel.

KVM is also commonly used as the name of a fork (a more accurate name would be qemu-kvm) of the QEMU project with better support for the hardware virtualization. This claim was confirmed by the QEMU project, but as of version 1.3 of QEMU all features of qemu-kvm have been merged.

The download page for the KVM project explains that difference quite well as well.

One more thing to keep in mind is that the advantages of qemu-kvm are being merged in the newer releases of qemu, so I hope one day the difference between the two will disappear.

chutz
  • 7,569
  • 1
  • 28
  • 57
7

KVM is a kernel module that allows, through virtualization specific CPU extensions, to schedule a VMs CPU request directly in the host CPU and RAM, with minimal amount of overhead. QEMU provides the rest of the emulated hardware, because a machine, even virtual, is not just a CPU - it's a lot of additional hardware. QEMU can also emulate the CPU, but compared to the way KVM does it, it's painfully slow, thus the merge, to get the best of both worlds

dyasny
  • 18,482
  • 6
  • 48
  • 63