Repository navigation
Conversation
dstack v0.6 drops the dev OS image, so there is no built-in SSH or debugging toolset on the CVM anymore. Add a single container that brings them back: - sshd on port 1022 (public-key root login, keys from the encrypted SSH_AUTHORIZED_KEYS env), reachable through dstack-gateway - Debian trixie userland matching the 0.6 guest OS: rsync, sftp, vim, tmux, gdb, strace, tcpdump, htop, docker CLI + compose, ... - shares the host PID, network and UTS namespaces; host root at /host; host Docker daemon via docker.sock - host-shell: nsenter into every namespace of host PID 1 for a real host shell (systemctl, journalctl, ...) /dev/pts is shared with the host so PTYs stay valid after host-shell switches mount namespaces. The SSH host key and /root persist in volumes. Tested on Phala Cloud prod15 with dstack-0.6.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dstack v0.6 no longer ships a dev OS image, so CVMs have no SSH or debugging tools. This adds
dev-box/, a single container you drop into any compose file to get them back.sshdon port 1022, root login with public keys only. Keys come from the encryptedSSH_AUTHORIZED_KEYSenv var, and the container refuses to start without them. Reach it through dstack-gateway with the usualopenssl s_clientProxyCommand.apt-get installworks for anything else./host, anddockerdrives the host daemon.host-shell: runsnsenterinto every namespace of host PID 1 for a real host shell (systemctl,journalctl, …).host-shell CMDruns a single command on the host.The host rootfs is read-only and dm-verity-protected, so tools can't be installed on it. The box brings its own userland and borrows the host's namespaces instead, the same design as Bottlerocket's admin container and
kubectl debug node..github/workflows/build-dev-box.ymlbuildsghcr.io/dstack-tee/dstack-dev-box, following thetsm-shimworkflow: it only builds on PRs and pushes onmain.Warning
This gives full root on the CVM and breaks confidentiality. It's for development only, and the README says so up front.
Test plan
Deployed on Phala Cloud prod15 with
dstack-0.6.1, using an image pushed to ttl.sh:<app-id>-1022.dstack-pha-prod15.phala.network:443dstack-wg0) and the hostnamedstack/hostshows the 0.6.1 rootfs and/host/dstack/app-compose.jsondocker psanddocker compose versionwork against the host daemon (26.1.5 on both ends)host-shellgives the host's bash in/rootwith a working terminal, sharing PID 1's mount namespace;host-shell journalctl -u dockerworksscp,sftpandrsyncwork in both directions/rootcontents and the SSH host key survive a container restart./dev.sh check-allpasses, andshellcheckis clean on the new scripts🤖 Generated with Claude Code