Skip to content

fix: separate root provisioning from user shell sessions on Incus#9

Merged
ethannortharc merged 1 commit intomainfrom
fix/incus-exec-user-separation
Mar 10, 2026
Merged

fix: separate root provisioning from user shell sessions on Incus#9
ethannortharc merged 1 commit intomainfrom
fix/incus-exec-user-separation

Conversation

@ethannortharc
Copy link
Copy Markdown
Owner

Summary

  • Revert exec_cmd to always run as root (fixes provisioning: nixos-rebuild, channel setup)
  • Add exec_as_user trait method for interactive shell sessions
  • Incus overrides exec_as_user with --user <uid> --cwd /workspace --env HOME=...
  • Shell attach now uses exec_as_user so users log in as themselves, not root

Test plan

  • cargo test — all 67 tests pass
  • devbox create — nixos-rebuild runs as root successfully
  • devbox shell — logs in as user, not root

🤖 Generated with Claude Code

exec_cmd always runs as root (needed for provisioning). New
exec_as_user method runs interactive sessions as the first non-root
user with correct HOME and /workspace CWD. Also fixes NIX_PATH to
include channel profile path for nixos-rebuild.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ethannortharc ethannortharc merged commit 7e999ee into main Mar 10, 2026
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.

1 participant