Show Table of Contents
12.2. Setup
Follow these steps to enable, configure, and start using nested virtualization:
- Enable: The feature is disabled by default. To enable it, use the following procedure on the L0 host physical machine.For Intel:
- Check whether nested virtualization is available on your host system.
$
cat /sys/module/kvm_intel/parameters/nestedIf this command returnsYor1, the feature is enabled.If the command returns0orN, use steps b and c. - Unload the
kvm_intelmodule:#
modprobe -r kvm_intel - Activate the nesting feature:
#
modprobe kvm_intel nested=1 - The nesting feature is now enabled only until the next reboot of the L0 host. To enable it permanently, add the following line to the
/etc/modprobe.d/kvm.conffile:options kvm_intel nested=1
For AMD:- Check whether nested virtualization is available on your system:
$
cat /sys/module/kvm_amd/parameters/nestedIf this command returnsYor1, the feature is enabled.If the command returns0orN, use steps b and c. - Unload the
kvm_amdmodule#
modprobe -r kvm_amd - Activate the nesting feature
#
modprobe kvm_amd nested=1 - The nesting feature is now enabled only until the next reboot of the L0 host. To enable it permanently, add the following line to the
/etc/modprobe.d/kvm.conffile:options kvm_amd nested=1
- Configure your L1 virtual machine for nested virtualization using one of the following methods:
- virt-manager
- Open the GUI of the intended guest and click the Show Virtual Hardware Details icon.
- Select the Processor menu, and in the Configuration section, type
host-passthroughin the Model field (do not use the drop-down selection), and click Apply.
- Domain XML
- Add the following line to the domain XML file of the guest:
<cpu mode='host-passthrough'/>
If the guest's XML configuration file already contains a<cpu>element, rewrite it.
- To start using nested virtualization, install an L2 guest within the L1 guest. To do this, follow the same procedure as when installing the L1 guest - see Chapter 3, Creating a Virtual Machine for more information.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.