- [root@rhel6 ~]# egrep "(vmx|svm)" --color=always /proc/cpuinfo
- flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt xsave avx lahf_lm arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
- [root@rhel6 ~]# yum install kvm virt-manager libvirt
- [root@rhel6 ~]# /etc/init.d/libvirtd start
- [root@rhel6 ~]# lsmod | grep kvm
- kvm_intel 50380 0
- kvm 305113 1 kvm_intel
- [root@rhel6 ~]# virsh -c qemu:///system list
- Id 名称 状态
- ----------------------------------
- [root@rhel6 ~]# cat /etc/sysconfig/network-scripts/ifcfg-br0
- DEVICE=br0
- BOOTPROTO=none
- ONBOOT=yes
- IPADDR=192.168.2.11
- NETMASK=255.255.255.0
- TYPE=Bridge
- [root@rhel6 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
- DEVICE=eth0
- ONBOOT=yes
- BRIDGE=br0
- BOOTPROTO=none
- TYPE=Ethernet
- [root@rhel6-2 ~]# vi /etc/inittab #在/etc/inittab文件末尾添加以下内容
- co:2345:respawn:/sbin/agetty ttyS0 115200
- [root@rhel6-2 ~]# vi /etc/securetty #在/etc/securetty文件末尾添加以下内容
- ttyS0
- [root@rhel6-2 ~]# vi /etc/grub.conf #在/etc/grub.conf文件添加内核参数
- kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=/dev/mapper/Lrhel6-root quiet rhgb console=ttyS0,115200
- [root@rhel6-2 ~]# reboot #重启系统使其生效
- [root@rhel6 ~]# virsh start rhel6-2 #开启rhel6-2虚拟机
- [root@rhel6 ~]# virsh console rhel6-2 #通过console连接到rhel6-2虚拟机
- [root@rhel6 ~]# virsh shutdown rhel6-2 #正常关闭rhel6-2虚拟机
- [root@rhel6 ~]# virsh destroy rhel6-2 #直接关闭rhel6-2虚拟机的电源