CentOS under KVM Trial
Recently tidied up the company's several servers, because the machine less application, always feel the server resource is tight, so the pain determined to use the virtual machine. Examined the decision to use KVM, because the machine configuration is not very high, the use of KVM performance will be better.
The basic system chooses CentOS5.4, the following lists the specific installation configuration process
Installing the CentOS operating system
Download CentOS5.4, installation is using the server mode, do not install any desktop, after all, the graphics desktop too much resources, in the selection of software to enable the following:
Development tools
Development Library
Virtualization--KVM
Virtualization--KVM At first I did not enable KVM because I wanted to compile the KVM on my own, and the result was always unsuccessful when loading the kernel KVM-AMD module!
After the installation is complete, first enable the kernel of the KVM-AMD module, if your machine is intel to change to Kvm-intel, the command is as follows
[Root@localhost ~]# modprobe KVM-AMD
If no errors are prompted to succeed, you can use Lsmod | grep KVM Check to see if the mount is successful, commands are as follows
[Root@localhost ~]# Lsmod | grep KVM kvm_amd 68648 1 KVM 223264 2 KSM,KVM_AMD
Seeing a similar output indicates that the KVM module was enabled successfully!
Compile and install KVM
The KVM version provided in CentOS's Yum source is too low, so I decided to compile the installation myself. First download the KVM source package, and then unzip the command as follows
[Root@localhost ~]# tar zxvf qemu-kvm-0.12.3.tar.gz
Next you start compiling, installing, and entering the unpacked directory, which commands the following:
[Root@localhost/]#./configure--prefix=/usr
[Root@localhost/]# make
[Root@localhost/]# make install
Compile quickly, basically a few seconds will be done, if there is no error, then congratulations! The KVM has been successfully installed!
KVM version currently the official highest version is 0.13.0, but I used to find that can not connect the virtual machine through the VNS, so I had to give up, using the 0.12.3 version of Everything normal.
Take care of the virtual Machine Network Bridge
The most important thing is to ensure that the network can be normal access, otherwise there is no meaning. Enable KVM Network Bridge to install two software bridge-utils and Tunctl. Bridge-utils can be installed using the Yum command as follows:
Yum Install Bridge-utils
Tunctl not found in the source, need to download the RPM package manual installation, the following command:
[Root@localhost/]# wget-c ' ftp://194.199.20.114/linux/EPEL/5Server/x86_64/tunctl-1.5-2.el5.x86_64.rpm '
[Root@localhost/]# RPM-IVH tunctl-1.5-2.el5.x86_64.rpm
Next, edit the Network Bridge profile, create a new shell file named vmbridge.sh, and use vim to edit the command as follows
[Root@localhost/]# Vim vmbridge.sh