142

issues:

Failed to open a session for the virtual machine ubuntu.

Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT).

Result Code: E_FAIL (0x80004005)
Component: ConsoleWrap
Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}

UPDATES: Solution is given below.

AKB
  • 5,918
  • 10
  • 53
  • 90
  • 1
    I have win 10 and intel core i7. It is working for me. I don't know why, but If you interested in any particular settings, I can have a look for you. So far I can see only one difference - I have "containers" enabled in "windows features". I don't think it is the reason though. When I got this problem all I did was going to Control Panel\Programs\Programs and Features\ and disabling tick boxes and it helped. I never run commands in cli. May it be the reason? – Yevgeniy Afanasyev May 01 '18 at 00:26
  • I upvoted your question because I see it is important. However it is bad set, I mean you asking few question in one post, it is confusing. Let me answer you question (4) in comment here: VM box Acceleration is deactivated when your Hyper-V is active or when your virtualisation disabled in BIOS. – Yevgeniy Afanasyev May 01 '18 at 00:33
  • I was struggling with that Hyper-V issue. The problem was I can't change Processor and acceleration settings and cannot run virtual OS. I tried deleting old virtual machines and created a new one. But nothing works. Hyper-V settings in my system under Windows Features is not listed. Virtualization in BIOS is enabled. Solution: Turn off 'Core Isolation' under Windows Defender Security Center. – Vikas Kumar Dec 27 '18 at 09:43
  • I have the same issue and I followed your steps. When I reach the last step, VM box Acceleration is active and all items are checked. Now, the vm starts, the error is not shown. Thanks :) – Günay Gültekin Aug 28 '19 at 06:00
  • Disabling Containers and Hyper-V worked for me. – greg Oct 20 '19 at 20:17

21 Answers21

219

You may need to disable the hypervisor.

So, follow the next steps:

1) Open command prompt as Administrator

2) Run bcdedit to check hypervisor status:

bcdedit

3) Check hypervisor launch type:

image showing command output with 'hypervisorlaunchtype Auto' marked

4) If is set to auto then disable it:

bcdedit /set hypervisorlaunchtype off

5) Reboot host machine and launch VirtualBox again

JMP
  • 4,417
  • 17
  • 30
  • 41
Fabricio
  • 3,248
  • 2
  • 16
  • 22
  • 17
    disabled it, but this doesn't help – Stepan Yakovenko Jul 30 '18 at 12:33
  • 3
    This did it for me (Windows 10 Home). Thank you so much. – clo5ure Jun 05 '19 at 20:45
  • 2
    This works in the sense that it solves the VirtualBox problem, but now Android Studio is unable to start an emulator, which was why I had to enable Hyper-V in the first place. I have a Ryzen 7 CPU, Windows 10 18936 (Insider Preview). – Violet Giraffe Aug 21 '19 at 19:12
  • Worked out to me when I converted the VM from VMware to VB. Thanks! – Maxiller Aug 27 '19 at 07:02
  • This solution worked for me, i had both hyper-v and sandbox enabled, disabled both and did this. – Ricardo Pimentel Oct 17 '19 at 18:17
  • It work for me too... but it cause issue for docker but since virtual box is priority for me I am good to go with this solution. Thank you. – Pandian Apr 29 '20 at 04:37
  • 1
    if in case you want to enable hyper V back run: `bcdedit /set hypervisorlaunchtype auto` – Nuryagdy Mustapayev May 30 '20 at 18:16
  • Initially the steps provided weren't working for me. But after doing more research on internet, I added one more step in between. Before disabling I enabled the auto mode and then restarting the laptop. Once again I disabled the hypervisorlaunchtype and restarted the laptop. Then it worked – Prashant Aug 24 '20 at 04:56
34

Disabling Device Guard or Credential Guard fixed for me:

  • click Start > Run, type gpedit.msc, and click Ok. The Local Group Policy Editor opens. Go to Local Computer Policy > Computer Configuration > Administrative Templates > System > Device Guard > Turn on Virtualization Based Security. Select Disabled.
  • Go to Control Panel > Uninstall a Program > Turn Windows features on or off to turn off Hyper-V.

Select. Do not restart.

Delete the related EFI variables by launching a command prompt on the host machine using an Administrator account and run these commands:

mountvol X: /s
copy %WINDIR%\System32\SecConfig.efi X:\EFI\Microsoft\Boot\SecConfig.efi /Y
bcdedit /create {0cb3b571-2f2e-4343-a879-d86a476d7215} /d "DebugTool" /application osloader
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} path "\EFI\Microsoft\Boot\SecConfig.efi"
bcdedit /set {bootmgr} bootsequence {0cb3b571-2f2e-4343-a879-d86a476d7215}
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} loadoptions DISABLE-LSA-ISO,DISABLE-VBS 
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} device partition=X:
mountvol X: /d

Note: Ensure X is an unused drive, else change to another drive.

Restart the host. Accept the prompt on the boot screen to disable Device Guard or Credential Guard.

Source: https://kb.vmware.com/s/article/2146361

Nikita R.
  • 7,245
  • 3
  • 51
  • 62
Ion Morozan
  • 783
  • 1
  • 9
  • 13
  • 1
    Running all those commands to change EFI variables was a missing step for me. Now virtualization works. – Mykhaylo Kopytonenko Jun 18 '19 at 11:49
  • Disabling the group policy + uninstall Hyper V work for me. I did not have to do the EFI related variables. – Faheem Aug 13 '19 at 15:11
  • If Secure Boot is active, only THIS solution works for me. Otherwise (if I do not delete EFI variables)....... the O.S. will not boot.So, be careful with the first solution on modern Windows 10 computers! – Filip OvertoneSinger Rydlo Sep 30 '19 at 11:24
22
  1. disabled Hyper-V (Control Panel\Programs\Programs and Features\ Hyper-V)

    enter image description here

  2. modify BCD (bcdedit /set hypervisorlaunchtype off)

    enter image description here

  3. If core isolation is enabled, turn it off (Windows Defender Security Center> Device Security> Core Quarantine)

    enter image description here

If you cannot modify it, you can change the value of HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ DeviceGuard \ Scenarios \ HypervisorEnforcedCode Integrity \ Enabled in the registry to 0

enter image description here

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
Loong Chen
  • 329
  • 1
  • 5
  • 1
    The registry key does not exist at least for me, even under ``HKLM/SYSTEM/CurrentControlSet/Control/DeviceGuard`` – Juha Untinen Aug 27 '18 at 07:26
  • 2
    Turing off core isolation was the trick that finally fixed the issue for me. I had tried the main suggestions such as bcdedit and uninstalling hyper-v. – Justin Apr 18 '19 at 00:31
  • This worked for me despite the screenshots in a different locale. – leeand00 Oct 23 '19 at 03:43
  • This worked, but step 1. is not necessary for me, as no Hyper-V item at all. – Nianliang Dec 01 '19 at 16:13
  • 1
    unchecking Hyper V and containers worked for me. Thanks for the solution – Tarun Reddy Apr 07 '20 at 15:55
  • This is great, I've failed to get Docker toolbox and VirtualBox running together for years on my current laptop. It's now working for the first time ... (Can't use Docker for Windows because I'm on Windows 10 Home). Btw @Loong Chen, why not edit for the full path so we can copy/paste into regedit: `Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity` – goamn May 10 '20 at 07:13
16

1) Run below command in powershell with admin mode:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

2) run below command in command prompt with admin mode:

bcdedit /set hypervisorlaunchtype off 

enter image description here

3) disabled Hyper-V: Control Panel\Programs\Programs and Features\ enter image description here

4) VMBox memory made it to: 3155 MB (VMbox->settings->system)

VM box Acceleration is deactivated. How do activate this? and fix above error? enter image description here

Restart your system.

AKB
  • 5,918
  • 10
  • 53
  • 90
11

To check the status of Hyper-v in Windows 10,

right click <"start"> → Run → OptionalFeatures.exe, → look for the "Hyper-V" option.

The box should be empty, not checked or shaded.

Make sure to fully power down and reboot the host after changing the Hyper-v setting.

PS

Docker known for activating this "Hyper-V" without asking for user opinion and then Oracle VirtualBox does not want to work.

Yevgeniy Afanasyev
  • 37,872
  • 26
  • 173
  • 191
11

Finally I can fix the issue now.

At first, we need to identify or understand the problem which mostly people not really findout, my VM is came with guest OS of Ubuntu 64-bits but after import, we check on that VM it shows only 32-bits OS.

When we start the VM, we got error as:

Failed to open a session for the virtual machine ERPNext-Develop-20180331192506.

Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT).

Result Code: E_FAIL (0x80004005)
Component: ConsoleWrap
Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}

I did try above solutions, somehow not really work or I might miss something.

Then I notice the point above (32-bits OS) so I think the problem might be with this one.

With some posts around the Internet, it could explain that Windows 10 also comes with the Hyper-V which is conflict with Oracle VM VirtualBox.

So solution I did...

1. Disable Virtualization Based Security in group policy

  • Start Run application and start: gpedit.msc
  • Go to Computer configuration > Administrative Template > Device Guard

enter image description here

  1. Disable Microsoft Hyper-V

    • Start Run application and start: OptionalFeatures.exe
    • Untick: Hyper-V
    • Restart the PC

enter image description here

Then we can use the VM, it's started. Among the two steps above, I believe that step 2 is really solved.

Anyway, please try it and let's know if it helps.

Osify
  • 2,253
  • 25
  • 42
11

I wanted learn how to use vagrant with virtualbox, when I got the error message 'Raw-mode is unavailable courtesy of Hyper-V'. To fix this issue, I think I made all of the suggested changes above (thank you guys), and some more.

Let me summarize:

( cmd: optionalfeatures )
Turn off 'Hyper-V'
Turn off 'Containers'
Turn off 'Windows Subsystem for Linux'

Turn off 'Hyper-V' and 'Containers' Turn off 'Windows Subsystem for Linux'

cmd: bcdedit /set hypervisorlaunchtype off

bcdedit hypervisorlaunchtype off

( cmd: gpedit.msc )
Local Computer Policy -> Computer Configuration -> Administrative Templates -> System -> Device Guard ->
Disable 'Turn On Virtualization Based Security'

Disable Virtualization Based Security

Settings -> Update & Security -> Windows Security -> Device Security -> Core isolation details -> Memory integrity -> Off

enter image description here

András Szabácsik
  • 1,957
  • 1
  • 16
  • 11
  • I had 'Turn on Virtualization based security' without a set value, so I don't know if helped that, or disabling containers, perhaps rather containers. Thanks. – FantomX1 Sep 03 '20 at 21:02
5

You need to disable the windows Hyper-V feature and bcd. Then Virtual Box will run in latest Windows 10 versions (Jan-Mar 2018). Windows 10 Hyper-V is having clash on VirtualBox features.

I have resolved this by following steps-

  1. bcdedit /set hypervisorlaunchtype off
  2. Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
  3. Restart your windows

Detailed discussion on this are available at - https://forums.virtualbox.org/viewtopic.php?f=6&t=87237

Alternatively you can install linux (Ubuntu) in Windows 10 from the latest bash command - https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10

Riddhi Sanyal
  • 433
  • 5
  • 7
  • changed this on my machine (2 put this info in powershell with admin rights) , but, after reboot, no effect at all, any other possibilities? – Mike Jul 02 '18 at 11:19
  • Concept is there can't be 2 Virtual box running in parallel. You have to disable the Windows 10 Hyper V, then only you can install & run another Virtual Box. Alternatively you can install ubuntu directly on windows 10 in bash mode. – Riddhi Sanyal Jul 04 '18 at 11:50
  • If running in cmd rather than powershell, the amended second command is `powershell -Command "Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All"` – ncoghlan Nov 02 '18 at 03:37
4

For me the combination of the following three was the solution:

1. control panel > turn windows features on or offf > Hyper-V : deselect

2. admin cmd > bcdedit > hypervisorlaunchtype:Auto disabling: bcdedit /set hypervisorlaunchtype off

3. gpedit.msc > 'Computer configuration > Administrative Template > System > Device Guard' > Turn On Virtualization Based Security : Change from 'Not configured' to 'Disabled'

REBOOT


note: after the reboot the VirtualBox worked, but Docker Desktop's VirtualBox started complaining about missing Hyper-V !

It seems that this might have been the root of all my evil... Extra info: https://forums.docker.com/t/running-docker-and-virtualbox-on-the-same-machine/23578/13

dstibbe
  • 1,589
  • 18
  • 33
3

You have to disable Memory Integrity.

Go to Device Security, then Core Isolation, disable Memory Integrity and reboot.

It seems that Memory Integrity virtualizes some processes (in this case, VMware) and we get that error.


You can also disable Memory Integrity from Registry Editor if your control panel was saying 'This is managed by your administrator'.

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity

Double click on Enabled and change its value from 1 to 0 to disable it.


Helpful source: https://forums.virtualbox.org/viewtopic.php?t=86977#p420584

Shafiq al-Shaar
  • 1,292
  • 14
  • 22
  • changed this on my machine, but, after reboot, no effect at all, any other possibilities? – Mike Jul 02 '18 at 11:17
  • @Mike There are many different answers in this question so I'm guessing this is a new issue. You have to think where Hyper-V related stuff might be acting out in your machine and then diagnose that section. – Shafiq al-Shaar Jul 03 '18 at 12:34
2

In my case, was the Docker that cause problems:

enter image description here

Diego Venâncio
  • 5,698
  • 2
  • 49
  • 68
1

After Windows 10 update in July of 2018 I suddenly experienced this issue with Virtual Box losing 64-Bit OS options resulting in the error.

virtualbox Raw-mode is unavailable courtesy of Hyper-V windows 10

Existing Laravel Homestead Boxes rendered un-bootable as a result event though HYPER-V is Disabled / Not Installed...

The FIX! (That worked for me) Drum Roll....

Install Hyper-V... Reboot, Uninstall it again... Reboot... The end

Marc
  • 5,109
  • 2
  • 32
  • 41
1

As in the docs, if you are on windows you can use hyperv drivers.

Docker for Windows - You can use docker-machine create with the hyperv driver to create additional local machines.

levismad
  • 13
  • 5
1

Run CMD in administrator mode 1.bcdedit 2.bcdedit /set hypervisorlaunchtype off 3.Reboot system

This worked for me!!

Niyas Ali
  • 203
  • 2
  • 9
1

The latest version of virtual box 6.0 supports HyperV ! https://docs.oracle.com/en/virtualization/virtualbox/6.0/admin/hyperv-support.html

Mathieu Seiler
  • 726
  • 8
  • 13
0

Mi helped: windows defender settings >> device security >> core insulation (details) >> Memory integrity >> Disable (OFF) SYSTEM RESTART !

0

Mi helped: windows defender settings >> device security >> core insulation (details) >> Memory integrity >> Disable (OFF) SYSTEM RESTART ! this solution is better for me

0

This would be the easiest way.

1) go and download the Device Guard and Credential Guard hardware readiness tool here- https://www.microsoft.com/en-us/download/details.aspx?id=53337

2) Find the folder path of "DG_Readiness_Tool_v3.5.ps1" of downloaded content and run the below command after enable Powershell "unrestricted". "./DG_Readiness_Tool_v3.5.ps1 -Disable -AutoReboot"

3) When rebooting the machine press F3 to confirm to disable the features

0

In my case, the problem was with the specific box I was trying to use ubuntu/xenial64, I just had to switch to centos/7 and all those errors disappeared.

Hope this helps someone.

anabeto93
  • 307
  • 3
  • 12
-1

I have exactly the same question and have done the same things as you with no success.

I found an entries in my log of

HM: HMR3Init: Falling back to raw-mode: VT-x is not available
VMSetError: F:\tinderbox\win-5.2\src\VBox\VMM\VMMR3\VM.cpp(361) int __cdecl 
VMR3Create(unsigned int,const struct VMM2USERMETHODS *,void (__cdecl *)(struct UVM *,void *,int,const char *,unsigned int,const char *,const char *,char *),void *,int (__cdecl *)(struct UVM *,struct VM *,void *),void *,struct VM **,struct UVM **); rc=VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT
00:00:05.088846 
VMSetError: Raw-mode is unavailable courtesy of Hyper-V. 00:00:05.089946 

ERROR [COM]: aRC=E_FAIL (0x80004005) aIID={872da645-4a9b-1727-bee2-5585105b9eed} aComponent={ConsoleWrap} aText={Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT)}, preserve=false aResultDetail=0 00:00:05.090271 Console: Machine state changed to 'PoweredOff'

My chip says it has VT-x and is on in the Bios but the log says not
HM: HMR3Init: Falling back to raw-mode: VT-x is not available I have a 6 month old Lenovo Yoga with 2.7-GHz Intel Core i7-7500U


I have tried the following, but it didn't work for me.

From this thread https://forums.virtualbox.org/viewtopic.php?t=77120#p383348 I tried disabling Device Guard but Windows wouldn't shut down so I reenabled it.

I used this path .... On the host operating system, click Start > Run, type gpedit.msc, and click Ok. The Local group Policy Editor opens. Go to Local Computer Policy > Computer Configuration > Administrative Templates > System > Device Guard > Turn on Virtualization Based Security. Select Disabled.

netchicken
  • 355
  • 2
  • 7
  • 20
  • Sorry, it is not clear from your answer, did you find a solution and what helped you? Please clarify. Thanks. – Yevgeniy Afanasyev May 01 '18 at 00:18
  • Sorry, I only listed some things that didn't work for me. They worked for other people. – netchicken May 01 '18 at 02:09
  • can you please change your answer to make it more clear what is the solutions? It is all right if it was not working for you, but make the steps clear. And abstract one solution from another, if you please. Thanks. – Yevgeniy Afanasyev May 01 '18 at 02:38
  • Like you I also did all things in this post and links, but keep getting the same error you've posted above. Somehow windows did not disable the Hyper-V machinery, but all properties are correctly set to switch it of and keep off after a reboot.. Any further inputs are welcome, did you get it to run in the meanwhile? – Mike Jul 02 '18 at 11:28
  • Very confusing answer. – Alexandre V. Nov 18 '19 at 11:49
-3

i had same problem guys

virtual box was running smoothly on my windows machine but when new update came virtual started giving me this error and believe me guys just a little S%$& thing fixed it

in my case this problem fixed just by installing windows extension pack that's it

  • 2
    Hi and welcome on SO @EvilPrince - it would really help if you could make your answer a bit more concise, and in your case explain the steps necessary to install the mentioned extension pack. – Patrick Hübl-Neschkudla Feb 18 '19 at 21:39
  • 1
    just download Oracle VM Virtual Box Extension pack from there website then first install virtual box and then just simply install extension pack Extension pack is supported to all platforms – EvilPrince Feb 19 '19 at 19:34