4 ms·
Relevant parts of the bhyve(5) manual: virtfs[N] sharename , path[,ro] Share a filesystem to the guest using Virtio 9p (VirtFS). The specified path is pre
by 1MachineElf 5y ago
Relevant parts of the bhyve(5) manual:
virtfs[N] sharename , path[,ro]
Share a filesystem to the guest using Virtio 9p (VirtFS). The specified path is presented over PCI as a share named sharename. The optional ro option configures the share as read-only. The filesystem path being shared must also be mapped into the zone, using either a delegated dataset or a loopback (lofs) mount. See the EXAMPLES section below.
...
The following example shows how to share a delegated dataset called rpool/datavol to a guest using VirtFS. This assumes that the mountpoint attribute on rpool/datavol is set to /datavol. This could have been done, for example, by creating the dataset with:
zfs create -o mountpoint=/datavol -o zoned=on zpool/datavol
Setting the mountpoint and zoned attributes at the same time prevents the filesystem from ever being mounted in the global zone.
add dataset
set name=rpool/datavol
end
add attr
set name=virtfs0
set type=string
set value=datavol,/datavol
end
and to share the global zone filesystem /data/websites read-only to the guest, add:
add fs
set dir="/data/websites"
set special="/data/websites"
set type="lofs"
add options ro
add options nodevices
end
add attr
set name=virtfs1
set type=string
set value=websites,/data/websites,ro
end