8

I'm not able to Start any VMs in VirtualBox and getting this error:

Cannot enable nested VT-x/AMD-V without nested-paging and unrestricted guest execution! (VERR_CPUM_INVALID_HWVIRT_CONFIG).

I reinstalled latest VirtualBox and was same issue still exist.

Note that recently I did WSL2 installation by the following this official documentations so I thought the problem should be related to this installation, and decided to rollback some steps (not Uninstall WSL2 itself) to verify;

After all I found that "Step3: Enable Virtual MachinePlatform feature" was causing this problem:

Before installing WSL 2, you must enable the Virtual Machine Platform optional feature.

Open PowerShell as Administrator and run:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Restart your machine to complete the WSL install and update to WSL 2.

So I removed this feature and VM Start problem resolved, but after that WSL2 doesn't start now.

Now I'm stuck here what to do, I need both WSL & VMs to working while they are not happy with that feature to Disable or Enable for both.


OS: Windows-10 1909 (Build 18363.1139)

αғsнιη
  • 712
  • 2
  • 5
  • 22
  • So far as I know at this point, WSL is not a full fledged Linux operating system. If you really need nested Virtual Machines (I never have in some years of using virtual machines, try VMware Workstation Pro which does support nesting. Alternatively use multiple Virtual Machines to support your needs. I do the latter. – John Oct 15 '20 at 14:21
  • If you don’t really require WSL 2 you could also use WSL 1. You can freely convert a distribution between the two. – Daniel B Oct 15 '20 at 15:57
  • 2
    Seems like this has been fixed - [a combination of Microsoft providing a paravirtualization API and VirtualBox using it](https://www.how2shout.com/how-to/use-virtualbox-and-hyper-v-together-on-windows-10.html). Also [VMWare Workstation too](https://blogs.vmware.com/workstation/2020/05/vmware-workstation-now-supports-hyper-v-mode.html). – davidbak Feb 06 '21 at 04:34
  • @davidbak I have tried to start a VM on VBox when WSL2 is installed, now it's can start but it gets stuck at blank black screen with a rapid cursor blinking; per [this post](https://docs.microsoft.com/en-us/windows/wsl/wsl2-faq#will-i-be-able-to-run-wsl-2-and-other-3rd-party-virtualization-tools-such-as-vmware-or-virtualbox) seems they are working on a solution but sounds problem is not fully resolved yet. (OS: Win10 v20H2 b19042) – αғsнιη Feb 07 '21 at 16:51
  • Ahhh, nothing is ever as simple as the official documentation makes it seem ... – davidbak Feb 07 '21 at 16:59

1 Answers1

7

Update 2021-10-05: Now both WSL2 and VMs works fine on VirtualBox v6.1.26 r145957 (Qt5.6.2)/OS: Windows10 v20H2 b19042

Note 2021-11-22: If you decide to upgrade VirtualBox, noting that it doesn't work in v6.1.28 and it required to install Windows11.


Found that WSL2 is using Hyper-V technology for Linux Virtualization and to working WSL2 which enabling "Virtual Machine Platform" enables the Hyper-V, so it cause conflict with level-2 hypervisors like VirtualBox and unable to start VMs successfully.

by running this command in cmd (Run as Administrator) you could get the current value:

bcdedit.exe /enum {current} | find "hypervisorlaunchtype"

and to disable it either remove "Virtual Machine Platform" in Windows Optional-Features, or run this command:

dism.exe /online /disable-feature /featurename:VirtualMachinePlatform /all /norestart

or with this to disable the Hyper-V:

bcdedit.exe /set hypervisorlaunchtype off

Note: there is no way currently to have both VirtualBox and WSL2 working at the same time when Hyper-V is enabled, so by disabling Hyper-V, you will not able to open WSL2.

αғsнιη
  • 712
  • 2
  • 5
  • 22
  • Also, to point out.. this is nothing but Microsoft's fault. The driver Microsoft is using for virtualization (for Hyper-v) doesn't play well with other dirvers. VirtualBox / VMWare provide proof of this. – Señor CMasMas Oct 15 '20 at 16:37
  • Thanks for the update -- Microsoft and Oracle added nested virtualization support for this to work. Just a note that I believe this will currently only work with Intel CPUs. Those using AMD will likely need Windows 11, although I haven't had a chance to double-check if the feature (AMD nested virtualization support) made the final cut yet. I did hear that it had some issues in a recent build. – NotTheDr01ds Oct 05 '21 at 18:24
  • @NotTheDr01ds you are welcome! and yes, I have an Intel CPU system. – αғsнιη Oct 05 '21 at 18:30
  • This isn't working for me still. I'm on 6.1.26 on Windows 19043 and my Intel CPU definitely has VT-x. Is it really working for you? – user541686 Nov 19 '21 at 00:28
  • @user541686 yes, working, just installed a new VM instance yesterday without any issues too – αғsнιη Nov 19 '21 at 04:13
  • I see, thanks. Could I ask exactly what version of Windows you are on? Is it Windows 10 (not Windows 11)? And is it 20H2 or 21H1 or 21H2? Because on my machine I can get VirtualBox VMs to boot in both Windows 8.1 and Windows 11, but not in Windows 10 21H1 or 21H2, all under Hyper-V. – user541686 Nov 22 '21 at 01:09
  • @user541686 it's Windows10 v20H2 b19042 – αғsнιη Nov 22 '21 at 04:22
  • 1
    Ah I guess it must be the version then... they must've changed something in more recent versions. Be careful if you upgrade ;) thanks! – user541686 Nov 22 '21 at 05:31
  • but I will upgrade and test, all I'm using windows for testing something in it : ) – αғsнιη Nov 22 '21 at 06:02
  • @user541686 I just upgraded VBox to 6.1.28 (didn't perform Windows upgrade) and now I'm not able to start any VM and I encounter `Call to NEMR0InitVMPart2 failed: VERR_NEM_INIT_FAILED (VERR_NEM_VM_CREATE_FAILED).` error which it's due to enabled Hyper-V and should be disabled, so I will downgrade to VBox 6.1.26 – αғsнιη Nov 22 '21 at 16:04
  • @αғsнιη Yeah that one is a [different bug](https://forums.virtualbox.org/viewtopic.php?f=6&t=104175&p=507402#p507484), I'm guessing it'll work fine once you're back on 6.1.26 as long as you don't update Windows. – user541686 Nov 23 '21 at 05:45
  • @αғsнιη: It seems 6.1.30 (just released) "works" on both Windows 10 and 11 now. Unfortunately it doesn't seem to use nested paging, though, so it's incredibly slow. Do you see the green turtle icon on the bottom-right of the VM? When you hover on the CPU icon, does it say nested paging is enabled for you? – user541686 Nov 25 '21 at 10:28
  • @user541686 thanks for the update! I just destroyed my Windows instalation for freeBSD instalation, now, I think I will be on it for a couple of months and I will reinstall win10 later for that, but then I think I will not stay in Windows10 v20H2 b19042 anymore, I'm sorry. – αғsнιη Nov 26 '21 at 11:18
  • @αғsнιη: Ah okay I see, thanks! – user541686 Nov 26 '21 at 19:50
  • 1
    @user541686 yes, version 6.1.30 works too, and yes, nested paging is disabled and to enable it we still need to disable HyperV again. – αғsнιη Jan 21 '22 at 16:09
  • 1
    @αғsнιη: Ah, thanks for reporting back. Yeah. Doesn't sound like we'll be able to get fast Hyper-V working on Windows 10 with VirtualBox. – user541686 Jan 22 '22 at 01:17
  • It may work with some guests but definitely not all of them. MacOS guests don't seem to work. – Gábor Jan 29 '22 at 15:33