yaroslav-gwit / HosterCore

🚀 Hoster: Empowering FreeBSD Virtualisation with Ease
https://docs.hoster-core.gateway-it.com/
Apache License 2.0
39 stars 0 forks source link

Implement `VirtIO 9P` binds #82

Closed yaroslav-gwit closed 11 months ago

yaroslav-gwit commented 11 months ago

VirtIO 9P binds will allow us to automate VM deployments even further, due to the fact that any kind of scripts: shell, Nim, Go, Python, etc etc can be mounted in a specific folder, and executed on boot.

On the bhyve side it's as simple as adding this line: sharename=/path/to/share[,9p-device-options]. For example:

-s 9,virtio-9p,sharename=/mnt

Then, on the VM side it can be mounted like so:

mount -t 9p -o trans=virtio,version=9p2000.L,rw sharename /mnt
yaroslav-gwit commented 11 months ago

The change has been implemented. You can now add your shares like so:

"9p_shares": [
    { "share_name": "temp", "read_only": false, "share_location": "/tmp/" },
    { "share_name": "root", "read_only": true, "share_location": "/root/" }
],