Two hypervisors running at the same time

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
okiuss
Posts: 61
Joined: 7. Nov 2016, 14:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: OSX,LINUX,WINXXX
Location: Austria

Two hypervisors running at the same time

Post by okiuss »

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
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Two hypervisors running at the same time

Post by fth0 »

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).
okiuss
Posts: 61
Joined: 7. Nov 2016, 14:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: OSX,LINUX,WINXXX
Location: Austria

Re: Two hypervisors running at the same time

Post by okiuss »

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 8 times
scottgus1
Site Moderator
Posts: 20965
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

Post by scottgus1 »

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.
okiuss
Posts: 61
Joined: 7. Nov 2016, 14:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: OSX,LINUX,WINXXX
Location: Austria

Re: Two hypervisors running at the same time

Post by okiuss »

@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
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Two hypervisors running at the same time

Post by fth0 »

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
okiuss
Posts: 61
Joined: 7. Nov 2016, 14:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: OSX,LINUX,WINXXX
Location: Austria

Re: Two hypervisors running at the same time

Post by okiuss »

@ftho: Thanks for the explanation.
Post Reply