RedHat Enterprise Linux 6, the next-generation flagship product of RedHat, will only contain KVM, which has been officially confirmed by RedHat long ago and on different occasions, it can also be confirmed in Beta version RHEL 6. KVM has developed rapidly and its stability has been greatly improved. With the official arrival of RHEL 6, it is not long before KVM applications can be applied to the production environment. VPSee has tested KVM and has read some academic papers on KVM. KVM is inferior to Xen in terms of network performance, expansion, and stability. These factors are the key to VPS, so we seldom see kvm vps. I don't know if there will be more RHEL 6 in the future, at present, there are few KVM applications because of high hardware requirements (the CPU requires support from Intel VT or amd svm). The hardware development speed is very fast and this problem will not occur in the future. Because KVM supports full virtualization, you can install various operating systems on it, just like Xen HVM. In VPSee's view, KVM is more suitable for desktop and Xen is more suitable for Data Center Solutions. The following operations are completed on the SUN Fire X2100 server and CentOS 5.5. If you are interested in OpenVZ and Xen, install and configure OpenVZ and Xen on CentOS.
Check CPU
Unlike Xen, KVM requires CPU support (Intel VT or amd svm). Check whether the CPU supports Virtual Technology before installing KVM:
# Egrep 'vmx | svm '/proc/cpuinfo
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
Cmov pat limit 36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
Rdtscp lm 3 dnowext 3 dnow pni cx16 lahf_lm cmp_legacy svm
Extapic cr8_legacy
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
Cmov pat limit 36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
Rdtscp lm 3 dnowext 3 dnow pni cx16 lahf_lm cmp_legacy svm
Extapic cr8_legacy
Install KVM
Install the required software package for KVM:
# Yum install kvm kmod-kvm qemu kvm-qemu-img virt-viewer virt-manager \
Libvirt-python-virtinst
Or
# Yum groupinstall KVM
After the installation is complete, restart the system and check whether the installation is successful:
# Reboot
# Lsmod | grep kvm
Kvm_amd 69416 0
Kvm 226208 1 kvm_amd
# Ls-l/dev/kvm
Crw-rw ---- 1 root kvm 10,232 Jun 25/dev/kvm
Install Virtual Machine
Install freebsd7 with virt-install. Here we will install FreeBSD 8.0 as an example. For OS-variant, you can select freebsd7:
# Virt-install \
-- Name freebsd \
-- Ram 512 \
-- Vcpus = 1 \
-- Disk path =/home/vpsee/freebsd. img, size = 4 \
-- Network: default \
-- OS-variant = freebsd7 \
-- Accelerate \
-- Cdrom/home/vpsee/8.0-RELEASE-i386-disc1.iso \
-- Vnc
If you need more options and parameters for the virt-install command, you can view online help:
# Man virt-install
Use virt-viewer to open the installation interface for connecting FreeBSD on the console:
# Virt-viewer freebsd
You can also directly use virt-manager for graphical installation. The installation process is very simple. KVM does not have the Xen dom0 or domU concept, which is easier to understand and use, anyone who has used VMware and VirtualBox will be able to get started easily. Start the virt-manager graphic interface to create a virtual machine, create a hard disk, configure the memory network, and specify the installation disc iso. Step by step, you can perform the following operations:
# Virt-manager
Tips
After KVM and FreeBSD are installed, you can use the virsh command line tool to start, shut down, restart, and access the console to operate the virtual machine, just like using xm in Xen:
# Virsh -- connect qemu: // system
Start freebsd
Console freebsd
Quit
If you use Mac or Linux on the client and do not have tools such as vnc viewer, you can directly connect to the console where FreeBSD is being installed using ssh and X:
# Ssh-X-C root@172.16.20.1
# Virt-viewer freebsd