Skip to content

fix: detect correct VM user on NixOS (skip nixbld)#22

Merged
ethannortharc merged 1 commit intomainfrom
fix/lima-vm-user-detection
Mar 11, 2026
Merged

fix: detect correct VM user on NixOS (skip nixbld)#22
ethannortharc merged 1 commit intomainfrom
fix/lima-vm-user-detection

Conversation

@ethannortharc
Copy link
Copy Markdown
Owner

Summary

  • Post-rebuild agent wait loop now uses runtime.exec_cmd() instead of hardcoded incus — fixes 120s timeout on every Lima (macOS) create
  • detect_vm_username and detect_vm_uid now filter to users with home under /home/ — skips NixOS nixbld* users (UID 30001+ with home /var/empty)
  • Root cause of /var/empty/.zshrc: Operation not permitted errors on macOS

Test plan

  • cargo build + cargo test — all 67 tests pass
  • Verified awk filter correctly selects ethan over nixbld1 in simulated /etc/passwd
  • devbox create on macOS (Lima) — should detect correct user, no /var/empty errors
  • devbox create on Linux (Incus) — should still work correctly

🤖 Generated with Claude Code

Two bugs fixed:

1. Post-rebuild agent wait loop hardcoded `incus` commands instead of
   using the runtime abstraction. On Lima (macOS), this always failed,
   causing a 120s timeout on every create.

2. detect_vm_username/detect_vm_uid matched NixOS nixbld* users
   (UID 30001+ with home /var/empty) instead of the actual user.
   Now filters to users with home under /home/.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ethannortharc ethannortharc merged commit 6206b06 into main Mar 11, 2026
0 of 2 checks passed
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