Closed biltongza closed 2 years ago
What is the value of the SSH_AUTH_SOCK
environment variable in the VS Code terminal when connected to the container?
I guess
SSH_AUTH_SOCK='/tmp/ssh-Q0OMDdVYeQaj/agent.169'
as written in multiple (very long) lines.
In my personal case it is e.g.
SSH_AUTH_SOCK=/tmp/ssh-M7nqQKxApPnk/agent.857
It seems the ssh-agent in the container isn't started automatically and if run manually results in a n+1 pid. How can those be linked together?
We set it to something like /tmp/vscode-ssh-auth-fe4d1d388d72930d47b884373fed6b9bff75b52a.sock
in the container.
Where and how do you start the agent in WSL2? Make sure there is only one instance.
vscode ➜ /workspaces/ldam.co.za (master) $ echo $SSH_AUTH_SOCK
/tmp/vscode-ssh-auth-b5d0849d54173721edb5215e05a23b8ec8ad23ef.sock
I start my ssh-agent with keychain, with this in my .bashrc:
eval $(keychain --eval)
Could you move keychain from .bashrc to .bash_profile in WSL? We use a non-interactive login shell to read the environment variables from WSL.
Not sure if this would explain the pid increase (which must be a new agent), but please try this first.
Yup that seems to have fixed it. Looks like I had tried multiple ways of getting this to work because there was another agent getting started there, removing them all and just sticking to keychain in .bash_profile seems to have done the trick.
Makes sense, thanks.
Continuing from https://github.com/microsoft/vscode-remote-release/issues/4024#issuecomment-912938992
Here are the logs from my session: