Qemu,kvm,qemu-kvm,xen,libvir differences

Source: Internet
Author: User
Tags svm amd processors

KVM: (kernel-based virtual machine) kernel-based VMS

KVM is hypervisor integrated into the Linux kernel, a full-virtualization solution for Linux with X86 architecture and hardware-enabled virtualization technology (Intel VT or AMD-V). It is a very small module of Linux, using Linux to do a lot of things, such as task scheduling, memory management and hardware device interaction and so on.

In the form of presence, KVM is the two kernel modules Kvm.ko and Kvm_intel.ko (for AMD processors, the Kvm_amd.ko), two modules for CPU virtualization. If you want to allow users to complete a virtual machine-related operation on a KVM that obviously requires user space and also includes IO virtualization, KVM's solution draws on QEMU's stuff and makes some modifications, forming its own KVM virtual machine toolset and IO virtualization support, The so-called QEMU-KVM. (KVM is a fork of QEMU, namely QEMU-KVM)

Xen

Xen is the first type of virtualization hypervisor (Hypervisor) that runs on the bare metal. It supports full virtualization and para-virtualization, Xen supports hypervisor and virtual machines communicating with each other, and offers free products on all Linux versions, including Red Hat Enterprise Linux and SuSE Linux Enterprise Server. The most important advantage of Xen is the semi-virtualized, and the unmodified operating system can also run directly on Xen (such as Windows), allowing the virtual machine to run efficiently without the need for emulation, so the virtual function perceives the hypervisor without the need to emulate virtual hardware, which enables high performance. QEMU is used by Xen.

Qemu

QEMU is a set of free software for analog processors written by Fabrice Bellard. It is similar to BOCHS,PEARPC, but it has features that are not available in the latter two, such as high-speed and cross-platform features, and QEMU can virtualize virtual machines of different architectures, such as virtual power machines on the x86 platform. Kqemu is a QEMU accelerator, and with Kqemu, the open source Accelerator, QEMU simulates the speed of approaching a real computer.

QEMU itself can be independent of KVM, but if there is a KVM presence and hardware (processor) support such as the Intel VT feature, then QEMU can take advantage of KVM-provided functionality to improve performance in the case of processor virtualization.

The relationship between KVM and QEMU

To be exact, KVM is a module of Linux kernel. You can use the command modprobe to load the KVM module. After the module is loaded, you can further create the virtual machine from another tool. But only the KVM module is not enough, because the user can not directly control the kernel module to do things, you must also have a run in the user space of the tool. This user-space tool, the KVM developer chooses the already formed open source virtualization software QEMU. It says QEMU is also a virtualization software. It is characterized by a virtual different CPU. For example, a power CPU can be virtualized on a x86 CPU, and it can be used to compile programs that can run on power. KVM uses a subset of QEMU and is transformed into a user-space tool that can control KVM. So you'll see that the official KVM download has two (QEMU and KVM) three files (KVM modules, qemu tools, and a collection of both). That is, you can upgrade only the KVM module, or you can upgrade only the Qemu tool. This is the relationship between KVM and QEMU.

QEMU is a standalone virtualization solution that does not rely on KVM from this point of view. KVM is another set of virtualization solutions, but since this scenario actually only supports the processor (Intel VT, AMD SVM) virtualization feature in the kernel, it lacks the tools for device virtualization and the corresponding user space management virtual machines, So it borrows the code from QEMU and streamlines it, together with KVM, to form another standalone virtualization solution, which you might call: Kvm+qemu.

KVM User space virtual machine management tools are KVM, kvm-img, KVM-NBD, Kvm-ok and Kvm_stat, actually KVM is a symbolic link to qemu-system-x86_64, Kvm-img is a symbolic link to qemu-img. In terms of scope, the QEMU virtualization solution supports many other architectures in addition to the x86 architecture, such as QEMU-SYSTEM-M68K,QEMU-SYSTEM-MIPS64, QEMU-SYSTEM-PPC64, Qemu-system-arm and so on. However, the current reference to KVM, generally referred to as x86 based on Intel VT and AMD SVM Solutions, although the current KVM to arm, PPC work is in progress.


Of course, since Redhat has started to support KVM, it believes that the Kvm+qemu ' scheme of user-space virtual machine management tools is not very good, or the versatility is not strong, so Redhat think of a libvirt out, a management of the virtual Machine API library, not only for KVM, You can also manage virtual machines in scenarios such as Xen.


Kvm-qemu executables are like normal QEMU: allocating RAM, loading code, unlike recompiling or calling Callingkqemu, it creates a thread (which is important); This thread calls the KVM kernel module to switch to user mode and executes the VM code. When a privileged command is encountered, it switches from the KVM kernel module, which, when needed, handles most of the hardware emulation like the QEMU line Cheng signal.

One of the more ingenious parts of this architecture is that the client code is modeled on a POSIX thread, which allows you to use the usual Linux tools to manage. If you need a virtual machine with 2 or 4 cores, Kvm-qemu creates 2 or 4 threads, and each thread calls the KVM kernel module and starts executing. Concurrency (if you have enough real cores) or scheduling (if you don't care) is a generic Linux scheduler, which makes the amount of KVM code very small.

When working together, KVM manages CPU and mem access, QEMU emulation hardware resources (hard drives, sound cards, USB, etc.) when QEMU is running alone, QEMU simulates both CPU and hardware.
From http://yansu.org/2013/03/20/different-bewteen-kvm-xen-qemu.html

From http://blog.chinaunix.net/uid-23769728-id-3256677.html

From http://zhidao.baidu.com/question/536621740.html

Qemu,kvm,qemu-kvm,xen,libvir differences

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.