From nobody Tue Jun 28 10:01:17 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 852EC87A65E for ; Tue, 28 Jun 2022 10:01:25 +0000 (UTC) (envelope-from freebsd@aeichner.de) Received: from mail.a-eichner.de (mail.a-eichner.de [136.243.96.80]) by mx1.freebsd.org (Postfix) with ESMTP id 4LXKqm5TXHz3CPG for ; Tue, 28 Jun 2022 10:01:24 +0000 (UTC) (envelope-from freebsd@aeichner.de) Received: from [192.168.2.234] (ip4d17e279.dynamic.kabel-deutschland.de [77.23.226.121]) by mail.a-eichner.de (Postfix) with ESMTPSA id A67D34C049A for ; Tue, 28 Jun 2022 12:01:18 +0200 (CEST) From: Alexander Eichner Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: how to run bhyve and virtualbox at the same time Date: Tue, 28 Jun 2022 12:01:17 +0200 References: <62B9FBF1.6030906@grosbein.net> To: freebsd-hackers@freebsd.org In-Reply-To: Message-Id: <1D2BDC88-6739-45E0-A609-98D6FF271733@aeichner.de> X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 4LXKqm5TXHz3CPG X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@aeichner.de has no SPF policy when checking 136.243.96.80) smtp.mailfrom=freebsd@aeichner.de X-Spamd-Result: default: False [-1.48 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.976]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; DMARC_NA(0.00)[aeichner.de]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-hackers]; R_SPF_NA(0.00)[no SPF record]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:136.243.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[77.23.226.121:received] X-ThisMailContainsUnwantedMimeParts: N 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 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