69

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

Francesco Borzi
  • 37,945
  • 31
  • 126
  • 195

10 Answers10

110

Execute this:

$ VBoxManage modifyvm vm-name --nested-hw-virt on
Muhammad Hewedy
  • 26,344
  • 42
  • 116
  • 201
Sothy Lorn
  • 1,127
  • 1
  • 4
  • 3
  • 5
    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? – Abe Hoffman Sep 24 '19 at 11:45
  • Up to 6.0 this works "optically" but has no effect on the virtual machine (assuming an intel based host) – Marc Wittke Oct 01 '19 at 15:44
  • 3
    Just an opinion, use `vm-name` instead of `virtualbox-name` will be better. – Corey Oct 16 '19 at 01:05
  • 2
    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). – Michael Biniashvili Dec 26 '19 at 10:24
  • 1
    I have windows 10, It is case sensitive, there is no message in the case of success. Thank you. – Ivanzinho Jan 30 '20 at 13:08
  • @AbeHoffman it's an issue with virtualbox, see details: https://www.virtualbox.org/ticket/19245 – Achraf Amil Sep 16 '20 at 11:42
  • 6
    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. – Mickaël Gauvin Oct 09 '20 at 15:38
  • Great answer, solve my problem! – Benedito Marques Apr 17 '21 at 19:17
57

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 YourVirtualBoxName --nested-hw-virt on -> enter.

Now it should been ticked.

Fareed radzi
  • 613
  • 5
  • 4
22

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.

Community
  • 1
  • 1
Paul C.
  • 227
  • 1
  • 5
  • 5
    See this announcement: https://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)" – Marc Wittke Oct 01 '19 at 15:43
  • 2
    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 Oct 31 '19 at 17:44
16

On VirtualBox 6.1.2 that worked (intel i7 2630QM)

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

result on linux

enabled in GUI

Abdelouahab
  • 6,473
  • 10
  • 42
  • 78
  • 3
    Successfully replicated on VirtualBox v6.1.2 and on an i7-6880K – Manuel J. Diaz Jan 24 '20 at 02: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 Mar 12 '20 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 – Abdelouahab Jun 12 '20 at 21:06
  • Success on Win10 virtualbox 6.1. Thanks – NetPlayer Sep 22 '20 at 21:02
8

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

Community
  • 1
  • 1
Jing Li
  • 12,230
  • 4
  • 54
  • 66
2

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 myuser@192.168.56.111
myuser@192.168.56.111'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 myuser@192.168.56.111
myuser@192.168.56.111'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
alkomotiv
  • 21
  • 2
2

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

1

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

  • 2
    Had to run the command ```PowerShell Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor -All``` without the -All parameter. – Florian Falk Feb 09 '21 at 14:49
1

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

svyatis.lviv
  • 808
  • 6
  • 12
  • 18
kepich
  • 11
  • 4
-1

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

Lwahch
  • 1
  • 2