KVM--kernel-based Virtual Machine

Source: Internet
Author: User
Tags svm egrep amd processors

1, Virtual machine type: Type 1 hardware directly installed HP

Type 2 hardware on the install host above run VMM

2. KVM Overview

KVM does not count type 1 and is not type two. Both features, he is a kernel module of Linux, the kernel itself does not have HV, when loaded with KVM, the kernel will become HV. At this point the hardware driver does not have to rely on others, the kernel itself can use these drivers.

When you have a HV, you need a management tool to create virtual machines and manage virtual machines.

Linux itself is running on the ring 0, when the KVM is loaded, KVM runs on the ring 0 to capture the privileged instructions, the kernel runs on the ring-1.

The IO device requires software emulation. But KVM does not emulate itself, only with another software, QEMU

3. Qemu

QEMU is a simulator that can manage and create a variety of devices

CPU: Emulator, Virtualization

QEMU (Virtualization software of type 2) Kqemu equivalent to QEMU's binary translation. QEMU has better performance at this time, but many bugs

At this point KVM appears, replacing the Kqemu, with Qemu better, when the core becomes HV, QEMU becomes a KVM console and a tool for managing IO devices

4. Using KVM
If you are using VM virtual machines, be aware that the hardware must support virtualization

Cat/proc/cpuinfo | Egrep ' VMX|SVM '
Modprobe KVM #装在kvm
Modprobe Kvm_intel | Kvm_amdlsmode | grep KVM #查看

/dev/kvm

Allocating memory to a virtual machine

Registers for read/write Vcpus

Want to inject the terminal with Vcpus

Run Vcpus

QEMU process,

Processor requirements: Requires an Intel processor that can run the latest Linux kernel (including VT virtualization) or AMD processors (AMD processors with SVM-safe virtual machine technology, also known as amd-V). You can use the following command to check: #egrep"(VMX|SVM)"color=always/proc/Cpuinfo or use the following command: #cat/proc/cpuinfo | Egrep'VMX|SVM " flags:fpu vme de PSE TSC MSR PAE MCE cx8 APIC Sep MTRR PGE MCA cmov Pat PSE36 clflush DTS ACPI MMX FXSR SSE SSE2 SS HT TM PBE Syscall NX PDPE1GB rdtscp lm constant_tsc Arch_perfmon pebs BTS rep_good xtopology nonstop_tsc aperfmperf PNI p  CLMULQDQ dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid DCA sse4_1 sse4_2 popcnt AES lahf_lm Ida Arat DTS Tpr_shadow Vnmi flexpriority ept vpidflags:fpu vme de PSE TSC MSR PAE MCE cx8 APIC Sep MTRR PGE MCA cmov Pat PSE36 CLFL Ush DTS ACPI MMX FXSR SSE SSE2 SS HT TM PBE syscall NX PDPE1GB rdtscp lm constant_tsc Arch_perfmon pebs BTS rep_good Xtopo Logy nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid DCA sse4_1 sse4_ 2 popcnt AES Lahf_lm ida Arat DTS Tpr_shadow vnmi flexpriority ept vpid There will be a bunch of such flags if the output result contains VMX, it is the Intel processor virtual machine technical flag; Contains SVM, it is the AMD processor virtual machine technology logo;. If you do not get anything, then your system does not support virtualization processing and cannot use KVM. In addition, the Linux distribution must be in a 64bit environment in order to use KVM. uname with Command-A view x86_64 that you are a 64-bit kernel, running a 64-bit system.
whether virtualization is supported

If hardware virtualization is not supported, it is not installed Kvm-intel or KVM-AMD, if it is a virtual machine to turn on virtual machine CPU virtualization on the premise that the physical CPU supports virtualization

Virtio Drive,

KVM Management Tool Station

1, Virsh

Virsh calls the underlying Libvirt library to implement the management virtual machine,

Virt-manager,virt-viewer These two are Virsh graphical tools.

Can manage Xen and KVM

2. Qemu

QEMU is also a management tool for managing virtual machines, and QEMU-KVM is the foundation for managing KVM

Virsh is relatively perfect, qemu is not perfect at present

3. View Virt Tools

Yum List all *virt*

CENTOS6 after Xen could not run in DOME0, Red Hat abandoned the Xen project to develop KVM, so this set of components only for KVM after CENTOS6, but the Xen source Libvirt is supported by KVM

KVM--kernel-based Virtual Machine

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.