Open a shell in a running LXC container (ssh + pct enter) #2

Merged
Duckboot merged 3 commits from feat/lxc-shell into main 2026-11-02 20:44:00 +01:00
3 Commits
Author SHA1 Message Date
DuckbootandClaude Opus 5.5 70bcb9e7b7 Mark the LXC shell interactive test as done in the plan
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 20:43:13 +01:00
DuckbootandClaude Opus 5.5 cccdaf7209 Reset the terminal before opening the LXC shell
Write ESC c, the sequence `reset` sends, inside suspend() right before
ssh. The container shell then starts on a clean screen with no
leftover TUI terminal modes. It runs locally, so the container does
not need `reset` installed and `pct enter` is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 20:41:24 +01:00
DuckbootandClaude Opus 5.5 40feb125b4 Add LXC shell via ssh and pct enter
Press t on a running container to suspend the TUI and run
`ssh -t root@<node> pct enter <vmid>`. cv4pve-cli has no shell or exec
for LXC, so this goes around it and needs key-based root SSH to the
PVE node.

- VMs, stopped containers and busy guests get a warning instead.
- Only exit code 255 (ssh failed) is reported as an error. Other codes
  are the last status of the container's shell.
- OSError is caught inside suspend(). Textual's suspend() has no
  try/finally, so an exception escaping it would leave the app
  suspended.
- The guest table reloads when the shell returns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 20:35:22 +01:00