KVM inside KVM

From ISPWiki
Revision as of 21:35, 20 October 2015 by Ksenya (talk | contribs)
Jump to: navigation, search

Intel processors

To be able to add guest machines in which kvm can be used, the following requirements should be met:

  • Linux kernel must contain specific parameters.

Centos 6:

Step 1: add the xen-c6 repo to your system
su -
cd /etc/yum.repos.d
wget http://dev.centos.org/centos/6/xen-c6/xen-c6.repo
yum repolist
Step 2: install the new kernel
su -
yum --enablerepo xen-c6 install kernel kernel-firmware
vi /boot/grub/grub.conf : add "kvm-intel.nested=1" to the end of the kernel line
verify proper operation: "cat /sys/module/kvm_intel/parameters/nested" will output "Y"
Original documentation.

Debian 7:

echo "options kvm-intel nested=1" > /etc/modprobe.d/kvm-intel.conf
verify proper operation: "cat /sys/module/kvm_intel/parameters/nested" will output "Y"
  • In the VMmanger configuration file specify:
CustomCPU core2duo
CustomCPUFeatures vmx

Once VMmanager is restarted, all new virtual machines will be created with required parameters.

Nested virtualization is not stable in kvm, the server may hang, that's why we recommend using it only for tests.