Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the differences between KVM, QEMU and libvirt

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what are the differences between KVM, QEMU and libvirt". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the differences between KVM, QEMU and libvirt"?

I. introduction to KVM

KVM (whose name comes from the acronym of Kernel-basedVirtual Machine, or kernel-based virtual machine) is a virtualized infrastructure used in the Linux kernel and a functional module in the linux kernel that is installed by default. You can convert the Linux kernel into a hypervisor. KVM was imported into the Linux 2.6.20 core in February 2007 and ported to FreeBSD and illumos as loadable core modules.

KVM runs on x86 platforms with Intel VT or AMD-V capabilities. It has also been ported to Splink 390 PowerPC and IA-64 platforms. In version 3.9 of the Linux kernel, add support for the ARM architecture. Whether it is supported or not can also be checked from the command line: egrep'(vmx | svm)'- color=always / proc/cpuinfo. If there is anything, it means that the current hardware architecture supports kvm, otherwise it will not be supported. In addition, even if it is supported, it is not enabled by default in bios, so you have to go to bios to set it to enable.

II. QEMU

Full name is Quick Emulator. In fact, it is also a virtualization technology, even without the use of kvm, a single version of qemu can completely implement a virtual machine. Then why does the term qemu-kvm still exist? Because although the technology of kvm is quite mature and can isolate a lot of things, it is still impossible to virtualize the real machine in some ways. For example, the virtual network card, then need another technology to supplement at this time, and qemu-kvm is such a technology. It complements the deficiency of kvm technology and optimizes kvm in performance.

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 processor (Intel VT) and 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, and together with KVM forms another independent virtualization solution: KVM+QEMU.

KVM is something contained in the linux kernel, using qemu as the upper management (command line). Qemu is independent virtual software that can run virtual machines independently (no kvm is required at all). Kqemu is the acceleration software of this software. Kvm does not need qemu for virtual processing, but needs its upper management interface for virtual machine control. The virtual machine is still driven by kvm.

Three. Libvirt

What is libvirt? It is a series of provided library functions that can be called by other technologies to manage virtual machines on the machine. Including various virtual machine technologies, such as kvm, xen and lxc, the api provided by libvirt can be used to manage the virtual machine. With so many virtual machine technologies, why can it provide so many management functions? Because of its design philosophy, it is a driver-oriented architecture design. The driver relative to this technology is developed and designed for any kind of virtual machine technology. In this way, different virtual machine technologies can use different drivers, and will not affect each other directly, so it is convenient to expand. And libvirt provides programming interfaces in many languages, which can directly realize the operation of the virtual machine through programming and calling the external interface provided by libvirt.

In general, the setting of virtual network of virtual machine mainly includes three ways. The main points are as follows:

1.NAT mode

Some people call this mode host mode. In this mode, a virtual machine can be understood as not having its own independent network card. All requests to access the virtual machine are actually sent directly to the host and then forwarded to the virtual machine by accessing the host. When the corresponding virtual machine accesses other networks, it is also forwarded to the host and then forwarded out. For networks outside the host, the virtual machine is not known to exist.

If the network card of the host crashes, the virtual machine cannot communicate with the outside world.

2.Bridge mode

The bridging mode is to communicate between the host network card and the virtual network card of the virtual machine using the virtual bridge. Under the action of bridging, it is similar to virtualizing the physical host as a switch, all the virtual machines set by the bridge are connected to an interface of the switch, and the physical host is also plugged into this switch. therefore, all bridged network cards and network cards are in switching mode and can access each other without interference. In bridging mode, the virtual machine ip address needs to be on the same network segment as the host, and if it needs to be connected to the network, the gateway and DNS need to be the same as the host network card.

In the case of a single network card, if the host's network card crashes, then the virtual machine can not communicate with the outside world. Bond can be used to prevent it in production.

3.Internal mode

This is to separate the network between virtual machines and the network of hosts. The virtual machine is a network, and the host is also a network, which can not access each other.

Based on the above, there are two ways to create and manage virtual machines:

1.KVM Virtualization Technology-using Qemu-kvm to create and manage virtual machines

2.KVM Virtualization Technology-using virt-install and virsh and virt-manager

Thank you for your reading, these are the contents of "what are the differences between KVM, QEMU and libvirt". After the study of this article, I believe you have a deeper understanding of the difference between KVM, QEMU and libvirt, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report