microsoft / microsoft/vscode-remote-release

Gpg agent not forwarded when using devcontainer through remote-ssh

Open
#7,814 27 comments 4 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Jan 13, 2023.

containers feature-request
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

  • VSCode Version: 1.75.0-insider (system setup)
  • Local OS Version: Windows_NT x64 10.0.22621
  • Remote OS Version: Ubuntu 22.04 LTS
  • Remote Extension/Connection Type: Containers

Connection to dev Container through remote-ssh extension. GPG-Agent is missing inside the devcontainer.

  • Logs:
[11294 ms] Start: Run in container: touch '/vscode/vscode-server-insiders/bin/linux-x64/04b15ff231a2c3cfcdd90d90c16075a9c1e6da15-insider' && cd '/vscode/vscode-server-insiders/bin/linux-x64' && ls -td *[^_]????????????? | tail -n +10 | xargs rm -rf
[11294 ms] Start: Launching Dev Containers helper.
[11295 ms] ssh-agent: SSH_AUTH_SOCK in container (/tmp/vscode-ssh-auth-1fbbda1635b81e7d55a900b2a7d0dbb45d0607da.sock) forwarded to local host (\\.\pipe\openssh-ssh-agent).
[11295 ms] X11 forwarding: DISPLAY not set on host.
[11296 ms] Start: Run in Host: gpgconf --list-dir agent-extra-socket
[11306 ms] /run/user/1000/gnupg/S.gpg-agent.extra
[11306 ms] 
[11306 ms] Start: Run in container: gpgconf --list-dir agent-socket
[11309 ms] /home/vscode/.gnupg/S.gpg-agent

You can see the ssh-agent being forwarded from the windows host.
The gpg-agent socket is being looked up on the remote linux host, instead of on the windows host.

Comparison: DevContainer used via docker context:

[2693 ms] Start: Run in container: touch '/vscode/vscode-server/bin/linux-x64/e8a3071ea4344d9d48ef8a4df2c097372b0c5161'
[2693 ms] Start: Launching Dev Containers helper.
[2693 ms] ssh-agent: SSH_AUTH_SOCK in container (/tmp/vscode-ssh-auth-7e3a446ef6b9db23fe750a7e37db5bc8f2686e1a.sock) forwarded to local host (\\.\pipe\openssh-ssh-agent).
[2694 ms] X11 forwarding: DISPLAY not set on host.
[2694 ms] Start: Run: gpgconf --list-dir agent-extra-socket
[2696 ms] 
[2696 ms] 
[2738 ms] C:\Users\max06\AppData\Local\gnupg\S.gpg-agent.extra
[2738 ms] 
[2738 ms] Start: Run in container: gpgconf --list-dir agent-socket
[2744 ms] /root/.gnupg/S.gpg-agent

Steps to Reproduce:

  1. Open remote-ssh-connection to Docker-Host.
  2. Open DevContainer on remote Host
  3. Run gpg2 --list-secret-keys --keyid-format long --verbose - it should list at least something

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

Happy to provide information as requested.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.