KVM (for kernel-based virtual machine) is a complete hardware virtualization solution for Linux based on the X86 architecture. It can run directly without modifying the Linux operating system and the Windows operating system. KVM is open source software and integrates the kernel after the Linux kernel 2.6.20.
Main premise of 0x01 Homestay
KVM virtualization requires support from hardware, such as Intel VT Technology or AMD V technology. First, check whether the CPU supports virtualization with the following command:
[[email protected]]# egrep ‘(vmx|svm)‘ /proc/cpuinfo
If executing the above command has output, then the CPU supports virtualization. If you do not have the first query CPU model, to see whether to provide the corresponding function, the current CPU is basically support VT, if there is no output, can enter the BIOS, generally in the CPU configuration can find Vt-x (CPU instruction virtualization) and vt-d (I/O communication virtualization), the E Nable.
If you are using VMware to build a test environment, then you need to locate the virtualization engine in the virtual machine settings, in the CPU settings, and then tick virtualized Intel vt-x or amd-v .
0x02 CENTOS7 Homestay Host configuration 1. Check the module
In addition to the previous hardware, KVM requires the support of the kernel module Kvm.ko and the module Kvm-intel.ko (Intel CPU) and Kvm-amd.ko (AMD CPUs) that provide the core virtualization infrastructure and the specific processor.
Check to see if the KVM module is loaded with the command:
[[email protected]]# lsmod | grep kvm
If there is a result output of Kvm-intel or KVM-AMD, it means that it has been successfully loaded, and if not, it needs to be loaded manually:
[[email protected]]# modprobe kvm-inter 或 kvm-amd
2. Install the Package
When the above conditions are met, the next step is to install the appropriate software package. The required packages are as follows:
* * QEMU-KVM libvirt vert-install Vert-manager vert-viewer
Can be installed directly from Yum * *:
[[email protected]]# yum install -y qemu-kvm libvirt vert-install vert-manager vert-viewer
You can also install the * * Virt-what virt-top * * Package if necessary.
Overview of the features of each package:
| Package name | Use |
| ------ |:---:|
| Libvirt | For managing virtual machines and providing a set of APIs |
| libvirt-client | Libvirt client, enable virtual machine to switch machine properly |
|libvirt-python | Providing APIs for Python |
|ipxe-roms-qemu| enabling the virtual machine to boot with PXE mode |
|qeme-kvm| KVM programs running in user space |
|qemu-img| operation of virtual machine hard disk creation and formatting |
|virt-viewer| Virtual Machine Console |
|virt-manager| Libvirt-based graphical management Tools |
|virt-install| command-line tools for installing virtual machines |
|virt-what| Viewing the platform the virtual machine is running on |
|virt-top| similar to the top command to view resources used by virtual machines |
3. Start of Service
The final step is to make sure that the LIBVIRTD service is started.
[[email protected]]# systemctl start libvirtd [[email protected]]# systemctl enable libvirtd
Now that the host configuration is complete, the next step is to start deploying the virtual machine via KVM.
Centos7 Installing KVM