bhyve Access storage external to vm

I am able to access a data set, zroot/data from with an iocage jail and would like to do the same from a vm, but don't see a command for doing this.

Is there something like a vm attach zroot/data / ?
 
There is no such a vm(8) command, but you can set up a shared directory between the host and a FreeBSD VM guest.

Configure the FreeBSD guest for a shared directory (replace "myguest" with the name you gave the guest system):

https://github.com/churchers/vm-bhyve/wiki/Virtual-Disks#virtio-9p-share .

and set in the guests /boot/loader.conf
Code:
virtio_p9fs_load="YES"
To mount in the guest the shared directory, execute mount -t p9fs sharename /<mount_point>

Or, you can use supported network file systems between the host and guest to share files (NFS, SMB, sshfs, etc.).
 
If you are planning to install 14.3 as guest VM (to build mfsbsd images perhaps), then p9fs(4) is not available on that branch, only on >=15.

If that's the case, without installing 3rd party apps, files can be shared over NFS, or, without setting anything up besides what is set up as default, scp(1) files and directories in both directions.
 
Back
Top