1

I would like to run a single command to attach to a running dev container in a remote ssh host. The current alternative is to use the GUI in the following way:

  • >Remote-SSH: Connect to Host... -> new window -> ssh auth 1
  • >Dev Containers: Attach to Running Container... -> ssh auth 2 -> select container -> new window -> ssh auth 3

I cannot skip the ssh auths since 2FA is enabled. Therefore I must wait some time in between each ssh auth which is not ideal. I know it is possible to connect directly to the running container because when the connection is broken, the window can reconnect directly to the running container without having to go through ssh auth 1 & 2. This means there is some kind of --file-uri that is stored within the window context and it allows it to connect directly.

I am looking for the documentation on how to combine these two commands suggested here and here

code --folder-uri "vscode-remote://ssh-remote+remote_server_goes_here/folder/on/remote/host/here

code --folder-uri="vscode-remote://dev-container%2B${hex}/workspaces/${base}"

I know the name and ID of my running container. So I have unsuccessfully tried:

code --folder-uri "vscode-remote://ssh-remote+<myhost>+attached-container+<mycontainerID>"
code --folder-uri "vscode-remote://ssh-remote+<myhost>+dev-container+<mycontainerID>/<myfolder>"
fcossio
  • 13
  • 3

0 Answers0