Build your KVM environment under CentOS 6.5

Source: Internet
Author: User
Tags virtual environment

first, operating system configuration
1. Log in with root privileges
2. Modify kernel mode to boot to a compatible kernel
Vim/boot/grub/grub.conf
Main changes Default=1

3. Turn off SELinux
Two ways: 1. Use the Setenforce 0 command: Immediately, after a reboot, fails.
2. Modify the configuration file, Vim/etc/selinux/config: After the restart to take effect.
Main changes selinux=disabled

Note: You can use the Getenforce command to view the SELinux status
4. Turn off the firewall
Service Iptables Stop
Chkconfig iptables off
Service Iptables Status

Second, the construction of virtual environment
1. See if the CPU supports full virtualization
Egrep ' (VMX|SVM) '/proc/cpuinfo
with display output, indicating support
2. Install the necessary installation packages

Install package Role
Qumu-kvm KVM Core Modules
Libvirt Virtual machine management tools, middleware for operation of virtual machines integrated with various interface library functions
Python-virtinst Record the XML file that created the VM
Bridge-utils Bridge Support Tools
Virt-viewer Graphical viewing capabilities
Virt-manager Install the graphical interface to manage virtual machines, Virt-manager the operation of virtual machines via Libvirt

Check that these packages are installed
Rpm-q QEMU-KVM libvirt python-virtinst virt-viewer virt-manager bridge-utils
Install these packages
Yum-y Install QEMU-KVM libvirt python-virtinst virt-viewer virt-manager bridge-utils
third, view the virtualized environment
1. Restart the Libvirt service:
Service LIBVIRTD Restart
2. View the virtualized environment:
Virsh-c Qemu:///system List

3. View KVM Module support: Lsmod | grep KVM

4. View the virtual Tools version:
Virsh–version
Virt-install–version
Ln-s/USR/LIBEXEC/QEMU-KVM/USR/BIN/QEMU-KVM
Qemu-kvm-version

Four, virtual bridge configuration
to enable KVM virtual machines to use the same network segment intranet, configure the virtual bridge
1. First close the NetworkManager (this service will invalidate the configuration)
Service NetworkManager Stop
Chkconfig NetworkManager off
Service NetworkManager Status
2. Create a network Bridge BR0

3. Modify network card file and bridge file
Nic file:

Bridge File:

4. Restart the Network Service
Service Network restart(must be after NetworkManager has been closed)
5. View network Information
Ifconfig

Brctl Show

The KVM environment is now complete
v. Construction of VNC
Remote visualization using the VNC tool
1. See if you have installed
Rpm-q VNC Vnc-server

2. Installing VNC
Yum-y Install VNC Vnc-server
3. Setting the VNC password
First: Vncserver
Then: vncpasswd, enter the password two times
Note:If you are not responding when using the Vncserver command or if you are not prompted to install it (I have encountered it anyway), install some packages using the Yum install *vncserver* command.
4. Modify the configuration file
To configure the desktop type:
Vim ~/.vnc/xstartup

Configure account, resolution, connection mode
Vim/etc/sysconfig/vncservers

5. Configure the firewall to allow VNC connections
The firewall has been closed at the beginning of this article.
If not, VNC server monitoring starts from 5900, and if the firewall is not allowed to connect to these ports by default, it needs to be configured in the firewall file.

Only 5901 ports are open for application account configuration.
Restart Firewall: Service iptables Restart (if the firewall is not set to shut down)
6. Set up service self-start
Chkconfig Vncserver on
7.windows Host Client VNC viewer

: 1 means 5901 ports.
This is the VNC setup.

Build your KVM environment under CentOS 6.5

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.