源网址:http://www.server-world.info/en/note?os=CentOS_6&p=kvm&f=13
Configure nested KVM. It's possible to install KVM and create virtual machines as nested KVM on KVM host.
KVM嵌套配置,可以在安装KVM后,在KVM主机中创建虚拟机实现KVM嵌套。
1、The Kernel of CentOS 6 is 2.6.32 and it does not support Nested KVM, so it's necessarry to update to supported Kernel for Nested KVM first.\
CentOS6是一个2.6.32版本的内核。它不支持KVM嵌套,因此在进行嵌套配置前,先硬升级内核到支持KVM嵌套版本。
在kernel行最后添加如下内容:
rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16
crashkernel=auto console=ttyS0,115200n8 rd_LVM_LV=VolGroup/lv_root
KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
[root@dlp ~]# cat /sys/module/kvm_intel/parameters/nested
Y
2、Make sure the CPU model on your computer.
检查你的计算机CPU型号
[root@dlp ~]#virsh capabilities | egrep "/model|/vendor"
<model>SandyBridge</model>
<model>dac</model>
3、Edit the configuration of a virtual machine you'd like to nest like follows. It's OK to configure nested KVM and you can create virtual machines on the virtual machine nested.
[root@dlp ~]#virsh edit www
<cpu mode='custom' match='exact'>
<feature policy='require' name='vmx'/>
</cpu>