Tuesday, May 14, 2013

Nested Virtualization -> KVM

Standard virtualization uses the physical machine Nested VMs as the host hypervisor which allows one to install virtual machines called guests. In nested virtualization the hypervisor is also a guest running inside a virtual environment and it can host its own virtual machines. Basically nested virtualization allows one to install a VM inside a VM.

All of this commands described below was tested in Fedora Core 18 x86_64 :

Check if 'nested' cpu is enabled :

# cat /sys/module/kvm_intel/parameters/nested
N


Make it persistent :

# systemctl stop libvirtd
# echo "options kvm_intel nested=y" > /etc/modprobe.d/virt.conf
# modprobe -r kvm_intel
# modprobe kvm_intel

# systemctl start libvirtd
# systemctl status libvirtd


libvirtd.service - Virtualization daemon
      Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
      Active: active (running)

      Main PID: 12920 (libvirtd)


# cat /sys/module/kvm_intel/parameters/nested
Y


Enabling 'vmx' flag in CPU directly in the xml VM file or using Virt-Manager >> CPU features  :

---------------------------------------------------------
<cpu match='exact'>
  <model>Westmere</model>
 <feature policy='require' name='vmx'/>
</cpu>

---------------------------------------------------------

Reference :

* https://github.com/torvalds/linux/blob/master/Documentation/virtual/kvm/nested-vmx.txt

No comments:

Post a Comment