Install the KVM virtualization environment in centos6.0

Source: Internet
Author: User
Tags connect socket

I. KVM Installation

Simple Method: Yum install KVM

Ii. Install and upgrade libvirt

(1) Yum install libvirt-Python-y

(2) The default version is 0.8.1, which has few functions and can be upgraded to the latest version.

Wget ftp://libvirt.org/libvirt/libvirt-0.9.4.tar.gz
Tar xzvf libvirt-0.9.4.tar.gz

CD libvirt-0.9.4

./Configure

Most of the following situations may occur. If you have installed some packages, you may not need to perform any operations.

1 GCC compiler Not Installed

Yum-y install GCC gcc-C ++

2 libxml2 xml2-config> = 2.6.0... configure: Error: cocould not find libxml2 anywhere (see config. log for details ).
Yum install libxml2-devel
// Yum install xml2-* this is not required

3 configure: Error: You must install the gnutls library in order to compile and run libvirt

Yum install gnutls-devel

4 configure: Error: You must install device-mapper-devel/libdevmapper> = 1.0.0 to compile libvirt
Yum install device-mapper-devel

5 you must install Python-devel to build Python bindings

Yum install Python-devel

6. Configure: Error: libnl-devel> = 1.1 is required for macvtap support

Yum install libnl-devel

So far./configure should be available. The lazy uses this yum install libxml2-devel gnutls-devel device-mapper-devel Python-devel libnl-devel-y

(3) make & make install

Restart libmongod

Service libmongod restart

An error may be reported:

1 error: failed to connect socket to '/usr/local/var/run/libvirt-Sock': no such file or directory
Link:
Ln-S/var/run/libvirt-Sock/usr/local/var/run/libvirt-sock

2 libvirt: Remote error: Unable to connect to '/usr/local/var/run/libvirt-sock-ro': no such file or directory"

Make another link
Ln-S/var/run/libvirt-sock-RO/usr/local/var/run/libvirt-sock-ro

Iii. server network configuration-bridging to facilitate communication between virtual machines

In the bridging mode, the network configuration of the Ubuntu virtual machine running on centos is used as an example.

CD/etc/sysconfig/network-Scripts

CP ifcfg-eth0 ifcfg-br0 // modified after Replication

Modify the ifcfg-eth0 to the following

Device = eth0

Hwaddr = 00: E0: 81: D2: 7A: F1 // depending on the actual situation

Onboot = Yes

Bridge = br0

Modify the ifcfg-br0 to the following

Device = br0

Type = Bridge

Bootproto = static

Ipaddr = 10.88.0.27

Netmask = 255.255.255.0

Gateway = 10.88.0.1

Onboot = Yes

Restart Network Service Network restart
If you have a dual-nic and you need to configure two IP addresses, you can use the same method to create a bridge for eth1.

 

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.