vbox VirtualBox or bhyve

Just be aware that FreeBSD is not an officially supported platform for VirtualBox, so the closed source extension doesn't exist, and VirtualBox on FreeBSD has not been updated to 7.0 yet.
 
As to USB, bhyve requires passing thru the entire xhci pci controller. Passthru separate USB ports is not achievable. That's the right decision. But it's not convenient for everyone, for example, if you need USB ports for work (for connecting readers, smart card emulators) and the computer does not have a dedicated usb xhci pci controller (as is the case with a laptop). But I myself use bhyve due to stability.
 
As to USB, bhyve requires passing thru the entire xhci pci controller. Passthru separate USB ports is not achievable. That's the right decision. But it's not convenient for everyone, for example, if you need USB ports for work (for connecting readers, smart card emulators) and the computer does not have a dedicated usb xhci pci controller (as is the case with a laptop). But I myself use bhyve due to stability.
There is a FreeBSD source fork where passthru for single USB devices is possible.

Details here:

https://github.com/FreeBSD-UPB/free...virtual-machines-in-bhyve-for-USB-passthrough

... also when passthru entire PCI USB controller keep in mind that they MUST support MSI/MSI-X interrupts. Without it your VM will stop in error.

Details here:

https://vermaden.wordpress.com/2023/08/18/freebsd-bhyve-virtualization/#comment-26156
 
I think it's harder to get sound working in bhyve (I've never tried, I use it for some things where I need Windows for work, and some RHEL servers for experimenting--neither requires sound). Bhyve seems to me (never measured it, so this is subjective), faster than VirtualBox on my system.
If running a system using uefi on bhyve, see vermaden's post in https://forums.freebsd.org/threads/starting-bhyve-am-greeted-with.90227/#post-621370

It was harder in the past. Now its just another bhyve(8) argument to get sound. You can also use rdesktop for RDP connections to get other way of getting sound.

Details (from here https://vermaden.wordpress.com/2023/08/18/freebsd-bhyve-virtualization/):

The last one option -r sound:local specifies that the audio will be realized on the guest VM – this will only work if you added the bhyve_options="-s 8,hda,play=/dev/dsp,rec=/dev/dsp" to the Windows 7 Bhyve config. Alternatively without that hda(4) emulation you can use -r sound:remote option – this would use RDP protocol to transfer audio events from the guest machine to your host machine and then audio will be played then locally on your host machine.
 
Which one takes less CPU resources? I heard Bhyve takes up a lot of CPU for simple tasks.
What do you mean saying "simple tasks of bhyve"?
E.g. for 8 years 24/7 I run Windows and Debian as bhyve() guests in my desktop FreeBSD (10-year old Xeon E5-1650) which I also actively use, and I have never noticed any lag in any of them.
 
I think that VirtualBox has two advantages over bhyve. VirtualBox VMs can be moved to different hosts (personally, I have no experience with this), and VM snapshotting in the VirtualBox GUI is very convenient.
 
The real problem of using VirtualBox under FreeBSD is that only USB 1.x is supported and thus many devices simply don't work. OTOH, bhyve supports every USB protocol but only with passthru.
 
After 11 (2011-2022) years of working on Linux (and Virtualbox in it) I switched from Linux to FreeBSD precisely because VirtualBox simply broke, and the developers were in no hurry to fix it and the situation remained unchanged for several months.
Sorry for referring to myself (post #13) : https://forums.freebsd.org/threads/why-do-you-use-freebsd-on-desktop.88480/post-603281
Of course, this applies to VirtualBox on Linux, but still...
 
One day the significant USB latency in VirtualBox on Linux helped me finding a bug in a product developed at $JOB. Otherwise the bug wasn't reproducible with real hardware, but the customers complained once a month. That was 11 years ago though.
No need to use VB anymore, bhyve() works great, and an extra USB controller for passtru is not a big deal.
 
One day the significant USB latency in VirtualBox on Linux helped me finding a bug in a product developed at $JOB. Otherwise the bug wasn't reproducible with real hardware, but the customers complained once a month. That was 11 years ago though.
No need to use VB anymore, bhyve() works great, and an extra USB controller for passtru is not a big deal.
Unless you're running FreeBSD on your one and only laptop...
 
dear vermaden :
do you how to add usbdisk to bhyve vm ? thanks.

With Bhyve You can 'passthru' entire USB controller to a VM and then any USB drive you attach to that 'passthru' controller will be only in a VM.

Details in this comment:

 
Back
Top