http://www.nongnu.org/qemu/about.html [+]q
KVM uses a slightly modified QEMU program to instantiate the virtual machine. Once running, a virtual machine is just a regular process. You can use `top(1), kill(1), taskset(1)` and similar tools to manage virtual machines.
http://qemu.weilnetz.de/qemu-tech.html
Like bochs [3], QEMU emulates an x86 CPU. But QEMU is much faster than bochs as it uses dynamic compilation. Bochs is closely tied to x86 PC emulation while QEMU can emulate several processors.
Like Valgrind [2], QEMU does user space emulation and dynamic translation. Valgrind is mainly a memory debugger while QEMU has no support for it (QEMU could be used to detect out of bound memory accesses as Valgrind, but it has no support to track uninitialised data as Valgrind does). The Valgrind dynamic translator generates better code than QEMU (in particular it does register allocation) but it is closely tied to an x86 host and target and has no support for precise exceptions and system emulation.
EM86 [4] is the closest project to user space QEMU (and QEMU still uses some of its code, in particular the ELF file loader). EM86 was limited to an alpha host and used a proprietary and slow interpreter (the interpreter part of the FX!32 Digital Win32 code translator [5]).
TWIN [6] is a Windows API emulator like Wine. It is less accurate than Wine but includes a protected mode x86 interpreter to launch x86 Windows executables. Such an approach has greater potential because most of the Windows API is executed natively but it is far more difficult to develop because all the data structures and function parameters exchanged between the API and the x86 code must be converted.
User mode Linux [7] was the only solution before QEMU to launch a Linux kernel as a process while not needing any host kernel patches. However, user mode Linux requires heavy kernel patches while QEMU accepts unpatched Linux kernels. The price to pay is that QEMU is slower.
The Plex86 [8] PC virtualizer is done in the same spirit as the now obsolete qemu-fast system emulator. It requires a patched Linux kernel to work (you cannot launch the same kernel on your PC), but the patches are really small. As it is a PC virtualizer (no emulation is done except for some privileged instructions), it has the potential of being faster than QEMU. The downside is that a complicated (and potentially unsafe) host kernel patch is needed.
The commercial PC Virtualizers (VMWare [9], VirtualPC [10], TwoOStwo [11]) are faster than QEMU, but they all need specific, proprietary and potentially unsafe host drivers. Moreover, they are unable to provide cycle exact simulation as an emulator can.
VirtualBox [12], Xen [13] and KVM [14] are based on QEMU. QEMU-SystemC [15] uses QEMU to simulate a system where some hardware devices are developed in SystemC.
To make it work, you need to get the right version for three components:
KVM requires a linux kernel module to support full virtualization. The linux module consists of three files: kvm.ko, kvm_intel.ko (for Intel processors), kvm_amd.ko (for AMD processors). You can install these modules just like you install drivers for your video card. The good news is, you may not need to install anything - the 2.6.20 kernel version (and higher) includes these kernel modules as part of the mainline kernel. It will depend on your distribution configuration whether these modules are actually in the distribution kernel as a built-in or provided as modules (or possibly absent). Here is a table listing the relation of KVM module versions to mainline kernel releases:
If you are not sure your linux distribution contain it or not, use this command:
modprobe -l | grep kvm
The linux module can be built from source code. This is also the recommended way to get the right version of linux module. Compiling from the source code, and than make install should make the linux module inserted into your /lib/modules/linux-`uname -r`. Simply make it in use by:
modprobe kvm modprobe kvm_intel
or
modprobe kvm modprobe kvm_amd
Compile from source code, you can get it. Otherwise, refer to the previous section.
There was no special requirement for guest operating system if you are not using para-visualized disk ornetwork adapter. If you are using them, make sure you get virtio_pci.ko, virtio_rng.ko, virtio_blk.ko, virtio_net.ko. They are in 2.6.25 or later kernel. There is also a option to backport them.
Refer to Virtio for more information