quick-docs/modules/ROOT/pages/_partials/proc_enabling-nested-virtualization-in-kvm.adoc

57 lines
1.6 KiB
Text
Raw Normal View History

2018-01-02 15:18:48 +00:00
[[proc_enabling-nested-virtualization-in-kvm]]
2018-01-02 14:46:03 +00:00
= Enabling nested virtualization in KVM
2018-01-02 15:18:48 +00:00
Nested virtualization allows you to run a virtual machine (VM) inside another VM while still using hardware acceleration from the host.
== Checking if nested virtualization is supported
2018-01-02 15:18:48 +00:00
For Intel processors, check the `/sys/module/kvm_intel/parameters/nested` file. For AMD processors, check the `/sys/module/kvm_amd/parameters/nested` file. If you see `1` or `Y`, nested virtualization is supported; if you see `0` or `N`, nested virtualization is not supported.
For example:
2018-01-02 15:18:48 +00:00
----
2021-01-27 04:28:18 +00:00
cat /sys/module/kvm_intel/parameters/nested
Y
2018-01-02 15:18:48 +00:00
----
== Enabling nested virtualization
To enable nested virtualization for Intel processors:
2017-12-14 04:18:58 +00:00
. Shut down all running VMs and unload the `kvm_probe` module:
+
----
2021-01-27 04:28:18 +00:00
sudo modprobe -r kvm_intel
----
2017-12-14 04:18:58 +00:00
. Activate the nesting feature:
+
----
2021-01-27 04:28:18 +00:00
sudo modprobe kvm_intel nested=1
----
2018-01-02 14:46:03 +00:00
+
2017-12-14 04:18:58 +00:00
. Nested virtualization is enabled until the host is rebooted. To enable it permanently, add the following line to the `/etc/modprobe.d/kvm.conf` file:
+
----
options kvm_intel nested=1
----
To enable nested virtualization for AMD processors:
2017-12-14 04:18:58 +00:00
. Shut down all running VMs and unload the `kvm_amd` module:
+
----
2021-01-27 04:28:18 +00:00
sudo modprobe -r kvm_amd
----
2017-12-14 04:18:58 +00:00
. Activate the nesting feature:
+
----
2021-01-27 04:28:18 +00:00
sudo modprobe kvm_amd nested=1
----
2017-12-14 04:18:58 +00:00
. Nested virtualization is enabled until the host is rebooted. To enable it permanently, add the following line to the `/etc/modprobe.d/kvm.conf` file:
+
----
options kvm_amd nested=1
----