practical to nfs share /usr/local ?

I have some bhyve guests running FreeBSD.

As the guest disk sizes are fix and cannot grow (true?) I'd like to keep them small and nfs mount as much as possible from the host.

I wonder now if it is possible and practical to save some guest disk space by nfs mounting /usr/local from the bhyve host.

I guess, I would have to copy /var/run from the host and update it each time I install a package on the host, wouldn't I?
 
If you want to be able to grow your disks while the guest is running, you could provision your disk space via iSCSI.
Unless you intend to run the exact same software on host and guest, I would not recommend sharing /usr/local. I'm not completely certain, but isn't /var/run very system specific? I'd expect some very unexpected side effects if you share that between a host and a guest.
 
I'm not completely certain, but isn't /var/run very system specific? I'd expect some very unexpected side effects if you share that between a host and a guest.

I'm not sure if all package create their necessary directories under /var/run. If all do there is no problem.
 
For example, devd has a pipe and a pid file in /var/run. When you run devd on host and guest (which likely you will need to), you won't be able to stop or restart the process on one of those two systems.
 
Some ports also need (and create at install time) their own userids.

But overall very possible.

You could also NFS export one full copy to each VM and save disk space by ZFS dedup.
 
Files in /var/run should normally be created at runtime, and not be part of packages, so I don't see any issues there.

But then, if you can share /usr/local, it means you're running FreeBSD, and at least the same ABI (major version) in all your VMs. Then I wonder, why don't you use (VNET?) jails instead?

Of course there are ways to have the storage for bhyve VMs somewhat flexible, e.g. I'm using sparse zvols here (with a "fixed" size that will "always be enough") and guest-side TRIM enabled, so the zvol will actually shrink when the guest deletes stuff.
 
'cause getting bhyve working was hard enough, no further adventures with jails.
I'm wondering - did you look at the Handbook when considering jails? If so, would you be willing to share some feedback about what could be improved to make it look easier?
I've started some improvements on the relevant chapters around bhyve; if there's points we can improve around jails, I'd be happy to hear them and have a look at them! You can message me directly if you prefer, since this is kind of hijacking this thread... thanks!
 
I'm wondering - did you look at the Handbook when considering jails?
No, I did not consider jails. And I got burned by following the handbook's bhyve path (Debian guests without network, I have written here about the traps I fell in).
vm_bhyve is the way to go in my experience.
Currently I try setting up nfsv4, there is nothing in the handbook but a pointer to cryptic man pages.
 
I've started some improvements on the relevant chapters around bhyve; if there's points we can improve around jails, I'd be happy to hear them and have a look at them! You can message me directly if you prefer, since this is kind of hijacking this thread... thanks!
Why don't you start a forum thread? I'm sure the handbook is a hot topic.
 
Back
Top