3 ms·
I run FreeBSD as my host and pass data into linux VMs with bhyve 9p protocol support. This way I can have my docker data on my FreeBSD host's ZFS. Just pointing
by soupbowl 3y ago
I run FreeBSD as my host and pass data into linux VMs with bhyve 9p protocol support. This way I can have my docker data on my FreeBSD host's ZFS. Just pointing out another option, but it also depends on what type of stuff you are doing.
- hnlmorg 3y agoThis sounds interesting. Got any more details about it?
- soupbowl 3y agoI'll give a few pointers, I have done this with Debian and NixOS as well as docker and podman, currently I use NixOS/podman and that is all I have for examples. If you were using debian you would use a mount command with the Fstype and options below. In a bhyve vm config file you add 'bhyve_options' and add some virtio-9p mount points. they are 'per slot' so each of these mounts will need a new number '-s 15' '-s 16' as in my below example. on FreeBSD host, assuming you are using bhyve-vm (works with plain bhyve also): /usr/local/vm/nixos/nixos.conf bhyve_options="-s 15,virtio-9p,podman-archivebox=/HOSTZFS/Services/VM/NixOS/ArchiveBox -s 16,virtio-9p,podman-music=/HOSTZFS/Audio/Music/Flac" in VM (nixos): fileSystems."/mnt/podman-archivebox" = { device = "podman-archivebox"; fsType = "9p"; options = [ "trans=virtio" "version=9p2000.L" "_netdev" "cache=loose" ]; }; fileSystems."/mnt/podman-music" = { device = "podman-music"; fsType = "9p"; options = [ "trans=virtio" "version=9p2000.L" "_netdev" "cache=loose" "ro" ]; }; If you were not using NixOS, add your mount points in the VM (/mnt/podman-archivebox, /mnt/podman-music). Then mount them with your docker/podman setup. virtualisation.oci-containers.containers."ArchiveBox" = { image = "archivebox/archivebox"; ... ... volumes = [ "archivebox_data:/data" "/mnt/podman-archivebox/archive:/data/archive" "/mnt/podman-archivebox/sources:/data/sources" "/mnt/podman-archivebox/ArchiveBox.conf:/data/ArchiveBox.conf" ]; virtualisation.oci-containers.containers."navidrome" = { image = "deluan/navidrome:latest"; ... ... volumes = [ "navidrome_data:/data" "/mnt/podman-music:/music:ro" ]; }; The 9p mount points won't get passed into the VM until you STOP the VM and then START the VM (restart won't work). Once that is done and you can confirm the files are passed through and working, things 'just work'. This does not work for things that require file locks like passing database files through 9p. Hope this is helpful to someone.
- hnlmorg 3y agoThanks for sharing :)