Skip to content

guest/home/ dotfiles restored each session can conflict with tools that manage their own $HOME config #103

@scdanieli

Description

@scdanieli

Note: this text was drafted with AI assistance.

I've been using sandvault extensively over the past few weeks and it's genuinely one of the best solutions I've looked at for isolated AI dev environments — thank you for building and maintaining it.

I'm moving my dev setup to the cloud so this is no longer affecting me personally, but I wanted to leave my notes here in case any of it is useful as a seed for improvements. I'm not 100% certain about all the technical details, so take this as a rough map rather than a precise bug report.


The pattern

guest/home/ files are rsync'd fresh into the sandbox home on every session start. This means any tool that expects to own a dotfile in $HOME — and modifies it at runtime — will have its changes silently overwritten next session. Most users won't notice, but it can cause subtle, hard-to-diagnose failures for tools like nvm, rbenv, pyenv, or anything else that writes to its own config file in $HOME.


Concrete example: nvm + .npmrc

guest/home/.npmrc ships with:

prefix=${HOME}/node_modules

nvm is incompatible with a user-level prefix in .npmrc and exits with code 11 when it finds one. Since the file is restored every session, any in-session fix gets overwritten next time.

Two compounding issues:

  1. nvm is not initialized in the sandbox shell by default — it needs to be added to /Users/Shared/sv-$USER/user/.zprofile
  2. Even once initialized, it fails silently due to the prefix= conflict

Workaround: place a /Users/Shared/sv-$USER/user/.npmrc without the prefix line — the configure script copies it after the rsync, overriding the template. Combined with adding nvm init to user/.zprofile, this works.


Possible directions

  • Document the session-restore behavior prominently, so users understand why in-session $HOME edits don't persist
  • Consider whether guest/home/.npmrc needs prefix= at all, or whether that could move to a less collision-prone location
  • A note in the README under "Custom Shell Configuration" about tools that manage their own dotfiles would help users debug this class of problem

Environment: macOS, sandvault 1.1.33, nvm, Node v24, Bun 1.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions