Repository navigation
Share a host folder with a VM over NFS (key f); version 0.1.1 - #5
Merged
Merged
Conversation
…stale per user; confirm texts; folder chars; man
…rules are outdated
…refuses flags on a disabled daemon)
…on also needs sysctl saved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Share one host folder per VM over NFS, limited to that VM, kept correct across host reboots, with no doas on start/stop. Version 0.1.1.
What it does
fon a managed VM with Internet on: pick a folder (or Browse), Share / Stop sharing. The dialog shows the guest commands to mount it once or at every guest boot (Linux and OpenBSD).Sharedcolumn (last, 30 wide, wraps) shows the shared folder./etc/vmmanager/sync-exports(stdlib-only, root-owned), adds it to/etc/rc.local, enables portmap/mountd/nfsd and sets nfsd to-t -n 4(TCP only). The daemons start after the first share has written its line (OpenBSD's rc.d refuses to start them while/etc/exportsis empty).<folder> -mapall=<owner> 100.64.<id>.3under a vmmanager marker. The sync script rewrites only vmmanager's marked lines, under a flock on/var/run/exports.lockshared with dockerctl, and runs at boot from rc.local because vmd re-assigns VM ids at boot./, empty input and characters that break exports(5) or the pasted guest commands.Known limit (documented, accepted)
The kernel exports a whole file system to an address, so root inside a guest could reach other files on the same file system with the owner's rights by crafting NFS file handles. Other VMs and the LAN still can't mount anything. The man page and the dialog say so and suggest a separate partition for untrusted VMs.
Testing
py_compile,mandoc -Tlint -Wwarningclean (run on OpenBSD 8.0).@rebootmounts, host reboot (export follows the VM ids, daemons start, guest remounts), dockerctl's export anddocker run -vunaffected, LAN ports 111/2049 closed, Stop sharing leaves only dockerctl's line.docs/superpowers/specs/2026-11-18-folder-share-design.md; plan:docs/superpowers/plans/2026-11-18-folder-share.md.