Interactive remote debugging
A real terminal into a fresh, isolated VM, for reproducing bugs without touching a shared host
Sometimes a bug only reproduces in a specific environment, a particular kernel, a specific set of installed packages, a fresh boot state, and the fastest way to chase it down is a real shell inside that environment, not a one-shot command. Spinning up a disposable microVM for this is faster and safer than getting a shell on a shared staging box: nobody else’s session gets disturbed, and you throw the whole thing away when you’re done.
The pattern
Bring up an environment that matches the conditions you’re trying to reproduce, then attach an interactive terminal to it directly:
fuse up ./repro/Fusefile --task-id repro-bug-4821
fuse environment shell fuse-repro-bug-4821
root@fuse-repro-bug-4821:~# systemctl status weird-service
root@fuse-repro-bug-4821:~# journalctl -u weird-service --since "10 min ago"
An environment’s id is the orchestrator’s VM prefix (fuse- by default)
plus the task id, so up here prints
creating environment fuse-repro-bug-4821 (task repro-bug-4821). Every
fuse environment subcommand takes that environment id, the task id on its
own is not accepted.
fuse environment shellattaches a real pty to the guest, the same terminal experience as SSH, but relayed over Fuse’s own connection rather than a separate SSH daemon and key setup. It needs a real terminal on your end (raw mode, resize handling), it isn’t meant for scripted use, that’s whatexecis for.- With no trailing command,
shellopens the guest’s login shell. Pass a command after--(fuse environment shell fuse-repro-bug-4821 -- top) to run something specific on a terminal instead of the login shell. - When you’re done, destroy the environment. There’s no cleanup step to forget, the whole reproduction environment, packages and all, goes away with it.
Handing off a session
Because shell is just an interactive attach over Fuse’s own API (master
token required, see Authentication), anyone on the
team with access to the orchestrator can attach to the same running
environment while you’re debugging together, there’s no separate SSH key
distribution to manage for a one-off repro box.
Read next
- Environments for the full lifecycle model.
fuse environment execfor scripted, non-interactive commands instead.