Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues using WSL2 with Ubuntu 22.04 #34

Closed
4integration opened this issue Aug 15, 2022 · 4 comments
Closed

Issues using WSL2 with Ubuntu 22.04 #34

4integration opened this issue Aug 15, 2022 · 4 comments
Labels
duplicate This issue or pull request already exists wontfix This will not be worked on

Comments

@4integration
Copy link

Hi,

I am using WSL1 with wsl-ssh-agent-gui which works just fine.
Now I am trying to use WSL2 but it doesn't work (so I have both instances WSL1 and WSL2 and Ubuntu 22.04)
Using it for authentication to git (BitBucket)
WSL2 is configured to use the workaround with the content in ~/.bashrc

export SSH_AUTH_SOCK=$HOME/.ssh/agent.sock
ss -a | grep -q $SSH_AUTH_SOCK
if [ $? -ne 0   ]; then
    rm -f $SSH_AUTH_SOCK
    ( setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"/mnt/c/opt/wsl-ssh-agent/npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork & ) >/dev/null 2>&1
fi

Socat seems to start just fine.

In both WSL1 and WSL2 I get:

> ssh-add -l
3072 SHA256:utd25qwhXccvIb17tC8rncoQj********************* name@domain.se (RSA)

But in WSL2 I get:

> git clone ssh://git@bitbucket.domain.net/ja/repo.git
Cloning into 'repo'...
git@bitbucket.domain.net: Permission denied (publickey).
fatal: Could not read from remote repository.

Any idea what can be wrong?

@rupor-github
Copy link
Owner

If you issue ssh-add -L in WSL2 and get back a key which is registered with BitBucket - there should be no reason for git not to work, at least I cannot think of one really. You could try running gui with -debug and using DbgView on Windows end to collect additional information - maybe we get lucky.

@4integration
Copy link
Author

Now tested with Ubuntu 20.04 in WSL2 with the exact same content in .bashrc = worked on the first try
Also tested a completely fresh install of Ubuntu 22.04 + socat + .bashrc = no go

So feeling says

  • Something "new" in Ubuntu 22.04 breaking this
  • Something in Socat (v1.7.4.1 in Ubuntu 22.04 and v1.7.3.3 in Ubuntu 20.04)

Regarding -debug where are the logging done?

@4integration 4integration changed the title Issues using WSL2 Issues using WSL2 with Ubuntu 22.04 Aug 15, 2022
@rupor-github
Copy link
Owner

-debug is using OutputDebugString().

In Ubuntu 22.04 there is different version of openssh (with extensions) - you may need to update Windows side openssh (which includes ssh-agent you are trying to use). It is a known problem, see #29 and #31

@rupor-github rupor-github added duplicate This issue or pull request already exists wontfix This will not be worked on labels Aug 15, 2022
@4integration
Copy link
Author

Worked perfect, thanks @rupor-github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants