Page 1 of 1

Two hypervisors running at the same time

Posted: 18. Oct 2021, 15:07
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

Re: Two hypervisors running at the same time

Posted: 18. Oct 2021, 15:24
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).

Re: Two hypervisors running at the same time

Posted: 21. Oct 2021, 19:46
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

Re: Two hypervisors running at the same time

Posted: 21. Oct 2021, 20:15
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.

Re: Two hypervisors running at the same time

Posted: 21. Oct 2021, 21:16
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

Re: Two hypervisors running at the same time

Posted: 25. Oct 2021, 19:31
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

Re: Two hypervisors running at the same time

Posted: 26. Oct 2021, 13:13
by okiuss
@ftho: Thanks for the explanation.