CentOS Stream 10
Sponsored Link

KVM : Nested KVM2025/01/17

 

Configure Nested KVM.
It's possible to install KVM Hypervisor and Create virtual machines as nested KVM on KVM host.

[1] Enable Nested KVM setting. (enabled by default)
# confirm current setting

[root@dlp ~]#
cat /sys/module/kvm_intel/parameters/nested

Y     # enabled

[root@dlp ~]#
vi /etc/modprobe.d/kvm.conf
# if nested KVM is not enabled, uncomment either of the line
# for Intel CPU, select [kvm_intel], for AMD CPU, select [kvm_amd]
# For Intel
#options kvm_intel nested=1
#
# For AMD
#options kvm_amd nested=1

# unload

[root@dlp ~]#
modprobe -r kvm_intel
# reload

[root@dlp ~]#
modprobe kvm_intel
[2] Edit the configuration of a virtual machine you'd like to set nested like follows.
It's OK to configure nested KVM and you can create virtual machines on the virtual machine nested.
Refer to the details of CPU mode ⇒ https://libvirt.org/formatdomain.html#elementsCPU
# edit the settings of a VM

[root@dlp ~]#
virsh edit centos10
# specify [host-passthrough] for [cpu mode] section
# * [host-passthrough] is set by default

<cpu mode='
host-passthrough
' check='none' migratable='on'/'>
Matched Content