Skip to content

Research: NFS loopback server as a macFUSE-free path on macOS #188

Open

Description

@scttfrdmn

Summary

Research whether an in-process NFSv3 loopback server (willscott/go-nfs) is worth adding as a second mount path, primarily to remove the macFUSE requirement on macOS. This is the approach rclone ships as rclone serve nfs plus mount -t nfs, and it is the only mainstream way to mount a userspace filesystem on macOS without a kernel extension.

Research only. The output is a recommendation with measurements, not an implementation.

Why this is worth looking at

macOS requires macFUSE (brew install --cask macfuse), which is a kernel extension. That means:

  • An admin install, a reboot on some macOS versions, and the "System Extension Blocked" security dialog.
  • Increasing friction as Apple tightens kext loading. This has trended in one direction for years.
  • It is a hard blocker for anyone on a managed Mac, which describes a large share of institutional research users — exactly this project's stated audience.

Notably, the macFUSE requirement is not a consequence of the binding choice. go-fuse's darwin mount execs /Library/Filesystems/macfuse.fs/Contents/Resources/mount_macfuse, and cgofuse needed the same headers. Both had identical macOS requirements, so dropping cgofuse in v0.10.1 changed nothing here. NFS loopback is the only option on the table that actually removes the dependency.

An NFS server also mounts on Linux with no FUSE at all, and on Windows via its built-in NFS client — so it is incidentally a Windows story, though a weak one and not the motivation.

What makes this plausible now, and not before

internal/vfs exists as of v0.10.1. POSIX semantics — inode/attribute model, handle table, dirty ranges, read-modify-write — live there, depend on pkg/types.Backend and nothing FUSE, and are testable without a mount.

That is the precondition. An NFS server would be a second shim over the same tested core, the way internal/fuse now is. Without vfs this would have meant a second partial reimplementation of the filesystem — which is precisely what the cgofuse path was: a silently divergent 382-line subset of a 727-line package that never received the Unlink/Rmdir fix, so under that build tag rm reported success while the object survived in S3. That is the failure mode to avoid, and the reason to only consider this now.

Questions the research must answer

1. Semantics lost. NFSv3 is weaker than FUSE in ways that may or may not matter here:

  • No O_DIRECT, weaker cache-coherence guarantees (NFS close-to-open consistency vs. FUSE's per-request control)
  • Attribute caching is client-controlled and coarser
  • File locking is a separate protocol (NLM) — does go-nfs implement it, and does anything ObjectFS targets need flock?
  • xattrs: NFSv3 has no xattr support at all. That interacts with C4-5: Implement extended attribute operations #167 — the xattr work would be FUSE-only, meaning the two paths diverge in capability, which is a documentation and expectation problem even if it is not a correctness one.

Since ObjectFS already cannot offer full POSIX semantics over S3, some of these losses may cost nothing in practice. That is the interesting question, and it should be answered against the supported-operations table in the README rather than in the abstract.

2. Security. A loopback NFS server is a listening socket. Bound to 127.0.0.1 and using an unprivileged port it is reachable by any local process and any local user, with no authentication — NFSv3 AUTH_SYS is a claim, not a credential. On a shared HPC login node, that is a different exposure model than a FUSE mount whose permissions the kernel enforces. This needs an honest answer before anything is built, not after.

3. Performance. Measure, do not assume. Loopback TCP plus RPC marshalling versus the FUSE character-device path — the direction is not obvious, since FUSE also has per-request kernel round trips. Compare on: sequential read throughput, sequential write, small-file stat storm, and 4 KiB random read. Same bucket, same region, same object sizes, both paths, reported with parameters.

4. willscott/go-nfs maturity. Read the code and issue tracker: what is the protocol coverage, is it maintained, what does rclone's experience with it look like (rclone's own docs describe serve nfs with caveats worth reading), and what happens on error paths — an NFS server that returns the wrong status code produces client-side hangs, which are worse than an error.

5. Mount UX. mount -t nfs -o port=N,mountport=N localhost:/ /mnt still requires privileges on macOS, so this trades a kext install for a sudo mount. Whether that is actually better for a managed-Mac user is the whole question, and it is a UX question, not a technical one. Worth checking whether it works at all under macOS's current mount restrictions on a machine with no admin rights.

6. Second surface to maintain. Even over a shared vfs, this is a second protocol shim with its own error mapping, its own tests, and its own bugs. The cgofuse experience is the cautionary case. If this proceeds, the differential-testing oracle must run against both paths, or the second one drifts.

Deliverable

A comment on this issue with: the measurements from Q3, a semantics-gap table against the README's supported-operations list, a security assessment, and a recommendation — build, don't build, or revisit when a specific condition changes (e.g. Apple breaking kext loading outright).

If the recommendation is "build", it becomes its own issue with internal/nfs as a peer of internal/fuse over internal/vfs.

Related

  • macOS FSKit is filed separately as the other macFUSE alternative. It is the strategically correct answer on modern macOS and is Swift/ObjC-only with no Go bindings, so it is a longer horizon. These two issues are alternatives to each other and should be decided together.
  • The multi-protocol server work (Multi-protocol (SMB, later NFS) file server over the vfs core #181) considers SMB and NFS as export protocols for remote clients. That is a different goal — this issue is specifically about a local mount without a kernel extension — but the two would share the go-nfs evaluation, so whichever is looked at first should do that part properly.

Activity

  1. added this to the Future Work milestone on Aug 2, 2026
  2. added
    type: enhancement
    priority: low
    area: fuse
    effort: medium
    on Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: fuseeffort: mediumpriority: lowtype: enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions