193

On my Ubuntu 18.04, I've installed VirtualBox 6.0 in order to have nested virtualization. Virtualization is enabled in my bios.

However, when I open the settings of my (powered off) virtual machine and go to System -> Processor, the option "Enable Nested VT-x/AMD-V" is greyed out and I cannot enable it.

enter image description here

1
  • 1
    I even enabled this, but Docker-Desktop still complains! KVM is not enabled on host, see https://docs.docker.com/desktop/install/linux-install/#kvm-virtualization-support on how to configure it
    – Shayan
    Commented Apr 17 at 12:55

19 Answers 19

252

Execute this:

$ VBoxManage modifyvm <VirtualMachineName> --nested-hw-virt on
12
  • 17
    Although it seems unintuitive, this does work on an Intel Core i7 for me. Why wouldn't the option just be enabled in the UI? Commented Sep 24, 2019 at 11:45
  • 2
    Up to 6.0 this works "optically" but has no effect on the virtual machine (assuming an intel based host) Commented Oct 1, 2019 at 15:44
  • 6
    Just an opinion, use vm-name instead of virtualbox-name will be better.
    – Corey
    Commented Oct 16, 2019 at 1:05
  • 3
    it dose makes the button available, but the machine won't start, The native API dll was not found (C:\WINDOWS\system32\WinHvPlatform.dll) (VERR_NEM_NOT_AVAILABLE). Commented Dec 26, 2019 at 10:24
  • 21
    From Ticket : This behavior is actually a known issue for your kind of CPU. These models lack a certain feature called VMCS shadowing which improves nested HW virt performance tremendously, it will be terrible otherwise. That is the reason it is not available from the GUI. VBoxManage however is meant as a tool to even make VM config changes which can break the VM and it is assumed the user knows what he or she is doing. Thatswhy it is possible to enable it from VBoxManage but performance is expected to be abysmal. Commented Oct 9, 2020 at 15:38
157

For Windows

In Windows, go to VirtualBox installation folders -> type cmd on the bar (it will pop up cmd in that folder) -> type VBoxManage modifyvm <YourVirtualMachineName> --nested-hw-virt on -> enter.

Now the option should be checked.

7
  • 6
    This is exactly the same as the accepted answer (which was posted a week earlier). Commented Jun 29, 2020 at 13:51
  • 3
    anybody facing this issue while installing android emulator on one of the Vbox virtual machines should run this command.
    – ambassallo
    Commented Oct 3, 2020 at 16:11
  • 6
    Note that in PowerShell you have to write .\ if you trust the executable.
    – StickySli
    Commented Feb 23, 2021 at 20:47
  • 3
    Fabian Roling, yup it is. I'm just highlighting how to do it for Windows. Commented Mar 22, 2021 at 3:19
  • 1
    On a default installation, in command prompt you can type: cd "C:\Program Files\Oracle\VirtualBox" then press enter and then do the VboxManage Command
    – Bren1818
    Commented Dec 15, 2021 at 20:47
27

On VirtualBox 6.1.2 that worked (intel i7 2630QM)

(VBoxManage modifyvm lubuntu18 --nested-hw-virt on)

result on linux

enabled in GUI

4
  • 3
    Successfully replicated on VirtualBox v6.1.2 and on an i7-6880K Commented Jan 24, 2020 at 2:16
  • I have a VM with name "ubuntu 18.04.3" . When i execute the "VBoxManage modifyvm ubuntu 18.04.3 --nested-hw-virt on" command it is throwing a error "VBoxManage.exe: error: Could not find a registered machine named 'ubuntu'.. can anyone tell me how to escape space in windows 10
    – kart1657
    Commented Mar 12, 2020 at 15:15
  • @kart1657 this is caused by the space in your machine name, spaces are taken as arguments delimiters, so always put it between quotes Commented Jun 12, 2020 at 21:06
  • 1
    Success on Win10 virtualbox 6.1. Thanks
    – NetPlayer
    Commented Sep 22, 2020 at 21:02
24

From what I understand, this option is only available with AMD CPUs, and cannot be enabled on Intel CPUs. This is a little misleading, since the option clearly states both Intel, and AMD virtualization technologies.

Here is an official confirmation in VirtualBox doc: https://www.virtualbox.org/manual/ch03.html 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.

4
  • 7
    See this announcement: forums.virtualbox.org/viewtopic.php?f=15&t=94724 6.1 will have "support for nested hardware-virtualization on Intel CPUs (starting with 5th generation Core i, codename Broadwell)" Commented Oct 1, 2019 at 15:43
  • 4
    as of 6.1.0_BETA2, I'm still having "Enable Nested VT-x/AMD-V)" option grayed out on Intel Core i5 Coffee Lake (8259U) (MacbookPro 2018)
    – averasko
    Commented Oct 31, 2019 at 17:44
  • Still grayed out on v6.1.36 with 11th gen core i5
    – Ali Tou
    Commented Sep 5, 2022 at 2:36
  • I'm on Virtualbox v6.1.38 with an AMD Ryzen 7 CPU and it's still grayed out. Commented Sep 15, 2022 at 14:25
20

From Windows 10 onwards this problem can be caused by Memory Integrity. It is not active by default, so you may have activated it in the past.

Windows Security -> Device security -> Core isolation details enter image description here

Disable Memory integrity and then restart Windows.
The VB option "Enable Nested VT-x/AMD-V" should be still greyed out.
Now, open a new PowerShell in your VB installation folder and type:
./VBoxManage modifyvm "Virtual Machine Name" --nested-hw-virt on
You'll find detailed information here (idk why Microsoft does not mention this possible issue anywhere).

9

So far it only works with AMD CPUs (forget about the confusing option title).

Initially this is for AMD CPUs only.

All Intel CPU posts will be deleted/split.

https://forums.virtualbox.org/viewtopic.php?f=1&t=90831

https://forums.virtualbox.org/viewtopic.php?f=7&t=90874

1
  • 4
    Now (version 6.1 +) it also works with intel processors that support VT-x
    – Jamil Said
    Commented Apr 17, 2020 at 23:06
6

It turned out it was greyed out for a reason! I have Windows 10 host and I used Docker for some time and uninstalled but it kept Hyper-V technology enabled (Which is incompatible with virtualization).

DO NOT DO ON A SERVER | THIS WILL DISABLE Hyper-V Technology - USE AT YOUR OWN RISK

Open command prompt as admin and run the following then restart your PC

DISM /Online /Disable-Feature:Microsoft-Hyper-V

PowerShell Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor -All

bcdedit /set hypervisorlaunchtype off

1
  • 2
    Had to run the command PowerShell Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor -All without the -All parameter. Commented Feb 9, 2021 at 14:49
4

From the directory where VirtualBox is executed, I run a similar command that works (note the placement of the quotes!

VBoxManage modifyvm "path\to\ubuntu 18.04.3.vbox" --nested-hw-virt on

Hope this helps. BD

4

It's alive on VirtualBox 6.1.2 r135662 (Qt5.6.2) and Intel Core i3-8100!

Screenshot of available NestedVT

CMD's output from image as text:

C:\WINDOWS\system32>ssh [email protected]
[email protected]'s password:
Last login: Mon Feb 17 10:11:06 2020 from 192.168.56.1

myuser@nestedvt ~ $ su
Пароль:

root@nestedvt /home/myuser # egrep "svm|vmx" /proc/cpuinfo
root@nestedvt /home/myuser #

root@nestedvt /home/myuser # poweroff
Connection to 192.168.56.111 closed by remote host.
Connection to 192.168.56.111 closed.

C:\WINDOWS\system32>cd "C:\Program Files\Oracle\VirtualBox"
C:\Program Files\Oracle\VirtualBox>VBoxManage modifyvm CentOS7_nestedVT --nested-hw-virt on

C:\Program Files\Oracle\VirtualBox>VBoxManage startvm CentOS7_nestedVT
Waiting for VM "CentOS7_nestedVT" to power on...
VM "CentOS7_nestedVT" has been successfully started.

C:\Program Files\Oracle\VirtualBox>ssh [email protected]
[email protected]'s password:
Last login: Mon Feb 17 10:12:08 2020 from 192.168.56.1

myuser@nestedvt ~ $ su
Пароль:

root@nestedvt /home/myuser # egrep "svm|vmx" /proc/cpuinfo
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc eagerfpu pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single tpr_shadow flexpriority fsgsbase avx2 invpcid rdseed clflushopt md_clear flush_l1d
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc eagerfpu pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single tpr_shadow flexpriority fsgsbase avx2 invpcid rdseed clflushopt md_clear flush_l1d

root@nestedvt /home/myuser # exit
exit
myuser@nestedvt ~ $ exit
logout
Connection to 192.168.56.111 closed.

C:\Program Files\Oracle\VirtualBox>wmic cpu get name
Name
Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz

C:\Program Files\Oracle\VirtualBox>wmic os get caption
Caption
Microsoft Windows 10 Pro
5
  • 1
    Could you please add the output from your image as text? It would be more readable and searchable that way. Commented Feb 14, 2020 at 9:29
  • Thanks for this!
    – Max Pinto
    Commented Feb 14, 2020 at 16:16
  • 1
    @art-solopov No problem! Done!
    – alkomotiv
    Commented Feb 17, 2020 at 7:42
  • I have a VM with name "ubuntu 18.04.3" . When i execute the "VBoxManage modifyvm ubuntu 18.04.3 --nested-hw-virt on" command it is throwing a error "VBoxManage.exe: error: Could not find a registered machine named 'ubuntu'.. can anyone tell me how to escape space in windows 10
    – kart1657
    Commented Mar 12, 2020 at 15:11
  • The flag has been renamed to --hwvirtex now
    – kalligator
    Commented Apr 22, 2020 at 9:57
3

recently this popped up for me out of the blue on Windows 11. I already had hyper-v disabled from previous tweaks and everything had been working. in the end I had to use this command:

bcdedit /set hypervisorlaunchtype off

which fixed it, but it broke the Windows Subsystem for Android recently introduced in 11, so, there's that...

1
  • I guess Windows Subsystem for Android requires certain Hyper-v support. If you turn off hyper-v totally, subsystem for android might not work.
    – liginity
    Commented Nov 23, 2022 at 2:53
2

The cause of the problem is Hyper-V. If you want to use nseted virtualization, you should turn off hypervisorlaunchtype.
It's worked for me: bcdedit /set hypervisorlaunchtype off

2

There is an extra step required on Win 11 to completely disable Hyper-V. Nested virtualization will not work on VirtualBox on Win11 until you do this.

In addition to the settings required to disable Hyper-V on Win10:

On Win11 home go to Settings > Privacy & Security > Windows Security > Device Security > Core isolation > Core isolation details, and disable "Memory integrity" and reboot.

0

FYI,

Oracle VM VirtualBox supports nested virtualization on host systems that run AMD and Intel CPUs.
For more details, check: https://docs.oracle.com/en/virtualization/virtualbox/6.0/admin/nested-virt.html

0

Windows 11 has "Windows Sandbox" feature. If this feature is enabled it prevents VM to use VT-x extensions as well.

So, disable hyper-v and "windows sandbox" feature too.

This kind of solution, solves also the "BUG: soft lockup - CPU#1 stuck" error in the VM (Linux guest).

ac.

0

On Windows 10, I tried many solutions, but what ultimately solved the problem was disabling Hyper-V in the "Turn Windows features on or off" settings.

0

Just go to your {yourVM}.vbox file located at 'C:\Users\{youruser}\VirtualBox VMs\{yourVM}'

Open the .vbox file with notepad and add <NestedHWVirt enabled="true"/> inside the tag

enter image description here

-1

VBoxManage modifyvm --nested-hw-virt on this works..

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Nov 19, 2022 at 11:58
-1

Enable VT-x/AMD-V in Virtualbox from Windows host pc.

  • Open oracle virtual box installed folder location from cmd with administrator. cd C:\Program Files\Oracle\VirtualBox then run the command. VBoxManage modifyvm --nested-hw-virt on

  • is your vm name then enable nested VT-x/AMD-V in your virtual box

-2

The problem sometimes is your machine has saved its state, but the saved state is not the correct one, so you click on your machine and then on forget at the top to forget any saved state. In my case this solved the case

Not the answer you're looking for? Browse other questions tagged or ask your own question.