I am trying to use VSCode remote development via SSH to manage a Fly machine using VSCode, the use cases are
- Use Fly as rentable GPU machine
- Run scripts inside Fly to get more compute and faster internet connection
The steps I successfully followed are
- Connect my machine to the Fly Wireguard network
- Now I can run
ssh root@app-name.interal
successfully - I tried connecting to the machine with VSCode
Remote SSH: Connect to Host...
- From the logs I saw some commands are missing like curl and ps, install them with
apt-get install -y procps curl
- Now I still get the error
Failed to set up socket for dynamic port forward to remote port 42193: Socket closed. TCP port forwarding may be disabled, or the remote server may have crashed. See the VS Code Server log above for details.
The full logs:
12:13:36.233] Remote server is listening on port 37957
[12:13:36.233] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":37957},"osReleaseId":"debian","arch":"x86_64","sshAuthSock":"","display":"","tmpDir":"/tmp","platform":"linux","execServerToken":"xxx"},"serverStartTime":69,"installUnpackCode":""}
[12:13:36.234] Persisting server connection details to /Users/morse/Library/Application Support/Cursor/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-af572e01-0.113.1-es/data.json
[12:13:36.237] Starting forwarding server. local port 51229 -> socksPort 51226 -> remotePort 37957
[12:13:36.238] Forwarding server listening on port 51229
[12:13:36.238] Waiting for ssh tunnel to be ready
[12:13:36.238] Tunneled port 37957 to local port 51229
[12:13:36.239] Resolved "ssh-remote+minecord-website.internal" to "port 51229"
[12:13:36.245] Initizing new exec server for ssh-remote+minecord-website.internal
[12:13:36.245] Resolving exec server at port 51229
[12:13:36.259] [Forwarding server port 51229] Got connection 0
[12:13:36.259] [Forwarding server port 51229] Got connection 1
[12:13:36.385] stderr> Read from remote host minecord-website.internal: Connection reset by peer
[12:13:36.386] stderr> client_loop: send disconnect: Broken pipe
[12:13:36.387] Failed to set up socket for dynamic port forward to remote port 37957: Socket closed. TCP port forwarding may be disabled, or the remote server may have crashed. See the VS Code Server log above for details.
[12:13:36.387] Failed to set up socket for dynamic port forward to remote port 37957: Socket closed. TCP port forwarding may be disabled, or the remote server may have crashed. See the VS Code Server log above for details.