Introduction and installation of Linux desktop virtualization technology KVM

Source: Internet
Author: User
Tags string format uuid

Introduction to KVM:

KVM, an open source system virtualization module, is integrated into the major distributions of Linux since Linux 2.6.20. It uses the Linux own scheduler import row management, therefore relative to Xen, its core source code is very few. KVM has become one of the mainstream VMM in academia today. KVM Virtualization requires hardware support (such as Intel VT Technology Ring AMD v technology). Is the complete virtualization of the hardware. The early stage of Xen is the para-virtualization of software simulation.

Linux kernel virtual machine (kernel-based). Is the first virtualization technology to integrate into a Linux kernel. In the KVM model, each virtual machine is a standard import that is managed by the Linux scheduler, and you can start the client operating system in user space.  

Introduction to common virtualization product comparisons

The most common virtualization on Vmware windows

KVM rhel6_x64

Xun [Kernel-xun] Rhel5


Virtualization Technology:

Emulation Virtualization [no hardware required, lowest performance]

Semi-virtualized [virtual machines can use physical real machines, high performance, need to change the kernel]

Full Virtualization


VMware support emulation Virtualization Xen semi-virtualized

REHL5 comes with Xen and needs to install the kernel during installation

RPM-IVH kernel-xen-xxx.rpm

KVM Full virtualization RHEL6 comes with KVM


Start installation

1. Tune the virtual machine memory to more than 2G because we want to install the KVM in VMware Virtual and then install the virtual machine in KVM

Installation Environment:

TD valign= "Middle" align= "center" colspan= "1" rowspan= "1" width= "231" >cpu number:
hostname: linux_rhel-7.2
Network mode: bridge
ip: 192.168.175.143
memory: 2g above
adjust
VM VMS turn on virtualization and virtualized CPU counters
2. Close the NetworkManager and start bridging

/etc/init.d/networkmanager shopchkconfig--level 2345 networkmanagerchkconfig--levle 2345 Network on

Configuring Eth0 and Bro NICs

Cd/etc/sysconfig/network-scritps/ls Vim Ifcfg-eth0

Delete the original configuration file modified to this:

Eth0 Network card:

Device=eth0

Type=ethernet

Bridge=br0

Bootproto=none

BR0 Network card:

Device=br0

Onboot=yes

Bootproto=dhcp

#IPADDR =192.168.175.99

#NETMASK =255.255.255.0

#GATEWAY =192.168.175.2

#DNS1 =8.8.8.8

Type=bridge

Name=br0

Service Network Restartifconfig # #查看是否eth0没有IP, Br0 gets the IP

3. Installing the KVM Component

Yum install-y KVM Virt-manager libvirt # # #安装service LIBVIRTD Start # # #开启KVMlsmod |grep KVM # # #查看KVM模块是否开启

If it is not shown to see if the KVM virtual machine is turned on virtualization


Viewing the operation of a virtual machine

Virsh List

Echo $LAGN the current string format

Modified format: Echo ' ZH_CN. UTF-8 '

If the Chinese format turned on the virtual machine error is modified to: Echo ' en_US. UTF-8 '

Turn on KVM

Virt-manager

Virtual Machine Related commands

Virsh start the new virtual machine name #启动虚拟机

Virsh shutdown the new virtual machine name #关闭虚拟机

solve the problem of shutdown not shutting down the KVM virtual machine:

Workaround: Install and start the ACPI service in the installed KVM Linux virtual machine

The Virsh shutdown command uses the Send ACPI LED order to control the power of the virtual machine.

While the KVM virtual machine minimizes the installed Linux system, the ACPI service is not installed by default,

So it doesn't work. Only need to install and start the Acpid service in the virtual machine.

Installation:

Yum Install Acpid-y

Service Acpid start//start Acpic Services

Chkconfig--list Acpid

Boot mount:

Vim/etc/fstab #记得设置开机自劢挂载 SDB1, otherwise the boot will not start the virtual machine

/dev/sdb1/var/lib/libvirt/images EXT4 Defaults 0 0

Query UUID:

Blkid automatically mounts via UUID to prevent disk position changes resulting in disk not being found:

Auto Mount:

Blkid | echo "' awk '/dev/sbd1 {print $} '/var/lib/libvirt/images ext4 defaults 0 0" >>/etc/fstab



This article is from the "13181770" blog, please be sure to keep this source http://13191770.blog.51cto.com/13181770/1956233

Introduction and installation of Linux desktop virtualization technology KVM

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.