Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jun 2022 12:01:17 +0200
From:      Alexander Eichner <freebsd@aeichner.de>
To:        freebsd-hackers@freebsd.org
Subject:   Re: how to run bhyve and virtualbox at the same time
Message-ID:  <1D2BDC88-6739-45E0-A609-98D6FF271733@aeichner.de>
In-Reply-To: <d76307e6-1e14-f58c-2d70-115b2d7cd5b2@FreeBSD.org>
References:  <CA%2B1FSig5qQRcQMm8uJ0A%2BNO1485MXsh_fEjMtU55iF_Qk0jn8w@mail.gmail.com> <62B9FBF1.6030906@grosbein.net> <CA%2B1FSihK9Q4cmthTyGb_TQLN_LOC%2B2GAiFoOOukQHGQ0Scuzsw@mail.gmail.com> <d76307e6-1e14-f58c-2d70-115b2d7cd5b2@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

VirtualBox 6.1.x uses its own hypervisor with kernel modules on macOS, =
it just uses some internal kernel interfaces to be able to share
the hardware virtualization functionality with other hypervisors.

On hosts other than Windows and macOS VirtualBox defaults to an =
exclusive use of VT-x/SVM for performance reasons. That mode can be =
changed
to do the initialization every time VirtualBox is scheduled on a =
particular CPU which has higher overhead but allows sharing the hardware =
virtualization capabilities
with other hypervisors. The setting can be changed with VBoxManage. Look =
at the manual under [1] and search for =E2=80=9Ehwvirtexclusive=E2=80=9C.
However bhyve would need to support something similar to be able to play =
along, I don=E2=80=99t know whether it does.

Regards,
Alexander Eichner

[1] https://www.virtualbox.org/manual/UserManual.html

> On 28.06.2022 11:29, David Chisnall <theraven@FreeBSD.org> wrote:
>=20
> On 27/06/2022 20:41, Mario Marietto wrote:
>> I did it already and it works. Fact is that if I use virtualbox I =
can't use bhyve at the same time. So It's not a good idea to use only =
virtualbox machines.
>=20
> On macOS, VirtualBox can coexist with other hypervisors because it =
does not provide a kernel module (it is not allowed to on recent macOS) =
but is, instead, layered on top of Apple's Hypervisor framework.
>=20
> bhyve has also been ported to sit on top of Apple's Hypervisor =
framework (xhyve, used by Docker) and I believe that the abstractions =
provided by the bhyve kernel module are fairly similar.
>=20
> It should be possible to port VirtualBox to sit on top of vmm.ko.  I =
have not been able to find any documentation of the vmm(4) ioctls other =
than the source code, so I'd imagine that about 2/3 of this work would =
be documenting the kernel interfaces.
>=20
> David
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1D2BDC88-6739-45E0-A609-98D6FF271733>