bhyve Giving less than 8 GB of RAM to bhyve FreeBSD guests


Active Member

Reaction score: 12
Messages: 198

I'm experimenting bhyve with virtualized FreeBSD guests.

Host system: FreeBSD 13 with 8 GB or RAM on Intel chip.

On installation, there is a message that says ZFS tuning is necessary for using FreeBSD with less than 8 GB of RAM. I tried giving 1 GB to bhyve FreeBSD guests and they seem to be working well.

I read this tuning guide, but I just don't know what to apply and whether it is really necessary.

I'm seeking your opinion:

- Is 1 GB RAM for bhyve FreeBSD guests recommended? And if not, what are the foreseable trouble?
- What is minimum recommended RAM for bhyve FreeBSD guests?
- What are the specific recommended tuning?


Son of Beastie

Reaction score: 2,096
Messages: 2,953

Perhaps just select UFS in the installer. ZFS does take a fair amount of memory and having that cost for both the host and the guest is possibly too much for standard desktop / laptop machines.


Staff member

Reaction score: 12,342
Messages: 38,859

You might want to set vfs.zfs.arc_max so ZFS doesn't start to compete with bhyve or other processes on the machine. But that's about all the tuning you'll want to do.



Reaction score: 602
Messages: 1,543

I've run ZFS many times with less than 8GB of RAM. As SirDice mentions, you will almost certainly need to restrict ARC size otherwise it'll just starve the system of ram/swap.

Personally I generally use ZFS on the host, but UFS in the guest. ZFS adds a lot of overhead, especially when the data is on a ZFS pool anyway.



Reaction score: 676
Messages: 1,358

I moved my compile scripts (world and ports) into bhyve (to be able to also build uplevel/CURRENT versions), it is using ZFS in the bhyve (because it is cleaner to rollback installed ports than to deinstall them), it does run on my desktop with 8G ram, and, while adding more ram would certainly not hurt, it does run quite properly. Performance impact is 10-15% compared to run it in a chroot, likely due to the virtualization.

conf_Vbase="32G"    # main disk with UFS
conf_Vswap="10G"    # thereof swap
conf_Vzfs="20G"      # extra disk for ZFS
conf_Vmem="3072M"   # minimum necessary to successfully build rust w/ 4 cpu