I have done the following
Steps to reproduce
- Start a container with a bind mount: container run -d --name test0 -v :/code ubuntu:latest
- Install openssh-server inside it and configure key-based SSH access.
- Connect via SSH (e.g. VS Code Remote-SSH, or plain
ssh). This first connection works fine.
- Disconnect (e.g. restart VS Code, or point Remote-SSH at a different folder within the same container).
- Attempt to reconnect via SSH, or run
container exec -it test0 bash directly.
- The exec/SSH session hangs indefinitely — no prompt, no error, no timeout.
container stop test0 also hangs with no output.
container list --all continues to report the container as "running" throughout.
In a second occurrence the same session, container system stop also hung (log showed stopTimeoutSeconds=5 ... stopping containers then nothing further — the stated timeout was not enforced), and launchctl kickstart -k <container-apiserver-label> did not recover it either. A full macOS restart was the only thing that restored a working state.
Separately, ps aux showed multiple stuck container exec client processes accumulated from repeated attempts (none had exited on their own), while container-runtime-linux and container-apiserver processes appeared healthy — suggesting the hang is in the exec/PTY session layer, not the VM or daemon itself. ping to the affected container's IP succeeded instantly while exec was hung, ruling out a network-layer cause.
Problem description
container exec (and subsequently container stop / container system stop) can hang indefinitely, specifically triggered by reconnecting to a container via SSH/exec — the first connection after starting/configuring the container works fine, but a second or later connection attempt reliably triggers the hang. This suggests something isn't being cleaned up when an exec/SSH session ends, and the leftover state blocks the next session.
Separately, container list --all reported a container as "running" while container exec on that same container immediately failed with cannot exec: container is not running — a state-tracking inconsistency between the two commands.
Expected behavior: exec/SSH sessions should be able to reconnect repeatedly without hanging, and container stop should always respect its stated timeout rather than hanging indefinitely and requiring a full OS restart to recover.
Environment
* OS: macOS 26.5.2 (Tahoe)
* Hardware: Apple Silicon (M4)
* Container: Container CLI version 1.1.0 (installed via Homebrew)
* Image: docker.io/library/ubuntu:latest (Ubuntu 26.04 LTS, arm64)
Code of Conduct
I have done the following
Steps to reproduce
ssh). This first connection works fine.container exec -it test0 bashdirectly.container stop test0also hangs with no output.container list --allcontinues to report the container as "running" throughout.In a second occurrence the same session,
container system stopalso hung (log showedstopTimeoutSeconds=5 ... stopping containersthen nothing further — the stated timeout was not enforced), andlaunchctl kickstart -k <container-apiserver-label>did not recover it either. A full macOS restart was the only thing that restored a working state.Separately,
ps auxshowed multiple stuckcontainer execclient processes accumulated from repeated attempts (none had exited on their own), whilecontainer-runtime-linuxandcontainer-apiserverprocesses appeared healthy — suggesting the hang is in the exec/PTY session layer, not the VM or daemon itself.pingto the affected container's IP succeeded instantly whileexecwas hung, ruling out a network-layer cause.Problem description
container exec (and subsequently container stop / container system stop) can hang indefinitely, specifically triggered by reconnecting to a container via SSH/exec — the first connection after starting/configuring the container works fine, but a second or later connection attempt reliably triggers the hang. This suggests something isn't being cleaned up when an exec/SSH session ends, and the leftover state blocks the next session.
Separately,
container list --allreported a container as "running" whilecontainer execon that same container immediately failed withcannot exec: container is not running— a state-tracking inconsistency between the two commands.Expected behavior: exec/SSH sessions should be able to reconnect repeatedly without hanging, and container stop should always respect its stated timeout rather than hanging indefinitely and requiring a full OS restart to recover.
Environment
Code of Conduct