Skip to content

Commit 092baee

Browse files
jhrozekclaude
andcommitted
Set OverrideUID on virtiofs mounts for macOS ownership
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>
1 parent 72ff042 commit 092baee

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

internal/infra/vm/runner.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,10 @@ func (r *MicroVMRunner) Start(ctx context.Context, cfg domvm.VMConfig) (domvm.VM
306306
return nil, fmt.Errorf("resolving workspace path: %w", err)
307307
}
308308
opts = append(opts, microvm.WithVirtioFS(microvm.VirtioFSMount{
309-
Tag: "workspace",
310-
HostPath: absPath,
309+
Tag: "workspace",
310+
HostPath: absPath,
311+
OverrideUID: sandboxUID,
312+
OverrideGID: sandboxGID,
311313
}))
312314
}
313315

0 commit comments

Comments
 (0)