How to Enable Nested Virtualization in VirtualBox on Linux

By default nested virtualization in Oracle VM VirtualBox on linux system is disabled. With the release of VirtualBox 6.1 we can enable nested virtualization on Intel CPUs starting with 5th generation Core i.

Prerequisites for VirtualBox Nested Virtualization:

  • VirtualBox Version 6.1 or higher
  • AMD CPU / Intel CPU ( Core i5 or higher)

In article we will demonstrate how to enable nested virtualization on Intel CPUs for VirtualBox VM on Linux.

Install / Upgrade VirtualBox to latest version

Note: You can Skip this step if already have VirtualBox 6.1 on your Linux system

At time of writing this article, latest version of VirtualBox is 6.1, so in case you are running an older version of virtualbox on system then run the following commands to install and upgrade it.

For Ubuntu / Debian

[email protected]:~$ wget -q -O- | sudo apt-key add -
[email protected]:~$ wget -q -O- | sudo apt-key add -
[email protected]:~$ sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) contrib"
[email protected]:~$ sudo apt-get update
[email protected]:~$ sudo apt-get install virtualbox-6.1 -y

If you get the following error message while starting or creating a VM after upgrading VirtualBox,,


To resolve this issue, execute the following commands

[email protected]:~$ sudo apt-get remove virtualbox-dkms -y
[email protected]:~$ sudo /sbin/vboxconfig

For CentOS / RHEL / Fedora

Create VirtualBox 6.x repo file with following contents,

[[email protected] ~]# vi /etc/yum.repos.d/virtualbox.repo
name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox

save and exit the file,

Run below Yum / DNF command to install virtualbox 6.1

[[email protected] ~]# yum install VirtualBox-6.1 -y
[[email protected] ~]# dnf install VirtualBox-6.1 -y

Note: In case on your Linux system, if VirtualBox 6 repository is already configured then skip the repository configuration part, You can directly install or upgrade virtualbox.

Enable Nested Virtualization for VirtualBox VM

Let’s suppose i have a centos vm on my virtualbox, i want to enable nested virtualization for this vm, before enabling it login to vm console and execute the following command,

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


Above command’s blank output confirms that nested virtualization is not enabled on centos vm.

Let’s power off this VM and enable VT-x /AMD-v , Select the VM for which you want to enable nested virtualization, then click on settings. Under the System Tab, select Processor and click on “Enable Nested VT-x/AMD-v” under the Extended Features Tab,


click on Ok to save the changes

In case “enable Nested VT-x/AMD-v” is greyed out then we can enable it via command line , execute the following command,

$ VBoxManage modifyvm  <VM-Name> –nested-hw-virt on

Example :

[email protected]:~$ VBoxManage modifyvm ubuntu18 --nested-hw-virt on

Now let’s verify from Centos VM whether nested virtualization is enabled or not, power on the VM and login to console and run following commands,

# egrep -E –color ‘svm|vmx’ /proc/cpuinfo
# lscpu


Output of above commands confirm that Nested Virtualization has been enabled on CentOS VirtualBox VM.

That’s all from this article, I hope this article was informative and you get better understanding on how to enable Nested VT-x / AMD-v feature on Oracle VM VirtualBox. Please don’t  hesitate to share your feedback and comments.

4 Responses

  1. Bruce Ferrell says:

    Here is an official confirmation in VirtualBox doc: ‘’ Chapter 3.5.2. Processor Tab

    Enable Nested VT-x/AMD-V: Enables nested virtualization, with passthrough of hardware virtualization functions to the guest VM.

    This feature is available on host systems that use an AMD CPU. For Intel CPUs, the option is grayed out.

    And I can confirm, it doesn’t work on Intel(R) Xeon(R) CPU E5540

  2. Sainster says:

    Hello I tried enabling the nested virtualization but got an error: “Cannot enable nested VT-x/AMD-V without nested-paging and unrestricted guest execution! (VERR_CPUM_INVALID_HWVIRT_CONFIG). Result Code: NS_ERROR_FAILURE (0x80004005) Component: ConsoleWrap Interface: IConsole {etc…}. Tried executing command you wrote with sudo and still it won’t open in VB. Any ideas? Thanks

    • Clark says:

      Perhaps this will solve your problem too.

      My host OS was Windows 10 (build 2004 – April 2020) that I was running VirtualBox on (as opposed to a Linux host in the article). I had this same error, “Cannot enable nested VT-x/AMD-V without nested-paging and unresricted guest execution!”.

      Then I found this thread: ‘’

      The problem I was having was that Windows Hyper-V was interfering with VirtualBox. Perhaps this can happen on other host OSes too where another hypervisor, like KVM, interferes with VirtualBox.

      My problem was fixed once I executed the following command and rebooted my Windows 10 host:

      Disable-WindowsOptionalFeature -online -FeatureName VirtualMachinePlatform

  3. Hasbullah Marwan says:

    i create vm in vbox to running docker, but its containers can’t ping outsite the world. i think it cause nested is disabled. but after i enable i have same problem

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest