Two hypervisors running at the same time

Discussions related to using VirtualBox on Mac OS X hosts.

Two hypervisors running at the same time

Postby okiuss » 18. Oct 2021, 15:07

Hi,
can anyone tell me, why two hypervisors (e.g. Virtualbox and Parallels) can run their VMs "parallel" at the same time (on macOS hosts),
and why it is as problem to activate hyper-v on Windows hosts, which definitely "disables" any other hyperviosr on Windows hosts ?

Regards, OK
okiuss
 
Posts: 59
Joined: 7. Nov 2016, 14:06
Location: Austria
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: OSX,LINUX,WINXXX

Re: Two hypervisors running at the same time

Postby fth0 » 18. Oct 2021, 15:24

Please provide a VBox.log file and the corresponding log file from Parallels (I don't know how to do the latter), to check if both hypervisors use hardware virtualization (VT-x/AMD-V).
fth0
Volunteer
 
Posts: 2640
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: Two hypervisors running at the same time

Postby okiuss » 21. Oct 2021, 19:46

Hello,
here are logs .....
I have made two complete PowrUp/PowerDown cycles,
#1 VirtualBox up, Parallels up, Parallels down, VirtualBox down
#2 Parallels up, VirtualBox up, Virtualbox down, Parallels down

VirtualBox runs a Linux guest, Parallels starts a macOS VM.
Parallels uses its own hypervisor and NOT the hypervisor framework from Apple.

Regards, OK
Attachments
VB_PAR_LOGS.tar.gz
Logfiles from both hypervisors
(81.16 KiB) Downloaded 6 times
okiuss
 
Posts: 59
Joined: 7. Nov 2016, 14:06
Location: Austria
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: OSX,LINUX,WINXXX

Re: Two hypervisors running at the same time

Postby scottgus1 » 21. Oct 2021, 20:15

fth0 will get to the deep nitty-gritty, but I'll add in a general thought:

okiuss wrote:why two hypervisors (e.g. Virtualbox and Parallels) can run their VMs "parallel" at the same time (on macOS hosts),

If both hypervisors try to use the host's "virtualization technology" (Intel VT-x * ) there will be problems, since only one program can use VT-x on a computer at once. If both hypervisors are able to run at the same time, it may mean that one of them is not using VT-x. Since Virtualbox 6.1.x and later now require VT-x for all VMs, it would appear to my guess that Parallels is not using VT-x on your host.

( * AMD also has "virtualization technology" as AMD-V or SVM. But Virtualbox-capable Macs only use Intel CPUs.)

okiuss wrote:why it is as problem to activate hyper-v on Windows hosts

Hyper-V is a type 1 hypervisor (which means it accesses the physical hardware before the host OS does) and it uses VT-x. Virtualbox is a type-2 hypervisor, which means it requires a running host OS accessing the hardware first.

So when Hyper-V is running, it takes up VT-x, which means Virtualbox has to jump through hoops to get VT-x access, or Virtualbox has to use the Hyper-V engine to run a VM, since VT-x is not free to use when Hyper-V is active.
scottgus1
Site Moderator
 
Posts: 13886
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Two hypervisors running at the same time

Postby okiuss » 21. Oct 2021, 21:16

@scottgus1, thanks for clarification.

... another sidenote - both VMs are 64bit OSs. I think I have read in the documentation of VirtualBox, that it is a precondition to have VT-X in use, to be able
to run a 64bit VM on a 64bit host ?

VBox Linux guest:
root@deb95-knappvpn:~# uname -a
Linux deb95-knappvpn 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64 GNU/Linux

Parallels VM:
par-highsierra:~ ok$ uname -a
Darwin par-highsierra.local 17.7.0 Darwin Kernel Version 17.7.0: Fri Oct 30 13:34:27 PDT 2020; root:xnu-4570.71.82.8~1/RELEASE_X86_64 x86_64

Regards, OK
okiuss
 
Posts: 59
Joined: 7. Nov 2016, 14:06
Location: Austria
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: OSX,LINUX,WINXXX

Re: Two hypervisors running at the same time

Postby fth0 » 25. Oct 2021, 19:31

It took a while to collect all necessary information, but here it comes:

On a macOS host, "macOS requires using a low level interface which enforces correct arbitration". VirtualBox 6.1.x uses this interface, so that the sharing VT-x with other hypervisors works as expected.

On a Linux host, VirtualBox 6.1.x defaults to using VT-x exclusively, because "years ago" "KVM stopped supporting" the sharing of VT-x.

On a Windows host, VirtualBox 6.1.x defaults to using VT-x non-exclusively, so sharing VT-x works with other hypervisors that also share VT-x.

PS: Quoted texts ("...") are originally from klaus
fth0
Volunteer
 
Posts: 2640
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: Two hypervisors running at the same time

Postby okiuss » 26. Oct 2021, 13:13

@ftho: Thanks for the explanation.
okiuss
 
Posts: 59
Joined: 7. Nov 2016, 14:06
Location: Austria
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: OSX,LINUX,WINXXX


Return to VirtualBox on Mac OS X Hosts

Who is online

Users browsing this forum: No registered users and 22 guests