Categories
Linux VirtualBox

Enable Nested Virtualization for Ubuntu using VirtualBox on Windows

< 1 min read

There are many reasons you may want to enable nested virtualization. In my case, I want to install Minikube for running a single-node Kubernetes cluster in a virtual machine. For the example below, my host machine is running Windows 10 and VirtualBox 6.1. The guest OS has Ubuntu 20.04 installed.

Open a PowerShell prompt and change directories to your VirtualBox install folder. Note: the below path assumes VirtualBox is installed in the default location.

cd "C:\Program Files\Oracle\VirtualBox"

Run the below command which uses the VirtualBox CLI tools to enable nested virtualization. In the below example, the name of my VM is “Ubuntu Go”.

VBoxManage modifyvm "Ubuntu Go" --nested-hw-virt on

Nested virtualization should now be enabled and no longer greyed out in the VM settings.

Run the below command on your Linux guest to confirm virtualization is now supported:

grep -E --color 'vmx|svm' /proc/cpuinfo