Linux Lake 020: Virtual Machine Experience KVM Chapter

Source: Internet
Author: User

In the previous article, I demonstrated the use, effects, and performance of the virtual machine software QEMU, as well as the different users ' quest for virtual machines. But whether it is desktop users or enterprise users, the pursuit of virtual machine software is a bit common, that is performance. QEMU is a powerful virtual machine software that simulates all the hardware required for a complete computer in the form of software, even the hardware that simulates different architectures, on which the complete operating system can be installed. The operating modes of QEMU are as follows:

It is clear that this form of software-based simulation of hardware is powerful, but performance is difficult to meet the needs of users. The performance of the simulated hardware and the performance of the physical hardware will inevitably be greatly compromised. To improve the performance of virtual machine software, developers are recount. Among them, the most common way is to open a hole in the main operating system through the kernel module, through this hole to map the operation of the virtual machine directly to the physical hardware, thereby improving the performance of the operating system running in the virtual machine. Such as:

KVM is a typical representation of this acceleration pattern. In the community, KVM and Xen are often compared, but they are totally different. As can be seen, the use of kernel modules to accelerate this mode, the main operating system is still dominant, the kernel module just open a hole in the main operating system, to connect the virtual machine and physical hardware, to the virtual machine, but the virtual machine in the guest operating system is still subject to great limitations. This model is more suitable for desktop users, the main operating system is still their battleground, whether it is the office or play games, all through the main operating system, the customer operating system is just on-demand use. As for Xen, the use of different concepts, more suitable for enterprise-class users, desktop users do not easily touch, specific content next I say.

In fact, VirtualBox is also taking this mode of kernel module acceleration. I say this because it will require the installation of dkms when installing VirtualBox. Such as:

Familiar with the Linux people know, dkms is to facilitate the user to manage the kernel module and exist, not familiar with dkms Google can also know a bit about. As for the specific use of VirtualBox, I'll talk about it in the next article. This article is mainly about KVM.

KVM and QEMU are mutually reinforcing, and qemu can use the KVM kernel module to accelerate, and KVM needs to run the virtual machine using QEMU. As you can see, if you want to install KVM using Ubuntu's package management software, the QEMU-KVM is actually installed. And QEMU-KVM is not a very complex package, it contains only a few files, such as:

Look at its documentation with the Man command and discover that the QEMU-KVM package not only contains very few files, but also that its executable KVM is just a simple wrapper for the qemu-system-x86_64 command, such as:

So the question is, which package does the KVM kernel module provide? In fact, since the start of Linux 2.6, KVM has been added to the kernel. If you do not want to find out which package the KVM kernel module Kvm.ko is provided by, you can look at it with the following command:

As you can see, the use of KVM is simple enough to write here. Below, I use KVM to run the WinXP operating system installed in the previous article and experience the efficiency of QEMU's KVM acceleration. Use the following command to run the QEMU with KVM acceleration:

As you can see, with KVM acceleration, the WinXP in the virtual machine is running a lot faster and it only took 34 seconds to boot. I adjusted the resolution to 1366*768, and the graphical interface ran smoothly, no matter whether I opened IE or office Office software, and no more CPU usage soared to 100%.

So to speak, if there is no VirtualBox, the QEMU+KVM combination should be the preferred choice for desktop users. I will try to virtualbox the next article.

(Jingshan Ranger in 2015-02-24 published in the blog Park, reproduced please indicate the source. )

Linux Lake 020: Virtual Machine Experience KVM Chapter

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.