Install KVM on CentOS

Source: Internet
Author: User
Tags svm egrep
I. preparation environment: 1. check whether the virtualization Centos6.2 _ x864KVM supports CPU (Intelvmx or AMDsvm). before installing KVM, check whether the CPU supports virtual technology: egrep & #39; ^ flags. * (vmx | svm) & #39;/proc/cpuinfo displayed. if displayed, the processor has V

I. prepare the environment:

1. check whether virtualization is supported

Centos6.2 _ x864

KVM requires CPU support (Intel vmx or AMD svm). check whether the CPU supports virtual technology before installing KVM:

Egrep '^ flags. * (vmx | svm)'/proc/cpuinfo
If there is a display, the processor has the VT function.

2. check whether BIOSS enables virtualization.

2. install KVM-related software

1. copy the configuration (check whether the yum configuration is normal)

Yum install kvm kmod-kvm qemu kvm-qemu-img virt-viewer virt-manager libvirt-python-kernel Inst

2. check whether the kvm module is installed.

[Root @ localhost ~] # Lsmod | grep kvm

Kvm_intel 55496 32

Kvm 337772 1 kvm_intel

3. start and start the service

/Etc/init. d/lib1_d

Chkconfig libmongod on

 

# The above is the installation of KVM, which is very simple. However, we need to install the system and occasional configurations through the desktop. Therefore, you need to install Gnome on the Server.

 

4. install the gonme desktop and configure the VNC desktop to connect to the virtual-server.

1. install virtual-server DESKTOP

Yum-y groupinstall "Gnome" "Desktop"

If the desktop is not installed, an error is reported when you log on to the server using svn:

2. install VNC-server software

Yum-y install vnc * vnc-server *

3. modify the VNCServer master configuration file

Vim/etc/sysconfig/vncservers

Jump to the end and remove the last and second line annotator, and then change

VNCSERVERS = "1: root"

4. use vncpasswd to set the VNC logon password

Enter the password twice.

[Root @ localhost ~] # Vncpasswd

Password:

Verify:

[Root @ localhost ~] #

After the password is set, a hidden directory starting with. vnc is generated in the root directory. the files under this directory are the root user's VNC desktop configuration file. Enable xstartup to configure the desktop

# Vim/root/. vnc/xstartup

Change the last line

Gnome & # This will enable gnome desktop

6. start the vncserver service and set it to start upon startup.

/Etc/init. d/vncserver start

Chkconfig vncserver on

7. connect to the virtual-server through the VNC client

Download a small VNC client, such:

Enter the IP address and port. This port was set when VNC-server was set!

The result is as follows:

5. configure bridging

After the installation is complete, the virtual machine can only communicate with the virtual machine in the virtual-server.

To communicate with external servers, it is easy to configure bridging.

Temporary:
Set a bridge Nic: KVM
# Set br0 and eth0 to bridge
Brctl addif br0 eth0
# Clearing eth0IP address
Ifconfig eth0 0.0.0.0
# Set br0 address
Ifconfig br0 192.168.7.241 255.255.252.0 up

Permanent:

Permanent settings
DEVICE = br0
ONBOOT = yes
BOOTPROTO = static
TYPE = Bridge
IPADDR = 192.168.9.47
NETMASK = 255.255.248.0
GATEWAY = 192.168.8.1


DEVICE = eth0
ONBOOT = yes
BOOTPROTO = static
TYPE = Ethernet
BRIDGE = br0

IPV6INIT = no

Note:

Note the following when setting in the Bridge Nic: TYPE = Bridge

Nic name to be specified for bridging in the House: BRIDGE = br0

Related Article

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.