You are on page 1of 2

What is the difference between KVM and Xen?

Xen is an external hypervisor; it assumes control of the machine and divides resources among guests. On the other hand, KVM is part of Linux and uses the regular Linux scheduler and memory management. This means that KVM is much smaller and simpler to use; it is also more featureful; for example KVM can swap guests to disk in order to free RAM. KVM only run on processors that supports x86 hvm (vt/svm instructions set) whereas Xen also allows running modified operating systems on non-hvm x86 processors using a technique called paravirtualization. KVM does not support paravirtualization for CPU but may support paravirtualization for device drivers to improve I/O performance.

Xen is a thin hypervisor that takes control before the OS are loaded. On top of it runs your main Host OS, and possibly several Guest OS. The Host and Guest have to use a kernel specially built for Xen, and they can communicate using optimized techniques proper to Xen and run close to native speed. Qemu is a full emulator, meaning the Guest sees "classical" virtual hardware (Qemu can also emulate other architectures than the one of the host), so the Guest does not have to be aware that it is being virtualized. On the other hand, it can be slower by a couple orders of magnitude than a native system. KVM is an accelerator that allows Qemu-kvm to match speeds with Xen. It cannot run on any CPU, however; the CPU has to be "virtualisable". For x86-64, it means support for either Intel or AMD virtualization extensions (look at the contents of /proc/cpuinfo and check for one of the flags, svm for AMD or vmx for intel) KVM is probably easier to deploy (it does not require touching the Host system) if you have a compatible CPU. In short:    Xen: fast, runs anywhere, but requires custom OS kernel Qemu without kvm: runs anything anywhere, but slow Qemu-kvm: fast, doesn't require custom kernel, but runs only on specific CPUs

Xen supported virtualization types Xen supports running two different types of guests. Xen guests are often called as domUs (unprivileged domains). Both guest types (PV, HVM) can be used at the same time on a single Xen system. Xen Paravirtualization (PV) Paravirtualization is an efficient and lightweight virtualization technique introduced by Xen, later adopted also by other virtualization solutions. Paravirtualization doesn't require virtualization extensions from the host CPU. However paravirtualized guests require special kernel that is ported to run natively on Xen, so the guests are aware of the hypervisor and can run efficiently without emulation or virtual emulated hardware. Xen PV guest kernels exist for Linux, NetBSD, FreeBSD, OpenSolaris and Novell Netware operating systems.

PV guest graphical console can be viewed using VNC client. Fully virtualized guests are usually slower than paravirtualized guests.6. .24 include Xen PV guest (domU) support based on the Linux pvops framework. or Redhat's virt-viewer. To boost performance fully virtualized HVM guests can use special paravirtual device drivers to bypass the emulation for disk and network IO. so for example Windows operating systems can be used as Xen HVM guest. Fully virtualized guests don't require special kernel. CPU virtualization extensions are used to boost performance of the emulation. including BIOS. Upstream kernel.PV guests don't have any kind of virtual emulated hardware. See XenLinuxPVonHVMdrivers wiki page for more information about Xen PV-on-HVM drivers for Linux HVM guests. VGA graphic adapter. Xen Full virtualization (HVM) Fully virtualized aka HVM (Hardware Virtual Machine) guests require CPU virtualization extensions from the host CPU (Intel VT. USB controller. but graphical console is still possible using guest pvfb (paravirtual framebuffer).org Linux kernels since Linux 2. IDE disk controller. Xen uses modified version of Qemu to emulate full PC hardware. AMD-V). There's a separate VNC server in dom0 for each guest's PVFB. so every upstream Linux kernel can be automatically used as Xen PV guest kernel without any additional patches or modifications. because of the required emulation. Xen Windows HVM guests can use the opensource GPLPV drivers. network adapter etc for HVM guests.