Skip to content

Add NFS client to the guest kernel for type=nfs volumes - #496

Closed
meutex wants to merge 1 commit into
libracoder:mainfrom
meutex:meutex/issue-1794955932-add-nfs-support-to-kiri-s-guest-engine-s
Closed

meutex wants to merge 1 commit into
libracoder:mainfrom
meutex:meutex/issue-1794955932-add-nfs-support-to-kiri-s-guest-engine-s

Conversation

@meutex

@meutex meutex commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

What this changes and why

A Compose named volume backed by an NFS export (driver: local, driver_opts: {type: nfs, device: ":/export", o: "addr=…,nfsvers=4,…"}) is created and then fails to start with failed to mount local volume … no such device. That errno is ENODEV from the guest's mount(2) call, which is what the kernel returns when the requested filesystem type is not registered. Kiri's user space already builds the mount fields correctly; the guest kernel is a deliberately minimal allnoconfig with no remote network filesystem, so "nfs" is unknown to it.

This adds the NFS client to guest/kernel/kiri.config:

  • CONFIG_NETWORK_FILESYSTEMS=y β€” the menu gate; without it fs/nfs/Kconfig is not parsed and the options below are silently dropped.
  • CONFIG_NFS_FS=y, CONFIG_NFS_V3=y, CONFIG_NFS_V4=y, CONFIG_NFS_V4_1=y β€” NFSv3 and NFSv4 (minorversion 4.0 and 4.1) mount; NFSv2, pNFS, Kerberos (sec=krb5*) and NFS swap stay off.

It also adds one e2e check that the running guest registers the nfs filesystem type. The check needs no NFS server and cannot hang, and --rm cleans up after itself. docs/features.md now lists NFS-backed local volumes under Storage and notes that type=cifs volumes still do not mount, since the kernel has no CIFS client.

Cost, which is the part I could not answer: cargo xtask kernel was not run in this environment, so there is no before/after kernel size and no measurement of the new initcalls' effect on boot. The added code is one filesystem plus its protocol modules, built in, so it is not free; the numbers need to come from a real cargo xtask kernel run before this goes anywhere.

No Rust dependency or bundled tool version changes, so scripts/ci/notices.sh is not expected to produce a NOTICE diff. If that turns out to be wrong, the NOTICE change belongs in this PR.

This is opened against meutex/kiri, not upstream. #494 has no maintainer reply yet and CONTRIBUTING.md asks for an agreed approach before code larger than a small fix, so it should only be sent upstream after that reply, with the gap below closed.

Fixes #494

How you tested it

Not built and not run. The environment is Linux only and I could not produce a guest kernel, a host daemon or a VM, so the only command actually executed here was a grep over the workflow files while checking what CI runs:

$ cd /code && grep -n 'rust\|Rust\|toolchain\|1\.8' .github/workflows/perf.yml .github/workflows/codeql.yml .github/workflows/ui-tests.yml 2>/dev/null | head -30
(no matching lines)
exit=0

Still to run before this is sendable, with output pasted back here:

  • cargo xtask kernel (DOCKER_CONTEXT=kiri to build it inside Kiri) β€” must boot, and must give the vmlinux size before and after.
  • cargo xtask guest and cargo xtask host β€” must build.
  • cargo fmt, cargo clippy, cargo test β€” none of these were run.
  • tests/e2e.sh against a running kiri daemon β€” including the new nfs-filesystem check.
  • python3 scripts/i18n-check.py and python3 scripts/ui-test.py β€” the window is not touched, so parity should stay green with no new line in tests/ui/parity-allow.txt, but that is an expectation, not a result.
  • A real Compose stack with an NFS-backed volume on macOS, against an actual NFS server, since that is where the bug was reported.

Tested on: nothing. No platform was exercised; the sandbox is Linux only and cannot start the macOS VM path where the failure was reported.

How you found it

  • I use Kiri and ran into this myself
  • I found it by reading the code or comparing with Docker
  • Someone else reported it (link the issue above)

AI tools used to write this change: None.

Checklist

  • I have at most 3 pull requests open on Kiri, this one included β€” cannot confirm from here; the requester needs to check and tick this.
  • cargo fmt, cargo clippy and the tests pass β€” none of the three were run in this environment; see the list above for what is outstanding.
  • It works on macOS, Windows and Linux, or the change only touches one of them β€” the change touches the guest kernel on all three platforms, and only Linux could be built here at all. The macOS VM path is untested, so this stays unticked.

Local-driver volumes with driver_opts type=nfs failed with ENODEV
("no such device") because the guest kernel was built from allnoconfig
with no remote network filesystem. Add CONFIG_NETWORK_FILESYSTEMS plus
the NFSv3/NFSv4/NFSv4.1 client so mount(2) registers the nfs type and
the already-complete user-space mount path works. NFSv2, pNFS, Kerberos
and NFS swap stay off.

Also document type=nfs support in docs/features.md (and cifs as a known
gap) and add a deterministic e2e.sh check that the engine offers the nfs
filesystem type without needing a server.
@libracoder libracoder added enhancement New feature or request storage/volumes labels Nov 19, 2026 — with Claude
@libracoder libracoder mentioned this pull request Nov 19, 2026
@libracoder

Copy link
Copy Markdown
Owner

@meutex thank you for this pull request. Before we can review and merge it, its commits need to be signed and show as Verified on GitHub. Right now they are not.

To fix it:

  1. Set up commit signing with a GPG or SSH key, and add that key to your GitHub account as a signing key (an SSH key added only for authentication does not count): https://docs.github.com/en/authentication/managing-commit-signature-verification
  2. Sign the existing commits again, for example git rebase --exec 'git commit --amend --no-edit -S' main
  3. Force-push the branch: git push --force-with-lease

We only merge pull requests where every commit is verified. Once that shows, we will pick it up.

@meutex
meutex force-pushed the meutex/issue-1794955932-add-nfs-support-to-kiri-s-guest-engine-s branch from d6bda18 to f9ac31c Compare November 21, 2026 03:55
@libracoder libracoder added the status: in progress Being worked on label Nov 25, 2026
@libracoder

Copy link
Copy Markdown
Owner

Shipped in #961 β€” thank you!

@libracoder libracoder closed this Nov 25, 2026
@libracoder libracoder added status: fix on main Fix merged, not released yet and removed status: in progress Being worked on labels Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request status: fix on main Fix merged, not released yet storage/volumes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nfs support

2 participants