Repository navigation
Closed
Labels
*questionIssue represents a question, should be posted to StackOverflow (VS Code)Issue represents a question, should be posted to StackOverflow (VS Code)containersIssue in vscode-remote containersIssue in vscode-remote containers
Description
- VSCode Version: 1.65.0-insider
- Local OS Version: Windows 10 - 19044.1526
- Remote OS Version: Ubuntu-20.04
- Remote Extension/Connection Type: Docker
Logs
[48 ms] Remote-Containers 0.223.0 in VS Code 1.65.0-insider (8440b8f47231147823ba9696913d642e5f2d9d58).
[48 ms] Start: Resolving Remote
[58 ms] Setting up container for folder or workspace: c:\Users\Archie.Atkinson\Documents\fw-cicd-test
[61 ms] Start: Check Docker is running
[61 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[287 ms] Server API version: 1.41
[345 ms] Start: Run: docker-compose version --short
[768 ms] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=fw-cicd-test --filter label=com.docker.compose.service=dev_env
[1043 ms] Start: Run: docker inspect --type container 832a8b4a9f65
[1325 ms] Start: Inspecting container
[1325 ms] Start: Run: docker inspect --type container 832a8b4a9f65be633132137e425906f5434c919943cb5b0e0cdd42820c8caf78
[1634 ms] Start: Run in container: /bin/sh
[1655 ms] Start: Run in container: uname -m
[2049 ms] x86_64
[2049 ms]
[2049 ms] Start: Run in container: (cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null
[2051 ms] NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
[2051 ms]
[2052 ms] Start: Run in container: cat /etc/passwd
[2054 ms] Start: Setup shutdown monitor
[2054 ms] Forking shutdown monitor: c:\Users\Archie.Atkinson\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.223.0\dist\shutdown\shutdownMonitorProcess \\.\pipe\vscode-remote-containers-8b189b7a2d17a4f8f04c4fc8c9a516de871efd13-sock dockerCompose Debug c:\Users\Archie.Atkinson\AppData\Roaming\Code - Insiders\logs\20220226T201903\exthost1\ms-vscode-remote.remote-containers 1645906946410
[2068 ms] Start: Run in container: test -d /root/.vscode-server-insiders
[2071 ms]
[2072 ms]
[2072 ms] Start: Run in container: test -f '/var/vscode-server-insiders/.patchEtcEnvironmentMarker'
[2073 ms]
[2073 ms]
[2073 ms] Start: Run in container: test -f '/var/vscode-server-insiders/.patchEtcProfileMarker'
[2074 ms]
[2074 ms]
[2074 ms] Start: Run in container: test ! -f '/root/.vscode-server-insiders/data/Machine/.writeMachineSettingsMarker' && set -o noclobber && mkdir -p '/root/.vscode-server-insiders/data/Machine' && { > '/root/.vscode-server-insiders/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[2076 ms]
[2076 ms]
[2076 ms] Exit code 1
[2077 ms] Start: Run in container: cat /root/.vscode-server-insiders/data/Machine/settings.json
[2079 ms]
[2080 ms] cat: /root/.vscode-server-insiders/data/Machine/settings.json: No such file or directory
[2080 ms] Exit code 1
[2080 ms] Start: Run in container: test -d /root/.vscode-server-insiders/bin/8440b8f47231147823ba9696913d642e5f2d9d58-insider
[2082 ms]
[2082 ms]
[2083 ms] Start: Launching Remote-Containers helper.
[2083 ms] ssh-agent: SSH_AUTH_SOCK in container (/tmp/vscode-ssh-auth-2db8e5f259970f6c563e109d26b0442bdd2c87bc.sock) forwarded to local host (\\.\pipe\openssh-ssh-agent).
[2083 ms] Start: Run: gpgconf --list-dir agent-extra-socket
[2102 ms] findLocalWindowsExecutable: Exectuable 'gpgconf' not found on PATH 'C:\Program Files\Google\Chrome\Application;C:\Program Files (x86)\VMware\VMware Workstation\bin\;C:\Python310\Scripts\;C:\Python310\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\CMake\bin;C:\HashiCorp\Vagrant\bin;C:\Program Files\usbipd-win\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin\;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\Archie.Atkinson\AppData\Local\Microsoft\WindowsApps;C:\Users\Archie.Atkinson\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files (x86)\GitHub CLI\;C:\Program Files (x86)\GnuWin32\bin;C:\Python310;C:\Program Files\SEGGER\JLink;C:\msys64\mingw64\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\CMake\bin;C:\Program Files\PostgreSQL\14\bin;C:\nrfutil;'.
[2105 ms] Start: Run in container: /bin/sh
[2106 ms] userEnvProbe: loginInteractiveShell (default)
[2106 ms] userEnvProbe shell: /bin/bash
[2109 ms] Start: Run in container: # Test for /root/.ssh/known_hosts and ssh
[2111 ms] /root/.ssh/known_hosts exists
[2111 ms]
[2111 ms] Exit code 1
[2111 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --system --replace-all credential.helper '!f() { /root/.vscode-server-insiders/bin/8440b8f47231147823ba9696913d642e5f2d9d58-insider/node /tmp/vscode-remote-containers-2db8e5f259970f6c563e109d26b0442bdd2c87bc.js $*; }; f' || true
[2115 ms]
[2116 ms]
[2116 ms] Start: Preparing Extensions
[2116 ms] Start: Run in container: test ! -f '/root/.vscode-server-insiders/data/Machine/.installExtensionsMarker' && set -o noclobber && mkdir -p '/root/.vscode-server-insiders/data/Machine' && { > '/root/.vscode-server-insiders/data/Machine/.installExtensionsMarker' ; } 2> /dev/null
[2117 ms]
[2117 ms]
[2117 ms] Exit code 1
[2119 ms] Extensions cache, install extensions: None
[2120 ms] Start: Run in container: test -d /root/.vscode-server-insiders/extensionsCache && ls /root/.vscode-server-insiders/extensionsCache || true
[2123 ms] llvm-vs-code-extensions.vscode-clangd-0.1.15
ms-vscode.cmake-tools-1.9.2
twxs.cmake-0.0.17
xaver.clang-format-1.9.0
yzhang.markdown-all-in-one-3.4.0
[2123 ms]
[2124 ms] Extensions cache, copy to remote: None
[2124 ms] Start: Run in container: for pid in `cd /proc && ls -d [0-9]*`; do { echo $pid ; readlink /proc/$pid/cwd ; readlink /proc/$pid/ns/mnt ; cat /proc/$pid/stat | tr "
[2168 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-2db8e5f259970f6c563e109d26b0442bdd2c87bc.js' >/tmp/vscode-remote-containers-2db8e5f259970f6c563e109d26b0442bdd2c87bc.js
[2187 ms] Start: Run in container: cat '/root/.vscode-server-insiders/data/Machine/.connection-token-8440b8f47231147823ba9696913d642e5f2d9d58-insider' 2>/dev/null || (umask 377 && echo '92ed85b6-5222-4af9-a5ab-e0d1ec17b334' >'/root/.vscode-server-insiders/data/Machine/.connection-token-8440b8f47231147823ba9696913d642e5f2d9d58-insider-800d9524-54d8-4ac9-a877-bc9775e4c566' && mv -n '/root/.vscode-server-insiders/data/Machine/.connection-token-8440b8f47231147823ba9696913d642e5f2d9d58-insider-800d9524-54d8-4ac9-a877-bc9775e4c566' '/root/.vscode-server-insiders/data/Machine/.connection-token-8440b8f47231147823ba9696913d642e5f2d9d58-insider' && rm -f '/root/.vscode-server-insiders/data/Machine/.connection-token-8440b8f47231147823ba9696913d642e5f2d9d58-insider-800d9524-54d8-4ac9-a877-bc9775e4c566' && cat '/root/.vscode-server-insiders/data/Machine/.connection-token-8440b8f47231147823ba9696913d642e5f2d9d58-insider')
[2189 ms] fae685df-0f34-4af5-9919-436dab465a78
[2189 ms]
[2190 ms] Start: Starting VS Code Server
[2564 ms]
[2565 ms]
[2565 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-server-2db8e5f259970f6c563e109d26b0442bdd2c87bc.js' >/tmp/vscode-remote-containers-server-2db8e5f259970f6c563e109d26b0442bdd2c87bc.js_1645906948975
[2567 ms]
[2567 ms]
[2570 ms] Start: Run in Container: /root/.vscode-server-insiders/bin/8440b8f47231147823ba9696913d642e5f2d9d58-insider/bin/code-server-insiders --log debug --force-disable-user-env --server-data-dir /root/.vscode-server-insiders --use-host-proxy --accept-server-license-terms --host 127.0.0.1 --port 0 --connection-token-file /root/.vscode-server-insiders/data/Machine/.connection-token-8440b8f47231147823ba9696913d642e5f2d9d58-insider --extensions-download-dir /root/.vscode-server-insiders/extensionsCache --start-server --disable-websocket-compression
[2643 ms] userEnvProbe PATHs:
Probe: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
Container: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
[2645 ms] *
* Visual Studio Code Server
*
* By using the software, you agree to
* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
*
[2650 ms] Server bound to 127.0.0.1:42085 (IPv4)
Extension host agent listening on 42085
[2651 ms] Start: Run in container: echo 42085 >'/root/.vscode-server-insiders/data/Machine/.devport-8440b8f47231147823ba9696913d642e5f2d9d58-insider'
[2652 ms]
[2653 ms]
[2653 ms] Port forwarding for container port 42085 starts listening on local port.
[2654 ms] Port forwarding local port 42085 to container port 42085
[2654 ms] Start: Run in container: mkdir -p '/root/.vscode-server-insiders/data/Machine' && CONTENT="$(cat '/root/.vscode-server-insiders/data/Machine/.onCreateCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2022-02-26T20:12:05.315482743Z}" != '2022-02-26T20:12:05.315482743Z' ] && echo '2022-02-26T20:12:05.315482743Z' > '/root/.vscode-server-insiders/data/Machine/.onCreateCommandMarker'
[2658 ms]
[2658 ms]
[2658 ms] Exit code 1
[2658 ms] Start: Run in container: mkdir -p '/root/.vscode-server-insiders/data/Machine' && CONTENT="$(cat '/root/.vscode-server-insiders/data/Machine/.updateContentCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2022-02-26T20:12:05.315482743Z}" != '2022-02-26T20:12:05.315482743Z' ] && echo '2022-02-26T20:12:05.315482743Z' > '/root/.vscode-server-insiders/data/Machine/.updateContentCommandMarker'
[2662 ms]
[2663 ms]
[2663 ms] Exit code 1
[2663 ms] Start: Run in container: mkdir -p '/root/.vscode-server-insiders/data/Machine' && CONTENT="$(cat '/root/.vscode-server-insiders/data/Machine/.postCreateCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2022-02-26T20:12:05.315482743Z}" != '2022-02-26T20:12:05.315482743Z' ] && echo '2022-02-26T20:12:05.315482743Z' > '/root/.vscode-server-insiders/data/Machine/.postCreateCommandMarker'
[2667 ms]
[2667 ms]
[2667 ms] Exit code 1
[2667 ms] Start: Run in container: # Test for /root/.gitconfig and git
[2669 ms] /root/.gitconfig exists
[2669 ms]
[2669 ms] Exit code 1
[2669 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --global --replace-all credential.helper '!f() { /root/.vscode-server-insiders/bin/8440b8f47231147823ba9696913d642e5f2d9d58-insider/node /tmp/vscode-remote-containers-2db8e5f259970f6c563e109d26b0442bdd2c87bc.js $*; }; f' || true
[2675 ms] Port forwarding connection from 63418 > 42085 > 42085 in the container.
[2675 ms] Start: Run in container: /root/.vscode-server-insiders/bin/8440b8f47231147823ba9696913d642e5f2d9d58-insider/node -e
[2676 ms]
[2676 ms]
[2676 ms] Start: Run in container: mkdir -p '/root/.vscode-server-insiders/data/Machine' && CONTENT="$(cat '/root/.vscode-server-insiders/data/Machine/.postStartCommandMarker' 2>/dev/null || echo ENOENT)" && [ "${CONTENT:-2022-02-26T20:20:52.62224788Z}" != '2022-02-26T20:20:52.62224788Z' ] && echo '2022-02-26T20:20:52.62224788Z' > '/root/.vscode-server-insiders/data/Machine/.postStartCommandMarker'
[2680 ms]
[2680 ms]
[2680 ms] Exit code 1
[2796 ms] [20:22:29] Extension host agent started.
[3173 ms] Port forwarding connection from 50442 > 42085 > 42085 in the container.
[3174 ms] Start: Run in container: /root/.vscode-server-insiders/bin/8440b8f47231147823ba9696913d642e5f2d9d58-insider/node -e
[3176 ms] [20:22:29] [127.0.0.1][d62e6d15][ManagementConnection] New connection established.
[4188 ms] [20:22:30] [127.0.0.1][b7e9f06c][ExtensionHostConnection] New connection established.
[4192 ms] [20:22:30] [127.0.0.1][b7e9f06c][ExtensionHostConnection] <1428> Launched Extension Host Process.
[5046 ms] Port forwarding connection from 58657 > 42085 > 42085 in the container.
[5047 ms] Start: Run in container: /root/.vscode-server-insiders/bin/8440b8f47231147823ba9696913d642e5f2d9d58-insider/node -e
[10517 ms] Port forwarding 58657 > 42085 > 42085 stderr: Remote close
[10557 ms] Port forwarding 58657 > 42085 > 42085 terminated with code 0 and signal null.
[12145 ms] Extensions cache, remote removals: None
[72152 ms] Extensions cache, remote removals: None
[130565 ms] Port forwarding 58657 > 42085 > 42085: Local close with error
[132162 ms] Extensions cache, remote removals: None
Steps to Reproduce:
- Follow the instructions provided in the documentation
- Open your container in VSCode
- Run
ssh-add -lin the Container, response withThe agent has no identities.
Same symptoms as #5604 but the solution didn't work.
Here's is the current setup:
WSL2
~/.bash_profile contains: eval $(keychain --eval)
$:ssh-add -l returns my ssh key.
$:ssh -T git@github.com returns: Hi Archie-Elvie! You've successfully authenticated, but GitHub does not provide shell access.
$: ps ax | grep ssh-agent returns a single ssh-agent process.
Container
$:ssh-add -l returns: The agent has no identities.
$:echo $SSH_AUTH_SOCK returns: /tmp/vscode-ssh-auth-2db8e5f259970f6c563e109d26b0442bdd2c87bc.sock
ssh -T git@github.com returns: git@github.com: Permission denied (publickey).
Let me know if you need more information.
Metadata
Metadata
Assignees
Labels
*questionIssue represents a question, should be posted to StackOverflow (VS Code)Issue represents a question, should be posted to StackOverflow (VS Code)containersIssue in vscode-remote containersIssue in vscode-remote containers
Activity
[-]WSL2 Host - Sharing Git credentials with your container - ssh-agent not forwarding to remote[/-][+]WSL2 Host - Sharing Git credentials with your container - ssh-agent not forwarding to remote correctly[/+]chrmarti commentedon Feb 28, 2022
Could you post your log after you connected to the dev container? (
F1>Remote-Containers: Show Container Log)Archie-Elvie commentedon Feb 28, 2022
chrmarti commentedon Mar 1, 2022
It is forwarding to the ssh-agent on Windows (
local host):I see you are opening a Windows folder, we only use Windows-side tools for this by default. Try enabling the Execute In WSL setting:

Archie-Elvie commentedon Mar 1, 2022
Enabling that gives this error when I rebuild:
I have the windows ssh-agent working correctly as well so I'm happy to forward either one. Which ever is simpler.
chrmarti commentedon Mar 2, 2022
Does
ssh-add -lon Windows list your keys? You might have to start the ssh-agent on Windows first.Archie-Elvie commentedon Mar 2, 2022
ssh-add -lreturnsThe agent has no identities.Howeverssh -T git@github.comreturnsHi Archie-Elvie! You've successfully authenticated, but GitHub does not provide shell access..Get-Service ssh-agentshows it running correctly.I added my ssh key and it working correctly. I am able to use git correctly in my container.
Thank you for your help.
Do you know git worked in PowerShell without a key added?
chrmarti commentedon Mar 7, 2022
I guess your private key is unencrypted on disk, so
sshcan use it without you adding it to thessh-agentor asking you for a passphrase. Thessh-agentprobably (haven't checked the docs) does not use unencrypted private keys that have not been added withssh-addfirst.Closing as resolved, thanks.
shadycuz commentedon Mar 19, 2022
Christof Marti (@chrmarti) I'm having a very similar error. My devcontainer used to work, but no longer does. It seems to have switched from getting its credentials from Windows instead of the WSL2.
I don't really want to add my credentials to windows? How can I make my devcontainer work again with the credentials (ssh keys) from WSL2?
Should I make a new issue?
Thanks
EDIT: Fixed it with a lot of weird hackery
chrmarti commentedon Mar 22, 2022
Levi (@shadycuz) It should use the ssh-agent in WSL when there is one.