In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you what are the differences between qemu,kvm,qemu-kvm,xen,libvirt, I hope you have something to gain after reading this article, let's discuss it together!
KVM: (Kernel-based Virtual Machine) Kernel-based virtual machine
KVM is a Hypervisor integrated into the Linux kernel and a fully virtualized solution for Linux with X86 architecture and hardware support for virtualization technologies (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.
In terms of existence form, KVM is two kernel modules, kvm.ko and kvm_intel.ko (or kvm_amd.ko for AMD processors), which are used to virtualize CPU. If you want users to complete a virtual machine-related operation on KVM, you obviously need something in user space, including IO virtualization, so KVM's solution draws lessons from QEMU and makes some modifications to form its own KVM virtual machine toolset and IO virtualization support, that is, the so-called qemu-kvm. (KVM is a fork of QEMU, namely qemu-kvm)
Xen
Xen is the first type of virtualization manager (Hypervisor) that runs on bare metal. It supports full virtualization and paravirtualization, Xen supports hypervisor and virtual machines to communicate 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 paravirtualization, and unmodified operating systems can also run directly on xen (such as Windows), allowing virtual machines to run efficiently without simulation, so virtual machines are aware of hypervisor and do not need to simulate virtual hardware, thus achieving high performance. QEMU is used by Xen.
QEMU
QEMU is a set of free software for simulating processors written by Fabrice Bellard. It is similar to Bochs,PearPC, but it has some characteristics that the latter two do not have, such as high speed and cross-platform characteristics. Qemu can virtualize virtual machines of different architectures, such as power machines on x86 platform. Kqemu is the accelerator of qemu. Through kqemu, an open source accelerator, QEMU can simulate to the speed of a real computer.
QEMU itself can be independent of KVM, but if KVM exists and the hardware (processor) supports features such as Intel VT, then QEMU can take advantage of the capabilities provided by KVM to improve performance in virtualizing the processor.
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 through other tools. But the KVM module is far from enough, because the user cannot directly control the kernel module to do things, and you must have a tool that runs in user space. As a user-space tool, kvm developers chose the established open source virtualization software QEMU. QEMU is also a virtualization software. Its characteristic is that it can virtualize different CPU. For example, you can virtualize a Power CPU on x86 CPU, and use it to compile programs that can run on Power. KVM uses part of QEMU and is slightly modified to become a user space tool that can control KVM. So you will see that the official KVM download has two major parts (qemu and kvm) and three files (the KVM module, the QEMU tool, and a collection of both). In other words, you can only upgrade KVM modules, or you can upgrade only QEMU tools. This is the relationship between KVM and QEMU.
QEMU is a standalone virtualization solution, and from this point of view it does not rely on KVM. KVM is another virtualization solution, but because this solution actually only supports the virtualization features of processors (Intel VT, AMD SVM) in the kernel, in other words, it lacks the tools for device virtualization and corresponding user space to manage virtual machines, so it borrows the code of QEMU and simplifies it. Together with KVM, it forms another independent virtualization solution, which can be called KVM+QEMU.
KVM user space virtual machine management tools include kvm, kvm-img, kvm-nbd, kvm-ok and kvm_stat. In fact, kvm is a symbolic link to qemu-system-x86_64, and kvm-img is a symbolic link to qemu-img. In terms of scope, the QEMU virtualization solution supports not only x86 architecture, but also many other architectures, such as qemu-system-m68k,qemu-system-mips64, qemu-system-ppc64, qemu-system-arm, and so on. But when it comes to KVM, it generally refers to Intel VT-based and AMD SVM-based solutions on x86, although currently porting KVM to ARM, work on PPC is under way.
Of course, because redhat has begun to support KVM, it thinks that the user space virtual machine management tools in the KVM+QEMU' scheme are not very good, or the versatility is not strong, so redhat came up with a libvirt, an API library for managing virtual machines, not only for KVM, but also for virtual machines under Xen and other schemes.
The kvm-qemu executable is like a normal Qemu: allocates RAM, loads code, and 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 encountered with a privileged instruction, it reswitches to KVM the kernel module, which, when needed, signals like the Qemu thread to handle most of the hardware emulation.
One of the more ingenious aspects of this architecture is that the client code is impersonated in 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, each of which calls the KVM kernel module and starts execution. Concurrency (if you have enough real cores) or scheduling (if you don't care) is used by the general Linux scheduler, which makes the amount of KVM code very small.
When working together, KVM manages access to CPU and MEM, and QEMU emulates hardware resources (hard disk, sound card, USB, etc.) when QEMU runs alone, QEMU simulates both CPU and hardware. After reading this article, I believe you have a certain understanding of "what are the differences between qemu,kvm,qemu-kvm,xen,libvirt". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.