Troubleshooting
Most failures here are disguised: they look like an outage or a bug, and are actually policy doing its job. Start with msbctl show for the sandbox, which lists every rule it emits.
When nothing starts at all, or on a machine you've just installed on, run msbctl doctor first. It checks KVM, msb, disk space, your registry entries and the SSH agent, and prints the fix for each problem (Commands).
"connection refused", a 403 network_policy_denied, a host is unreachable#
It's a missing egress rule until proven otherwise. Don't retry, and don't reach for a proxy or another mirror. An HTTP or HTTPS request refused by the sandbox gets a 403 whose JSON body says "code":"network_policy_denied" and names the domain; anything else simply fails to connect. Find the exact host and port that was refused, then:
$ msbctl allow . that.host.example # :443
$ msbctl allow . that.host.example:22 # another port
$ msbctl rebuild .If the failing URL is http://, use its https:// form instead: plain HTTP is denied for every sandbox, and a project can't override that (see first-match-wins).
If you can't tell what's being refused, use observe mode.
The bootstrap reports "REQUIRED, FAILED"#
Almost always a missing rule, not a broken installer. The bootstrap lists every failed step at once. Read the error above the summary for the host it couldn't reach. Before creating a sandbox, msbctl also warns about install hosts the rules don't cover; the usual missing groups are npm and claude.
The sandbox is still created and left running, so you can look inside with msbctl shell, but it isn't fully set up. msbctl says so in red at the end and exits non-zero, so msbctl rebuild && … stops there. Fix the cause and rebuild. A rebuild removes the old sandbox before creating the new one, so if msb create itself fails (an image it can't pull, a flag it refuses) there is no sandbox until the next successful rebuild or start. The project, the Claude state, package caches and container images are kept either way.
Claude Code: API Error: Connection dropped (ECONNRESET), or a 403 secret_policy_denied#
A fresh session works, then every request fails, permanently. This is the secret policy, not the network (msb answers with a 403 whose JSON says secret_policy_denied where it can, and otherwise drops the connection): the agent has read a token placeholder ($MSB_GH_TOKEN) at some point, and now carries it in every request body, which msb kills.
msbctl binds the placeholder so that it may travel to the agent's own endpoints, which prevents this. A sandbox that still hits it has bindings from an older msb-manager:
$ msbctl observe . # lists secret-policy blocks, even in enforce mode
$ msbctl rebuild . # picks up the current bindingsAllowing the host changes nothing here, because it's not a network block.
Claude Code: "Unable to connect to Anthropic services"#
The sandbox can't reach platform.claude.com, which Claude Code contacts on startup. Both hosts in the claude group are needed: check the project's rule_groups.
Claude Code isn't logged in#
The sandbox's Claude token isn't stored: msbctl show <name> says which one it uses and flags it as NOT STORED. Run msbctl setup → "Claude login" to add it (or claude setup-token on the host and paste the result), or pick a token you have with msbctl edit <name> → "Claude token". A sandbox that started with no token at all has nothing bound, so it needs a restart; msbctl offers one.
pi asks "Trust project folder?", or opens with "What's New"#
Both are questions for a person, and an unattended run stops at the first one. Worse, started by msbctl exec with no terminal, pi answers the trust question by itself — as no — so the project's own .agents/skills/ load nothing. Update the manager and start the sandbox once (msbctl stop then msbctl start): every start trusts the project folder and /tmp in ~/.pi/agent/trust.json, and sets defaultProjectTrust and a changelog marker in ~/.pi/agent/settings.json. /changelog still shows the notes when asked. See pi, the agent for any model.
A name on my LAN returns NXDOMAIN#
msb drops DNS answers that point at private addresses (DNS rebind protection), and the result looks exactly like a missing rule: NXDOMAIN, then a refused connection. Set allow_private_dns = true in the project's .msb/sandbox.toml and rebuild. See DNS resolution is part of the rule.
git commit: "Please tell me who you are"#
The repo has no identity of its own, and there's no host-wide git config inside a microVM. Pick an identity: msbctl edit . → "Identity & autostart". It applies on the next start.
Commits aren't signed#
The identity names a signing_key, but this sandbox isn't allowed that key. msbctl show says so under "Credentials". Allow it with msbctl keys ..
.git/index disappears for a few seconds after a git command#
git status right after a git reset, add or commit in the sandbox shows every file deleted and untracked, then recovers about 5 seconds later. A host editor that watches the repo (zed, or any IDE that polls git) is running git diff on the host. The index records each file's stat details, which differ between the guest and the host, so the host's git rewrites the index straight after the sandbox does. The sandbox's view of the file then goes stale until it expires.
msbctl prevents this by setting core.checkStat=minimal in the .git/config of every repo in the project, on each msbctl shell or exec: the project folder itself and up to two levels under it (repo/, group/repo/, symlinked ones included), skipping node_modules and hidden folders, and the same in every read-write extra mount. A repo that already sets core.checkStat is left alone. Git then compares only mtime and size, which both sides agree on. It has to be .git/config, because that's the one file the host's git and the sandbox's both read; it's per clone and never committed, so no other checkout is affected. A repo cloned since is picked up by the next shell or exec; one removed and cloned again in the same place waits for the sandbox's next start. For one nested deeper, or to cover a fresh clone straight away, run git config core.checkStat minimal in it. GIT_OPTIONAL_LOCKS=0 for the editor doesn't help: git diff ignores it.
It's on by default. git_checkstat = false turns it off: in [defaults] (msbctl setup → "Defaults for new sandboxes") for every sandbox, or in one sandbox's registry entry (msbctl edit . → "Host editor"). Off only stops msbctl adding it; git config --local --unset core.checkStat takes it out of a repo. Sandboxes without a folder never need it: no host editor sees their clone.
To cover repos on this machine that no sandbox has started yet, you can set the same value host-side for a whole folder in your own ~/.gitconfig; msbctl never writes that file:
[includeIf "gitdir:~/workspaces/"]
path = ~/.config/git/sandboxed.incwith [core] checkStat = minimal in ~/.config/git/sandboxed.inc.
git: "detected dubious ownership in repository"#
Inside the sandbox you're root, but the project's files belong to your user on this machine, so git refuses every repo it hasn't been told to trust. The bootstrap trusts the project folder and the repos directly in it, and each msbctl shell or exec adds every repo up to two levels under the project folder and in every extra mount to git's global safe.directory, by name, when it finds one it hasn't seen yet this boot. For a repo cloned during a session, or nested deeper, run git config --global --add safe.directory "$(pwd -P)" in it, or start a new shell.
podman: "boot ID differs from cached boot ID"#
Every podman command fails like this after the sandbox restarts. Podman keeps its runtime state in /run and expects a reboot to empty it, but inside a sandbox /run is part of the disk and survives a stop/start.
msbctl clears that state when it starts the sandbox (msbctl start, shell, exec, the picker), but only if it's left over from an earlier boot, so running containers are never touched. Images, volumes and container definitions are kept. If you started the sandbox some other way (with msb directly), run msbctl shell . once, or delete what podman names yourself: rm -rf /run/containers /run/libpod.
git push over SSH fails#
- Check that the sandbox pushes over ssh at all:
msbctl show .→push. Withghit pushes over https with the GitHub token, whatever the remote says. - Check that the key is the right one for the account: the identity's
push_keyis the only key github.com is offered. - Check that the key is selected:
msbctl keys .. - Check that it's loaded in your host agent (
ssh-add -l). msbctl tries to load selected keys at start, and warns if it can't. - Sandboxes created before the filtered agent existed need one
msbctl rebuild. - The host must already be in your
~/.ssh/known_hosts: it's mounted read-only, so the sandbox can't add a new host.
/memory, git commit or ctrl-g opens nothing#
No editor was set, and the image's code command has no VS Code to hand off to inside the VM. Sandboxes get EDITOR=nano by default. Older ones need a rebuild, or export EDITOR=nano in the shell for now.
Memory use creeps up to the ceiling and stays there#
Guest page cache is never handed back on its own. It's harmless, and msbctl reclaim fixes it in about a second.
The sandbox lost something after a rebuild#
A rebuild keeps your files, the Claude state, package caches and container images, and reinstalls whatever the bootstrap installs. Anything you installed by hand is gone. Put it in [bootstrap] packages or the project's setup script so it comes back every time.
msbctl says "no /dev/kvm"#
msbctl runs on the host. It can't run inside a container, or inside another VM unless that VM has nested virtualization.