- Mastering KVM Virtualization
- Humble Devassy Chirammal Prasad Mukhedkar Anil Vettathu
- 418字
- 2021-07-14 10:27:39
Chapter 3. Setting Up Standalone KVM Virtualization
In the second chapter, you learned about KVM internals; now in this chapter, you will learn about how to set up your Linux server as a virtualization host. We are talking about using KVM for virtualization and libvirt as the virtualization management engine.
KVM enables virtualization and readies your server or workstation to host the virtual machines. In technical terms, KVM is a set of kernel modules for an x86 architecture hardware with virtualization extensions; when loaded, it converts a Linux server into a virtualization server (hypervisor). The loadable modules are kvm.ko
, which provides the core virtualization capabilities and a processor-specific module, kvm-intel.ko
or kvm-amd.ko
.
Note
According to https://en.wikipedia.org/wiki/Hypervisor. A hypervisor or virtual machine monitor (VMM) is a piece of computer software, firmware, or hardware that creates and runs virtual machines.
It is not enough to just load the KVM kernel modules to start your virtual machines. You need an emulator to emulate the hardware peripherals for your virtual machines. It is now time to introduce QEMU.
Quick Emulator (QEMU) is an open source machine emulator. This emulator will help you to run the operating systems that are designed to run one architecture on top of another one. For example, Qemu can run an OS created on the ARM platform on the x86 platform; however, there is a catch here. Since QEMU uses dynamic translation, which is a technique used to execute virtual machine instructions on the host machine, the VMs run slow.
If QEMU is slow, how can it run blazing fast KVM-based virtual machines at a near native speed? KVM developers thought about the problem and modified QEMU as a solution. This modified QEMU is called qemu-kvm
, which can interact with KVM modules directly and safely execute instructions from the VM directly on the CPU without using dynamic translations. In short, we use qemu-kvm
binary to run the KVM-based virtual machines.
It is getting more and more confusing, right? If qemu-kvm
can run a virtual machine, then why do you need to use libvirt
. The answer is simple, libvirt
manages qemu-kvm
and qemu-kvm
runs the KVM virtual machines.
Note
The qemu-kvm
binary is now deprecated and all of the codes in that are now merged with the qemu-system-x86_64
binary. For the purpose of understanding, we are using qemu-kvm
. Some Linux distributions still carry qemu-kvm
.
Without further ado, let us see what topics will be covered in this chapter:
- Introduction to libvirt
- libvirt management tools
- Hardware setup recommendations
- Linux運維之道(第3版)
- Designing Purpose:Built Drones for Ardupilot Pixhawk 2.1
- Ansible權威指南
- WindowsServer2012Hyper-V虛擬化部署與管理指南
- Windows Server 2012 Hyper-V Cookbook
- 嵌入式應用程序設計綜合教程(微課版)
- Extending Bootstrap
- STM32庫開發實戰指南:基于STM32F4
- RHCSARHCE 紅帽Linux認證學習指南(第7版)EX200 & EX300
- Hands-On UX Design for Developers
- Vim 8文本處理實戰
- Red Hat Enterprise Linux 6.4網絡操作系統詳解
- 電腦辦公(Windows 10 + Office 2016)入門與提高(超值版)
- Linux集群之美
- Learning Joomla! 3 Extension Development(Third Edition)