Nested virtualization is a feature that’s useful in some scenarios such as debugging hypervisors in a constrained environment and testing larger virtual deployments on a limited amount of physical resources. Nested virtualization is not recommended in production user environments, it is primarily intended for development and testing purposes. For Nested virtualization to work your XenServer/XCP-ng hosts needs to have virtualization extensions enabled.

$  cat /sys/hypervisor/properties/capabilities
xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64

In this guide we’ll show you how to enable nested virtualization on a Virtual Machine running in XenServer / XCP-ng Infrastructure. Follow these steps to enable, configure, and start using nested virtualization in Xen virtualization environment.

Enable Nested Virtualization on Xen | XCP-ng Virtual Machine using Xen Orchestra

Xen Orchestra is a user friendly administration tool for Xen Servers. It is designed to ease the administration time for your infrastructure. We can easily turn on Nested Virtualization for a Virtual Machine on Xen | XCP-ng Virtual Machine from Xen Orchestra console.

Login to Xen Orchestra Web interface.

Install Xen Orchestra Ubuntu Debian 01

If you don’t have Xen Orchestra check out our installation guide:

Deploy Xen Orchestra Appliance on Xen/XCP-ng from CLI

Select the Virtual Machine to enable Nested Virtualization from “Home” > “VMs” > “VM Name” and Stop the instance.

Enable Nested Virtualization Xen XCP ng 01

Then go to Advanced tab of the Virtual Machine.

Enable Nested Virtualization Xen XCP ng 02

Enable nested virtualization by toggling the switch to on.

Enable Nested Virtualization Xen XCP ng 03

Once done boot the VM machine.

Enable Nested Virtualization Xen XCP ng 04

Login to the instance and confirm whether nested virtualization is available on your host system.

$ cat /sys/module/kvm_intel/parameters/nested

If this command returns Y or 1, the feature is enabled.

More guides on XenServer | XCP-ng:

How To Create Internal Network in Xen | XCP-ng

Deploy Xen Orchestra Appliance on Xen/XCP-ng from CLI

Add and Use ISO Library Storage Repository in Xen XCP-ng

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here