What happened
I added entries to ~/.agent-vm/volumes (extra host mounts), then ran agent-vm shell --reset on an existing per-project VM to pick them up. The reset completed with no errors or warnings, but inside the VM only the project directory was mounted — none of the ~/.agent-vm/volumes entries showed up (e.g. /home/caillou.linux/.claude, /home/caillou.linux/Pictures/Screenshots were both empty/missing).
Root cause
In _agent_vm_run (the VM-creation path), the mounts JSON is applied like this:
mounts_json=$(_agent_vm_build_mounts_json "$vm_name" "$host_dir")
local edit_args=()
edit_args+=(--set ".mounts = ${mounts_json}")
[[ -n "$memory" ]] && edit_args+=(--memory "$memory")
[[ -n "$cpus" ]] && edit_args+=(--cpus "$cpus")
(cd /tmp && limactl edit "$vm_name" "${edit_args[@]}") &>/dev/null
_agent_vm_build_mounts_json itself produced correct JSON (verified separately — all volumes entries were parsed and included with the right location/mountPoint/writable fields). But the limactl edit ... &>/dev/null call that applies it swallows all output, including errors. In my case this limactl edit apparently failed on the first --reset (I can't tell why — no error was ever surfaced), leaving the VM with a bare lima.yaml .mounts array containing only the project directory.
I confirmed this by:
- Stopping the VM.
- Manually re-running the exact same
limactl edit "$vm_name" --set ".mounts = <the same JSON>" command that _agent_vm_run had already run during --reset.
- This second attempt succeeded and applied the mounts correctly —
limactl edit reported "configuration edited" with no error, and the mounts showed up correctly on the next VM start.
So the same command failed once and succeeded once, with identical inputs, and the first failure was completely silent because of &>/dev/null.
Suggested fix
Don't swallow stderr on the mount-applying limactl edit calls during VM creation (and the self-heal/repair path at a similar call site). At minimum, check the exit code and print a clear error (similar to how the existing project-mount writability check already fails loudly) so a failed ~/.agent-vm/volumes application doesn't silently leave the user with a VM missing all their extra mounts.
Environment
- Host: Linux (Lima + QEMU backend)
- agent-vm: latest
main as of this report (includes the recent "mount guard-rails" commit a80ae34)
What happened
I added entries to
~/.agent-vm/volumes(extra host mounts), then ranagent-vm shell --reseton an existing per-project VM to pick them up. The reset completed with no errors or warnings, but inside the VM only the project directory was mounted — none of the~/.agent-vm/volumesentries showed up (e.g./home/caillou.linux/.claude,/home/caillou.linux/Pictures/Screenshotswere both empty/missing).Root cause
In
_agent_vm_run(the VM-creation path), the mounts JSON is applied like this:_agent_vm_build_mounts_jsonitself produced correct JSON (verified separately — all volumes entries were parsed and included with the rightlocation/mountPoint/writablefields). But thelimactl edit ... &>/dev/nullcall that applies it swallows all output, including errors. In my case thislimactl editapparently failed on the first--reset(I can't tell why — no error was ever surfaced), leaving the VM with a barelima.yaml.mountsarray containing only the project directory.I confirmed this by:
limactl edit "$vm_name" --set ".mounts = <the same JSON>"command that_agent_vm_runhad already run during--reset.limactl editreported "configuration edited" with no error, and the mounts showed up correctly on the next VM start.So the same command failed once and succeeded once, with identical inputs, and the first failure was completely silent because of
&>/dev/null.Suggested fix
Don't swallow stderr on the mount-applying
limactl editcalls during VM creation (and the self-heal/repair path at a similar call site). At minimum, check the exit code and print a clear error (similar to how the existing project-mount writability check already fails loudly) so a failed~/.agent-vm/volumesapplication doesn't silently leave the user with a VM missing all their extra mounts.Environment
mainas of this report (includes the recent "mount guard-rails" commita80ae34)