Virtualbox enable nested vtx/amd-v greyed out
Asked Answered
P

19

181

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

Parotitis answered 18/1, 2019 at 10:16 Comment(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 itIsolda
J
239

Execute this:

$ VBoxManage modifyvm <VirtualMachineName> --nested-hw-virt on
Jolinejoliotcurie answered 10/7, 2019 at 15:16 Comment(12)
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?Dread
Up to 6.0 this works "optically" but has no effect on the virtual machine (assuming an intel based host)Krimmer
Just an opinion, use vm-name instead of virtualbox-name will be better.Chlori
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).Stalk
I have windows 10, It is case sensitive, there is no message in the case of success. Thank you.Cancroid
@AbeHoffman it's an issue with virtualbox, see details: virtualbox.org/ticket/19245Orrin
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.Sycosis
"@Abe Hoffman" "Why wouldn't the option just be enabled in the UI?" -> This is an industry "rule of thumb", meaning "I have something here that works, but we want to avoid it being used for some reasons". See "@Mickaël Gauvin" coments.Berstine
To make sure that hardware virtualization extensions (Intel VT-X or AMD-V) are present on the CPU and enabled in the virtual machine BIOS you can use the following commands: lscpu | grep Virtualization (expected output is "Virtualization: VT-x") or egrep -c "(svm|vmx)" /proc/cpuinfo (expected output is "2"). Thanks! =DBerstine
On MacOS for check your CPU has VMX feature with command: sysctl -a | grep machdep.cpu.featuresLumbard
so I followed the same procedure, but the VM doesn't boot up unless I set the number of processors back to 1Canteen
I can confirm this worked for me. Used this exact command (1 line), nothing else! I'm running VirtualBox 7.0 on macOS Ventura 13.1.Pang
H
150

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.

Heterophony answered 27/7, 2019 at 6:29 Comment(7)
This is exactly the same as the accepted answer (which was posted a week earlier).Bibb
anybody facing this issue while installing android emulator on one of the Vbox virtual machines should run this command.Lipolysis
Note that in PowerShell you have to write .\ if you trust the executable.Checkered
Fabian Roling, yup it is. I'm just highlighting how to do it for Windows.Heterophony
On a default installation, in command prompt you can type: cd "C:\Program Files\Oracle\VirtualBox" then press enter and then do the VboxManage CommandChinaware
You can check the option by doing this but the feature will not work until you completely disable Hyper-V, which is the reason it's greyed out in the first place. In addition to the solutions to disable that on Win10, found on the internet, for Win11 home you also need to disable Memory Integrity. Once you do that the check box will not longer be greyed out and the feature will work as expected.Schmo
Can this be turned on by default on new VMs instead of running this on every creation?Commodore
K
27

On VirtualBox 6.1.2 that worked (intel i7 2630QM)

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

result on linux

enabled in GUI

Kuhn answered 23/1, 2020 at 20:43 Comment(4)
Successfully replicated on VirtualBox v6.1.2 and on an i7-6880KArron
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 10Cuzco
@Cuzco this is caused by the space in your machine name, spaces are taken as arguments delimiters, so always put it between quotesKuhn
Success on Win10 virtualbox 6.1. ThanksJerky
B
25

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.

Borlow answered 25/1, 2019 at 20:14 Comment(4)
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)"Krimmer
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)Prolate
Still grayed out on v6.1.36 with 11th gen core i5Supersession
I'm on Virtualbox v6.1.38 with an AMD Ryzen 7 CPU and it's still grayed out.Inhaler
O
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).

Overweening answered 21/6, 2021 at 18:40 Comment(0)
H
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

Hagar answered 22/3, 2019 at 9:10 Comment(1)
Now (version 6.1 +) it also works with intel processors that support VT-xBridesmaid
G
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

Grosmark answered 22/1, 2021 at 17:30 Comment(1)
Had to run the command PowerShell Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor -All without the -All parameter.Tomb
S
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
Seabrook answered 14/2, 2020 at 9:1 Comment(5)
Could you please add the output from your image as text? It would be more readable and searchable that way.Tibbetts
Thanks for this!Alviani
@Tibbetts No problem! Done!Seabrook
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 10Cuzco
The flag has been renamed to --hwvirtex nowBitternut
G
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...

Gamecock answered 25/1, 2022 at 15:36 Comment(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.Lash
N
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

Newman answered 21/3, 2020 at 3:58 Comment(0)
B
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

Benefaction answered 23/2, 2021 at 6:32 Comment(0)
S
1

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.

Schmo answered 5/3, 2023 at 17:32 Comment(0)
R
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

Rehm answered 16/9, 2022 at 22:9 Comment(0)
S
0

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

Shuping answered 16/11, 2022 at 18:49 Comment(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.Gurango
A
0

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

Afore answered 1/12, 2022 at 5:43 Comment(0)
E
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.

Endophyte answered 5/12, 2023 at 9:56 Comment(0)
F
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.

Feeling answered 28/1 at 12:27 Comment(0)
T
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

Trochelminth answered 3/3 at 18:20 Comment(0)
S
-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

Statis answered 9/5, 2021 at 10:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.