VirtualBox 6.0 and Hyper-V

Discussions related to using VirtualBox on Windows hosts.
Locked
BillG
Volunteer
Posts: 5102
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: VirtualBox 6.0 and Hyper-V

Post by BillG »

This all goes back to a questionable decision Microsoft made many years ago. Hyper-V was designed as a Windows Server product. (I was then a Windows MVP involved in the pre-release testing of Viridian for Server 2008, which became Hyper-V).

When Windows gave up on its Virtual PC project, it did not have a virtualiser for the client OS. Later on someone thought "Why not adapt Hyper-V to run in the client OS"? It has been downhill ever since, not only for third parties but also for virtualization in the Windows client OS itself. Hyper-V is simply not a good fit for the client OS.
Bill
kwinz
Posts: 10
Joined: 26. Jun 2019, 14:26

Re: VirtualBox 6.0 and Hyper-V

Post by kwinz »

BillG wrote:This all goes back to a questionable decision Microsoft made many years ago. Hyper-V was designed as a Windows Server product. (I was then a Windows MVP involved in the pre-release testing of Viridian for Server 2008, which became Hyper-V).

When Windows gave up on its Virtual PC project, it did not have a virtualiser for the client OS. Later on someone thought "Why not adapt Hyper-V to run in the client OS"? It has been downhill ever since, not only for third parties but also for virtualization in the Windows client OS itself. Hyper-V is simply not a good fit for the client OS.
That's odd because as a server project Hyper-V supports nested virtualization. On Intel only but there's a very popular future request to bring it to AMD https://windowsserver.uservoice.com/for ... er_page=20
And some guy named Bruce implies he works for MS and claims it will land this year: https://windowsserver.uservoice.com/use ... 7936-bruce
klaus
Oracle Corporation
Posts: 1133
Joined: 10. May 2007, 14:57

Re: VirtualBox 6.0 and Hyper-V

Post by klaus »

What the guy named Bruce is claiming is that Microsoft finally wants to get nested virtualization going for modern AMD CPUs, something they ignored for much too long. No change whatsoever for Intel CPUs, nested virtualization was working for years. Still it is just available to proper VMs, and never to the root partition (which is Microsoft's terminology for what others call "Dom0").
HF
Posts: 31
Joined: 3. Dec 2014, 01:01

Re: VirtualBox 6.0 and Hyper-V

Post by HF »

So, I've read all 18 pages of this topic. Does VirtualBox support running 64-bit guests with Hyper-V also running?

and if not, will it at some point?

Thanks
klaus
Oracle Corporation
Posts: 1133
Joined: 10. May 2007, 14:57

Re: VirtualBox 6.0 and Hyper-V

Post by klaus »

Yes, it does. If Hyper-V is properly installed (some people report issues that the necessary libraries are either missing or incomplete). Expect quite a performance hit compared to VirtualBox natively on the same hardware.
HF wrote:So, I've read all 18 pages of this topic. Does VirtualBox support running 64-bit guests with Hyper-V also running?

and if not, will it at some point?

Thanks
HF
Posts: 31
Joined: 3. Dec 2014, 01:01

Re: VirtualBox 6.0 and Hyper-V

Post by HF »

Klaus, I've seen that working for 32-bit guests, but not for 64-bit guests. I'm using an Intel Xeon processor and the VirtualBox always errors out with the no VT-x message.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: VirtualBox 6.0 and Hyper-V

Post by mpack »

HF wrote:Klaus, I've seen that working for 32-bit guests, but not for 64-bit guests. I'm using an Intel Xeon processor and the VirtualBox always errors out with the no VT-x message.
There should be no real distinction any more, with VirtualBox 6.x 32-bit guests have the exact same requirements as 64-bit ones, i.e. everything requires VT-x/AMD-v.

p.s. I appreciate that there's a growing consensus that 32-bit guests run better under Hyper-v, but I can't see why that would be the case. It's the exact same environment, just the CPU running inside a 32bit code page as it sometimes does even if the OS is 64bit.
HF
Posts: 31
Joined: 3. Dec 2014, 01:01

Re: VirtualBox 6.0 and Hyper-V

Post by HF »

mpack wrote:
HF wrote:Klaus, I've seen that working for 32-bit guests, but not for 64-bit guests. I'm using an Intel Xeon processor and the VirtualBox always errors out with the no VT-x message.
There should be no real distinction any more, with VirtualBox 6.x, 32-bit guests have the exact same requirements as 64-bit ones, i.e. everything requires VT-x/AMD-v.

p.s. I appreciate that there's a growing consensus that 32-bit guests run better under Hyper-v, but I can't see why that would be the case. It's the exact same environment, just the CPU running inside a 32bit code page as it sometimes does even if the OS is 64bit.
I only use 64-bit ones now and it sounds like VirtualBox is expected to work with 64-bit guests on a Windows Hyper-V box. What could be causing the VT-x error I'm seeing? It is enabled in the BIOS.

Thanks
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VirtualBox 6.0 and Hyper-V

Post by scottgus1 »

HF, forgive my questionable re-reading of the thread, but did you actually post anywhere what error you're getting?

Please make a new topic and post the error and circumstances, and a zipped guest vbox.log, so we don't clog this thread with individual problems.
caspertone
Posts: 54
Joined: 2. Apr 2014, 10:27

Re: VirtualBox 6.0 and Hyper-V

Post by caspertone »

Help, confused on this again...

happy user of VBox 6.1.6, PC Bios with VT-x enable, Windows 10 1909 815 x64 host (intel) , Windows 10 1909 815 x64 guest.
I had followed all chores to have vt-x working ok as per viewtopic.php?f=6&t=93260
VM has ok the crosses in Enable PAE
VM working sweet.

But... enable nested vt-x is not selectable.


Y ensured that all items related to Guards, Hyper etc are disabled. Several reboots. But... enable nested vtx box... stays grayed.

Has 6.1.6 removed again nested VT-X in Intel hosts? (not seen anything in changelog...)

TIA

===== some info:

C:\WINDOWS\system32>dism.exe /Online /Get-Features

HypervisorPlatform
off (translated from foreing language meaning non-habilitated)

VirtualMachinePlatform
off

Containers-DisposableClientVM
off

Microsoft-Hyper-V-All
off

Microsoft-Hyper-V
off

Microsoft-Hyper-V-Tools-All
off

Microsoft-Hyper-V-Management-PowerShell
off

Microsoft-Hyper-V-Hypervisor
off

Microsoft-Hyper-V-Services
off

Microsoft-Hyper-V-Management-Clients
off

Windows-Defender-ApplicationGuard
off

Containers
off

C:\WINDOWS\system32>dism.exe /Online /Disable-Feature:HyperVisorPlatform
[==========================100.0%==========================]

C:\WINDOWS\system32>dism.exe /Online /Disable-Feature:VirtualMachinePlatform
[==========================100.0%==========================]
klaus
Oracle Corporation
Posts: 1133
Joined: 10. May 2007, 14:57

Re: VirtualBox 6.0 and Hyper-V

Post by klaus »

caspertone wrote:happy user of VBox 6.1.6, PC Bios with VT-x enable, Windows 10 1909 815 x64 host (intel) , Windows 10 1909 815 x64 guest.
I had followed all chores to have vt-x working ok as per viewtopic.php?f=6&t=93260
VM has ok the crosses in Enable PAE
VM working sweet.

But... enable nested vt-x is not selectable.
You really need to provide the key information for troubleshooting more or less any unexpected behavior of VMs: VBox.log from a VM where the issue happens. There is lots of information included about CPU features and other reasons which would explain such an issue.

Keep in mind that you might actually have working VT-x (the setting for this has disappeared in 6.1, because it only supports hardware virtualization), and still have a CPU which is too old to support nested VT-x with sensible performance. The log would allow to tell.
WillFC
Posts: 4
Joined: 5. May 2020, 16:55

Re: VirtualBox 6.0 and Hyper-V

Post by WillFC »

I have a new install of VirtualBox 6.1.6 and seem to be encountering Hyper-V related issues which won't allow me to run any VMs. Some background: this is a new work HP laptop with a Ryzen 2700U CPU. It's pretty locked-down by corporate IT, and while I'm allowed to install VBox, getting any kind of support from those IT guys will be pretty hopeless.

It looks like the policy and software on this thing are using Hyper-V - as a specific example, Credential Guard is enabled by Group Policy - so my only hope will be to get VBox running via Windows Hypervisor Platform. Since I'm only looking to install some non-desktop Linux VMs, I'm not too worried about the lowered performance.

Under Windows Features, I have both Hyper-V and Windows Hypervisor Platform enabled. SVM CPU Virtualization is enabled in the BIOS. But no matter what kind of VM I try to start in VBox - Win10, RHEL, 32-bit, 64-bit - I get the following error:

Code: Select all

Failed to open a session for the virtual machine test vm.

VMMR0_DO_NEM_INIT_VM failed: VERR_NEM_MISSING_KERNEL_API_2 (VERR_NEM_MISSING_KERNEL_API_2).

AMD-V is not available (VERR_SVM_NO_SVM).

Result Code: E_FAIL (0x80004005)
Component: ConsoleWrap
Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
Some snippets from the Log Viewer:

Code: Select all

00:00:02.750465 ********************* End of CFGM dump **********************
00:00:02.750550 HM: HMR3Init: Attempting fall back to NEM: AMD-V is not available
00:00:02.803021 NEM: WHvCapabilityCodeHypervisorPresent is TRUE, so this might work...
<snip>
00:00:02.803453 NEM: Warning! Unknown CPU features: 0x46cb66f39fbf
00:00:02.803467 NEM: WHvCapabilityCodeProcessorClFlushSize = 2^8
00:00:02.803854 NEM: Warning! Unknown capability 0x1003 returning: 1f 38 00 00 00 00 00 00
00:00:02.804814 NEM: VidGetHvPartitionId            -> fun:0x2210a7 in:0x0 out:0x8
00:00:02.804835 NEM: VidStartVirtualProcessor       -> fun:0x221174 in:0x4 out:0x0
00:00:02.804843 NEM: VidStopVirtualProcessor        -> fun:0x221180 in:0x4 out:0x0
00:00:02.804853 NEM: VidMessageSlotHandleAndGetNext -> fun:0x2210df in:0x8 out:0x0
00:00:02.804954 VMSetError: F:\tinderbox\win-6.1\src\VBox\VMM\VMMR3\NEMR3Native-win.cpp(1301) int __cdecl nemR3NativeInit(struct VM *,bool,bool); rc=VERR_NEM_MISSING_KERNEL_API_2
00:00:02.804957 VMSetError: VMMR0_DO_NEM_INIT_VM failed: VERR_NEM_MISSING_KERNEL_API_2
00:00:02.804979 NEM: NEMR3Init: Native init failed: VERR_NEM_MISSING_KERNEL_API_2.
00:00:02.804991 VMSetError: F:\tinderbox\win-6.1\src\VBox\VMM\VMMR3\HM.cpp(622) int __cdecl HMR3Init(struct VM *); rc=VERR_SVM_NO_SVM
00:00:02.804997 VMSetError: AMD-V is not available
That error VERR_NEM_MISSING_KERNEL_API_2 seems to be the key, but I can't find any info on it.

I also tried the trick upthread of running

Code: Select all

VBoxManage setextradata "<VM Name>" "VBoxInternal/NEM/UseRing0Runloop" 0
but no change.

Any ideas, or am I out of luck?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: VirtualBox 6.0 and Hyper-V

Post by scottgus1 »

WillFC, I have a 64bit host, but can't install 64bit guests

This error is becuase Hyper-V is interfering, which is strongly implied by:
WillFC wrote:I have both Hyper-V and Windows Hypervisor Platform enabled
and confirmed by
00:00:02.750550 HM: HMR3Init: Attempting fall back to NEM: AMD-V is not available
00:00:02.803021 NEM: WHvCapabilityCodeHypervisorPresent is TRUE, so this might work...
Hyper-V (or KVM on Linux hosts) doesn't play well with Virtualbox yet. The devs are working on it, but it's not there yet.

To turn Hyper-V off completely, do this:

1. Shut down all programs. You will have to reboot your host.

2. Look into the 64-bits tutorial below, 2nd post, points 2 & 3 and ensure that none of these things are running.

3. Find the Command Prompt icon, right click it and choose Run As Administrator.

4. Enter this command:
bcdedit /set hypervisorlaunchtype off
5. Enter this command:
shutdown -s -t 2
6. When the computer turns off, unplug it for 20 seconds. Then plug it in again and boot up Windows 10.

If you are unable to get IT (or make a good-enough case to your boss to get IT) to turn these settings off, then you can't run Virtualbox on that PC, yet.
WillFC
Posts: 4
Joined: 5. May 2020, 16:55

Re: VirtualBox 6.0 and Hyper-V

Post by WillFC »

scottgus1 wrote:WillFC, I have a 64bit host, but can't install 64bit guests

This error is becuase Hyper-V is interfering, which is strongly implied by:
WillFC wrote:I have both Hyper-V and Windows Hypervisor Platform enabled
and confirmed by
00:00:02.750550 HM: HMR3Init: Attempting fall back to NEM: AMD-V is not available
00:00:02.803021 NEM: WHvCapabilityCodeHypervisorPresent is TRUE, so this might work...
Hyper-V (or KVM on Linux hosts) doesn't play well with Virtualbox yet. The devs are working on it, but it's not there yet.
Right I saw that post, including the note at the end:
If Hyper-V cannot be disabled, e.g. due to company policy, then VirtualBox v6.x has a new ability to run via the Windows Hypervisor Platform, however Windows 10 (1809) or later is required, the feature still has bugs (as of VirtualBox 6.0.8), and it currently causes a significant drop in VM performance.
This is what I'm trying to accomplish.
klaus
Oracle Corporation
Posts: 1133
Joined: 10. May 2007, 14:57

Re: VirtualBox 6.0 and Hyper-V

Post by klaus »

WillFC wrote:I have a new install of VirtualBox 6.1.6 and seem to be encountering Hyper-V related issues which won't allow me to run any VMs. Some background: this is a new work HP laptop with a Ryzen 2700U CPU. It's pretty locked-down by corporate IT, and while I'm allowed to install VBox, getting any kind of support from those IT guys will be pretty hopeless.

It looks like the policy and software on this thing are using Hyper-V - as a specific example, Credential Guard is enabled by Group Policy - so my only hope will be to get VBox running via Windows Hypervisor Platform. Since I'm only looking to install some non-desktop Linux VMs, I'm not too worried about the lowered performance.

Under Windows Features, I have both Hyper-V and Windows Hypervisor Platform enabled. SVM CPU Virtualization is enabled in the BIOS. But no matter what kind of VM I try to start in VBox - Win10, RHEL, 32-bit, 64-bit - I get the following error:

Code: Select all

Failed to open a session for the virtual machine test vm.

VMMR0_DO_NEM_INIT_VM failed: VERR_NEM_MISSING_KERNEL_API_2 (VERR_NEM_MISSING_KERNEL_API_2).

AMD-V is not available (VERR_SVM_NO_SVM).

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

I also tried the trick upthread of running

Code: Select all

VBoxManage setextradata "<VM Name>" "VBoxInternal/NEM/UseRing0Runloop" 0
but no change.

Any ideas, or am I out of luck?
Could you please provide the complete VBox.log file? It would tell us a lot, e.g. the exact Windows 10 build and many more details which are relevant in this context. The

Code: Select all

setextradata
tweak is no longer needed with 6.1.6.

Which also contains some changes to allow us to track down what exactly is going wrong. VERR_NEM_MISSING_KERNEL_API_2 means that winhvr.sys is missing. Not sure why this has to be fatal, when the kernel parts are no longer declared to be mandatory (causing a very significant further performance hit). Will ask...
Locked