How to Enable Proxmoxve Nested Virtualization

How to enable Proxmox VE nested virtualization

To enable nested virtualization on Proxmox VE, we need to stop all the vm and enable nested virtualization to linux kernel. then change vm settings

Stop all the vm on proxmox VE

  • stop all virtual machines with shell command.
1
2
3
4
5
6
7
8
9
root@xa-sys-pve01:~# pvesh create /nodes/localhost/stopall
Stopping VM 116 (timeout = 180 seconds)
Stopping VM 115 (timeout = 180 seconds)
Stopping CT 112 (timeout = 60 seconds)
Stopping CT 111 (timeout = 60 seconds)
Stopping CT 108 (timeout = 60 seconds)
Stopping CT 106 (timeout = 60 seconds)
Stopping VM 101 (timeout = 180 seconds)
UPID:xa-sys-pve01:0036EA66:01992199:5CB98D6C:stopall::root@pam:
  • stop all the virtual machine with admin web.
1
bulk stop

Enable nested module in linux kernel

  1. Check nested support status
1
2
cat /sys/module/kvm_intel/parameters/nested
N
  1. enable nested support on.
1
2
3
4
5
#for intel cpu
echo "options kvm-intel nested=Y" > /etc/modprobe.d/kvm-intel.conf

#for amd cpu
echo "options kvm-amd nested=1" > /etc/modprobe.d/kvm-amd.conf
  1. Reload the kernel module.
1
2
modprobe -r kvm_intel
modprobe kvm_intel
  1. Check again.
1
2
cat /sys/module/kvm_intel/parameters/nested                    
Y

Change VM cpu type

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17

```bash
vi /etc/pve/qemu-server/xxx.conf
```
Add a args to the config file

``` vim
#intel cpu
args: -cpu host,+vmx

#amd cpu
args: -cpu host,+svm
```


## Reference
* [Nested Virtualization](https://pve.proxmox.com/wiki/Nested_Virtualization)
Licensed under CC BY-NC-SA 4.0
Last updated on Nov 08, 2024 12:49 UTC
Built with Hugo
Theme Stack designed by Jimmy