# Virtualization bhyve vs virtualbox



## phalange (Aug 13, 2020)

Hi, can bhyve coexist with Virtualbox, meaning no modules or settings conflict? I don’t need to run them at the same time, but I don’t want to reboot to switch between bhyve and vb sessions.

Also, is bhyve faster than VirtualBox? In my case, there‘s an appliance that I have to use in VB, but on Linux I tended to prefer qemu for other virtualization for speed mainly. In FreeBSD, I’m fine with vb, but I’m looking speedy alternatives if they exist.


----------



## Alain De Vos (Aug 13, 2020)

No, bhyve and virtualbox want to take full control of the CPU (i don't know the technical term)
Which means you can only use one or the other.
What I do is install in virtualbox and migrate afterwards to bhyve. This makes install easier.
I find bhyve faster than virtualbox. And virtualbox faster than quemu.


----------



## SirDice (Aug 13, 2020)

phalange said:


> Hi, can bhyve coexist with Virtualbox, meaning no modules or settings conflict? I don’t need to run them at the same time, but I don’t want to reboot to switch between bhyve and vb sessions.


They can coexist but you cannot run them concurrently. Only one of them can be loaded and be active.


----------



## scottro (Aug 13, 2020)

My experience matches SirDice's answer. You can have both, you don't need to reboot after shutting one down, you can turn one off and use the other. I too found bhyve faster, especially with a Windows-10 guest, where VirtualBox was too slow to use. 
With bhyve, it's not that fast, but it's somewhat better.  It's still slow, but at least it's usable.


----------



## phalange (Aug 13, 2020)

scottro said:


> With bhyve, ... It's still slow, but at least it's usable.



Good information. I want to run some stripped down linux in a VM to run a few programs that are not supported in BSD. I need VB configured regardless, but I’m interested in bhyve since it seems to be popular with FreeBSD community.


----------



## phalange (Aug 13, 2020)

Alain De Vos said:


> virtualbox faster than quemu.



I’ve heard this. On Linux, it was the opposite for me with qemu taking top marks for speed but having a somewhat sprawling setup once virtmanager and friends came into the picture. Either way it seems qemu is not popular with FreeBSD?


----------



## rootbert (Aug 13, 2020)

if you have the "usual suspects" as vm, probably bhyve will suffice. However, in my experience it is unfortunately too much fiddling around if you want less popular operating systems to run ... e.g. at the moment it is not possible to run kali linux, greenbone/openvas, whonix, tails or debian 10 also has some quirks

qemu is fast in Linux land because it uses the hardware virtualization backend KVM, we don't have support for that in FreeBSD so qemu is really slow here.


----------



## phalange (Aug 13, 2020)

rootbert said:


> if you have the "usual suspects" as vm, probably bhyve will suffice. However, in my experience it is unfortunately too much fiddling around if you want less popular operating systems to run ... e.g. at the moment it is not possible to run kali linux, greenbone/openvas, whonix, tails or debian 10 also has some quirks
> 
> qemu is fast in Linux land because it uses the hardware virtualization backend KVM, we don't have support for that in FreeBSD so qemu is really slow here.



yes, kvm. That explains it. My first thought is NixOS for the guest but based on what you’re saying, it almost certainly falls into the ‘less popular’ category.


----------



## teo (Aug 14, 2020)

phalange said:


> I’ve heard this. On Linux, it was the opposite for me with qemu taking top marks for speed but having a somewhat sprawling setup once virtmanager and friends came into the picture. Either way it seems qemu is not popular with FreeBSD?


Unfortunately, FreeBSD lacks support for the with qemu sharing library. For me, qemu works best with FreeBSD as a guest. I have never tried bhyve with FreeBSD virtualized graphics environment.


----------



## Voltaire (Nov 28, 2022)

I have benchmarked Speedometer 2.0 and StyleBench on the following two configurations:

FreeBSD + Chromium
Speedometer 2.0  result =  69.7
StyleBench result  = 19

FreeBSD + VirtualBox (Clear Linux) + Chrome + 95% CPU assigned.
Speedometer 2.0 result  =  *74.2*
StyleBench result  = *22.9*
It's not in all benchmarks, but in these two important ones, the VirtualBox Clear Linux VM is faster than bare metal.

In your experience, what is the average difference in CPU tasks between VirtualBox and bhyve? Suppose this difference were greater than 10% then bhyve is in principle much faster to browse (via Chrome) with my setup than the standard Chromium package in ports. I have also tried to use the linux-browser-installer script but this script does not work properly, Chrome is installed in a Jail on Ubuntu and it has huge CPU spikes all the time.

Have any of you used bhyve to virtualize a graphical Clear Linux desktop yet?
Seems a lot faster and the best option for browsing via Chrome to me.


----------



## quakerdoomer (Nov 28, 2022)

You can have 

*vboxdrv.ko*
*vboxnetflt.ko*
*vboxnetadp.ko*

loaded and bhyve doesn't mind it. But if you have *vmm.ko* loaded then VirtualBox takes offence and gives you the silent treatment. It attempts to load the guest OS with no error messages, nothing. It just doesn't work.


----------

