Skip to content

Set OverrideUID on virtiofs mounts for macOS ownership#111

Merged
jhrozek merged 1 commit intomainfrom
fix/virtiofs-override-uid
Apr 8, 2026
Merged

Set OverrideUID on virtiofs mounts for macOS ownership#111
jhrozek merged 1 commit intomainfrom
fix/virtiofs-override-uid

Conversation

@jhrozek
Copy link
Copy Markdown
Contributor

@jhrozek jhrozek commented Apr 8, 2026

Summary

  • Set OverrideUID/OverrideGID on workspace and extra virtiofs mounts so libkrun reports correct ownership to the guest on macOS
  • Fixes nested file writes failing inside the VM when the host UID differs from the sandbox UID

Blocked on: stacklok/go-microvm#64 being merged and tagged. The OverrideUID field does not exist in go-microvm v0.0.30.

Test plan

  • After go-microvm release, update go.mod to new version
  • task test passes
  • Manual: run bbox claude-code on macOS, verify writes to nested files work without pre-set xattrs

🤖 Generated with Claude Code

@jhrozek jhrozek marked this pull request as ready for review April 8, 2026 13:03
On macOS, libkrun's virtiofs FUSE server reports host-side file
ownership to the guest. Without user.containers.override_stat
xattrs, workspace files appear as the host UID (e.g. 501) and
the sandbox user (1000) cannot write to nested directories or
files.

Set OverrideUID/OverrideGID on both the workspace mount and extra
mounts (git objects). go-microvm walks the host path and sets the
xattr on all entries before VM boot, making them appear as owned
by the sandbox user inside the guest.

Requires go-microvm with SetOverrideStatTree support (unreleased).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jhrozek jhrozek force-pushed the fix/virtiofs-override-uid branch from e2d3dde to 092baee Compare April 8, 2026 14:26
@jhrozek jhrozek merged commit 6586818 into main Apr 8, 2026
8 checks passed
@jhrozek jhrozek deleted the fix/virtiofs-override-uid branch April 8, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants