Create a nested virtual machine on AMD
To create an L2 nested virtual machine (VM) on an AMD host, you must enable and configure nested virtualization capabilities on both the L0 host and the L1 VM.
Before you begin
- An L0 RHEL 10 host running an L1 virtual machine (VM).
- The hypervisor CPU must support nested virtualization. To verify, use the
cat /proc/cpuinfocommand on the L0 hypervisor. If the output of the command includes thesvmandnptflags, creating L2 VMs is possible. This is generally the case on AMD EPYC cores and later. - Ensure that nested virtualization is enabled on the L0 host:
# cat /sys/module/kvm_amd/parameters/nested- If the command returns 1 or Y, the feature is enabled. Skip the remaining prerequisite steps, and continue with the Procedure section.
- If the command returns 0 or N, use the following steps to enable the feature.
- Stop all running VMs on the L0 host.
- Unload the
kvm_amdmodule:# modprobe -r kvm_amd - Activate the nesting feature:
# modprobe kvm_amd nested=1 - The nesting feature is now enabled, but only until the next reboot of the L0 host. To enable it permanently, add the following to the
/etc/modprobe.d/kvm.conffile:options kvm_amd nested=1
About this task
In most environments, nested virtualization is only available as a Technology Preview in RHEL 10.
For detailed descriptions of the supported and unsupported environments, see Support limitations for nested virtualization.
Procedure
-
Configure your L1 VM for nested virtualization.
- Create an L2 VM within the L1 VM. To do this, follow the same procedure as when creating the L1 VM.