Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
bjoernb
3 months agoNew Contributor
Win11 -> WSL2 -> devcontainer ssh-add not accessible anymore
Hi all, I'm working on Windows 11 Pro, where 1 Password in the latest stable version is installed. I have WSL2 enabled with Ubuntu 24.04 installed and inside there I have docker installed to run dev...
- 3 months ago
Thanks for triggering this issue, it's the VS Code update, downgrading VS Code solves it for me. To be tracked here: https://github.com/microsoft/vscode/issues/251456
So for future reference: On the Windows host, the 1Password ssh agent has to be activated in the settings of 1Password. gitconfig should be extended and aliases in WSL should be created, like mentioned here: https://developer.1password.com/docs/ssh/integrations/wsl
That's it, then ssh keys from 1Password on Windows should be accessible in Windows, WSL and inside devcontainers. In WSL the SSH_AUTH_SOCK variable is empty. When starting a devcontainer, VSCode will create a socket and this should be visible in the logs (F1 > Dev Containers: Show Container Log)
[886954 ms] Start: Launching Dev Containers helper. [886955 ms] ssh-agent: SSH_AUTH_SOCK not set on wsl host. [886955 ms] ssh-agent: SSH_AUTH_SOCK not set on local host. [886955 ms] ssh-agent: SSH_AUTH_SOCK in container (/tmp/vscode-ssh-auth-19e6a8e3-90b7-4bf3-bb6f-98aa4e871c30.sock) forwarded to local host (\\.\pipe\openssh-ssh-agent).
Even commit signing will work with this infrastructure in Windows, WSL and devcontainer. It's pretty awesome when it works.
manski
3 months agoNew Contributor
On a hunch, I tried to call "ssh-add -l" directly on WSL (Ubuntu) - and it's not working there either. So, for me at least, it seems 1Password no longer works with WSL.
$ ssh-add -l
Could not open a connection to your authentication agent.
And "SSH_AUTH_SOCK" is empty, too.
Calling "ssh-add -l" on Windows, however, works fine.
- bjoernb3 months agoNew Contributor
Do you still have the alias in your bashrc? check james-hensons post below about `"\\wsl.localhost\Ubuntu\home\username\.bashrc"
- manski3 months agoNew Contributor
No, I don't have an alias. This would solve the problem for WSL but not for the DevContainers (as the DevContainers don't use the Ubuntu WSL distro).
- bjoernb3 months agoNew Contributor
That's correct, but at least the alias is the prescribed solution from 1Password to get this to work in WSL when you directly type it in the terminal. https://developer.1password.com/docs/ssh/integrations/wsl/#optional-add-an-alias-for-ssh-commands
If you only want git to work in WSL with the agent, you need to adapt your git config like this: https://developer.1password.com/docs/ssh/integrations/wsl/#configure-git-to-use-sshexe$