Open Boulkiess opened 11 months ago
Are you connected to machine1 with Remote-SSH when you run the Dev Containers: Reopen in Container
command? Is the workspace folder with the devcontainer.json on machine1?
Hi, I am indeed connected to machine1 with Remote-SSH. The opened workspace, on machine1, contains a devcontainer/.devcontainer.json file.
The combination of going through Remote-SSH and setting DOCKER_HOST on the SSH server doesn't work at moment and needs investigation.
Maybe in your local SSH config you could configure machine1 as a jumpserver to connect to machine2 and then use Remote-SSH to connect to machine2 directly. From there Dev Containers should also work.
I'm also facing the issue not finding ssh-askpass.bat
on Linux hosts, but I'm using WSL 2. I guess this might be relavent.
Machine OS: Windows 11 WSL 2 OS: Ubuntu 22.04 VSCode installed on Windows, opening a project saved in WSL. With the project opened, I'm trying to open it in devcontainer in a remote Docker.
The remote Docker is set up by adding and setting docker context
, which uses ssh to connect to a remote Linux machine.
I know Docker can't accept username/password, so I set it through ssh-agent
by putting this into .bashrc
:
function _ssh_agent {
if [ -z "$SSH_AGENT_PID" ]; then
eval $(ssh-agent -s)
else
echo "ssh-agent should be running as PID $SSH_AGENT_PID"
fi
}
function _stop_ssh_agent {
if [ -n "$SSH_AGENT_PID" ]; then
eval $(ssh-agent -k)
fi
}
if [ -z "$SSH_AGENT_PID" ]; then
_ssh_agent > /dev/null
ssh-add ~/.ssh/id_rsa > /dev/null
else
echo "ssh-agent should be running as PID $SSH_AGENT_PID"
fi
trap _stop_ssh_agent EXIT
This is the log when creating dev container:
(I've removed the remote user name to <remote-user-name>
and removed the remote address to <remote-addr>
)
[12 ms] Dev Containers 0.348.0 in VS Code 1.87.0 (019f4d1419fbc8219a181fab7892ebccf7ee29a2).
[12 ms] Start: Run: wsl -d ubuntu-22.04 -e /bin/sh -c cd '/home/tim/grpc_ts_example' && /bin/sh
[23 ms] Start: Run in host: id -un
[151 ms] tim
[151 ms]
[152 ms] Start: Run in host: (command -v getent >/dev/null 2>&1 && getent passwd 'tim' || grep -E '^tim|^[^:]*:[^:]*:tim:' /etc/passwd || true)
[155 ms] Start: Run in host: echo ~
[155 ms] /home/tim
[155 ms]
[156 ms] Start: Run in host: test -x '/home/tim/.vscode-remote-containers/bin/019f4d1419fbc8219a181fab7892ebccf7ee29a2/node'
[157 ms]
[157 ms]
[157 ms] Start: Run in host: test -f '/home/tim/.vscode-remote-containers/dist/vscode-remote-containers-server-0.348.0.js'
[158 ms]
[158 ms]
[160 ms] userEnvProbe: loginInteractiveShell (default)
[160 ms] userEnvProbe: not found in cache
[160 ms] userEnvProbe shell: /usr/bin/zsh
[1777 ms] userEnvProbe PATHs:
Probe: '/home/tim/miniconda3/condabin:/home/tim/.bun/bin:/home/tim/.zplug/repos/zplug/zplug/bin:/home/tim/.zplug/bin:/home/tim/.nvm/versions/node/v18.19.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/Microsoft VS Code/bin:/mnt/c/Program Files/dotnet:/mnt/c/Program Files (x86)/ZeroTier/One:/mnt/c/Program Files/usbipd-win:/Docker/host/bin:/mnt/c/Users/timsu/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/timsu/Documents/which.exe:/mnt/c/Users/timsu/Documents/ffmpeg/bin:/mnt/c/Users/timsu/AppData/Local/GitHubDesktop/bin:/mnt/c/Users/timsu/AppData/Roaming/Code/User/globalStorage/ms-vscode-remote.remote-containers/cli-bin:/home/tim/.local/bin:/home/tim/.bun/bin:/snap/bin:/usr/local/cuda/bin:/usr/local/go/bin:/home/tim/.fzf/bin'
Container: None
[470937 ms] Start: Run: wsl -d ubuntu-22.04 -e /bin/sh -c cd '/home/tim/grpc_ts_example' && /bin/sh
[470952 ms] Start: Run in host: id -un
[471089 ms] tim
[471089 ms]
[471090 ms] Start: Run in host: (command -v getent >/dev/null 2>&1 && getent passwd 'tim' || grep -E '^tim|^[^:]*:[^:]*:tim:' /etc/passwd || true)
[471092 ms] Start: Run in host: echo ~
[471093 ms] /home/tim
[471093 ms]
[471093 ms] Start: Run in host: test -x '/home/tim/.vscode-remote-containers/bin/019f4d1419fbc8219a181fab7892ebccf7ee29a2/node'
[471094 ms]
[471094 ms]
[471094 ms] Start: Run in host: test -f '/home/tim/.vscode-remote-containers/dist/vscode-remote-containers-server-0.348.0.js'
[471096 ms]
[471096 ms]
[471097 ms] userEnvProbe: loginInteractiveShell (default)
[471097 ms] userEnvProbe: not found in cache
[471097 ms] userEnvProbe shell: /usr/bin/zsh
[473100 ms] Start: Run in Host: /bin/sh
[473102 ms] Start: Run in container: for pid in `cd /proc && ls -d [0-9]*`; do { echo $pid ; readlink /proc/$pid/cwd || echo ; readlink /proc/$pid/ns/mnt || echo ; cat /proc/$pid/stat | tr "
[473105 ms] userEnvProbe PATHs:
Probe: '/home/tim/miniconda3/condabin:/home/tim/.bun/bin:/home/tim/.zplug/repos/zplug/zplug/bin:/home/tim/.zplug/bin:/home/tim/.nvm/versions/node/v18.19.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/Microsoft VS Code/bin:/mnt/c/Program Files/dotnet:/mnt/c/Program Files (x86)/ZeroTier/One:/mnt/c/Program Files/usbipd-win:/Docker/host/bin:/mnt/c/Users/timsu/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/timsu/Documents/which.exe:/mnt/c/Users/timsu/Documents/ffmpeg/bin:/mnt/c/Users/timsu/AppData/Local/GitHubDesktop/bin:/mnt/c/Users/timsu/AppData/Roaming/Code/User/globalStorage/ms-vscode-remote.remote-containers/cli-bin:/home/tim/.local/bin:/home/tim/.bun/bin:/snap/bin:/usr/local/cuda/bin:/usr/local/go/bin:/home/tim/.fzf/bin'
Container: None
[473173 ms] Start: Run in Host: docker version --format {{json .}}
[473307 ms] userEnvProbe is taking longer than 2 seconds. Process not found.
[474701 ms] error during connect: Get "http://docker.example.com/v1.24/version": command [ssh -o ConnectTimeout=30 -l <remote-user-name> -- <remote-addr> docker system dial-stdio] has exited with exit status 255, please make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=ssh_askpass: exec(c:\\Users\\timsu\\.vscode\\extensions\\ms-vscode-remote.remote-containers-0.348.0\\scripts\\ssh-askpass.bat): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(c:\\Users\\timsu\\.vscode\\extensions\\ms-vscode-remote.remote-containers-0.348.0\\scripts\\ssh-askpass.bat): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(c:\\Users\\timsu\\.vscode\\extensions\\ms-vscode-remote.remote-containers-0.348.0\\scripts\\ssh-askpass.bat): No such file or directory
<remote-user-name>@<remote-addr>: Permission denied (publickey,password).
[474702 ms] {"Client":{"CloudIntegration":"v1.0.35+desktop.11","Version":"25.0.3","ApiVersion":"1.44","DefaultAPIVersion":"1.44","GitCommit":"4debf41","GoVersion":"go1.21.6","Os":"linux","Arch":"amd64","BuildTime":"Tue Feb 6 21:13:00 2024","Context":"aiec"},"Server":null}
[474706 ms] Exit code 1
From the log, I noticed some things:
askpass.bat
in Windows, and the file indeed exists there. So I guess it's trying to do this in the WSL environment, which should accessing Windows files through /mnt/c/...
and should execute ssh-askpass.sh
docker.explorerRefreshInterval
to a higher value. However, this settings doesn't seem to be exist as I can't find it in GUI settings, and putting this in settings.json
shows dimmed color. As a result, we can see the response is too late in the log.I'm sure the SSH set in WSL is correct, as running docker info
shows info of remote Docker
Hi, in the context of my work, I am trying to setup VS Code to use dev containers. I am new to Docker and the dev containers, and overcame numerous obstacles to end up here, but this time I think the problem comes from the Dev Containers extension.
Some precisions: machine1 is an interactive machine on which one can connect as himself, with his own username. On machine2 though, people must use shared users, or bots, which do not have passwords ; they can only connect if their SSH key is registered on machine2 and they use the right bot.
Steps to Reproduce:
Does this issue occur when you try this locally?: No Does this issue occur when you try this locally and all extensions are disabled?: No