Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upIntegration with bash on Windows 10 Preview #159
Comments
dlech
added
enhancement
docs needed
labels
Jul 13, 2016
This comment has been minimized.
This comment has been minimized.
|
Nifty. I'll try this out when I get a chance. |
This comment has been minimized.
This comment has been minimized.
mendhak
commented
Aug 20, 2016
|
Thanks @katekarnage, never heard of I added this to my
On connecting via SSH I do see this error though, is it something we can safely ignore?
|
This comment has been minimized.
This comment has been minimized.
|
It looks like unix sockets are at least partially implemented. Microsoft/WSL#134 This is really what should be used here instead of socat. |
This comment has been minimized.
This comment has been minimized.
FlorinAsavoaie
commented
Nov 15, 2016
|
Not extremely easy to implement the Unix sockets outside a WSL instance, as far as I can tell. Meanwhile I wrote this: https://gist.github.com/FlorinAsavoaie/8c2b6cb00f786c2caab65b1a51f4e847. |
This comment has been minimized.
This comment has been minimized.
h31
commented
Apr 21, 2017
|
A major upgrade for Linux subsystem was released |
This comment has been minimized.
This comment has been minimized.
rfnx
commented
Apr 21, 2017
|
Still not working for me, even with the new Creators update. I tried to declare the socket in KeeAgent options (both types, msysGit and Cygwin) and then export "SSH_AUTH_SOCK" in bash, but maybe I'm doing it wrong ? |
This comment has been minimized.
This comment has been minimized.
|
MSYS/Cygwin use TCP sockets, not Unix sockets, so they will not work with native Linux ssh programs. We need to figure out how to create a Unix socket from a Windows program (if that is even possible) or perhaps automate the |
This comment has been minimized.
This comment has been minimized.
saxonww
commented
Apr 21, 2017
|
https://github.com/ionescu007/lxss might help answer this question. I've spent less than 5 minutes looking at this, but it suggests that there is an 'ADSS bus' which is the bridge between the Win32 and WSL environments. It might not really be possible (yet) to just create a socket file from a Win32 program and have it be recognized as such by a WSL process; there would maybe need to be something like the lxext/lxexec method described in the readme for this repo. |
This comment has been minimized.
This comment has been minimized.
saxonww
commented
Apr 21, 2017
|
Also fwiw I have been using a modified version of @FlorinAsavoaie's python thing for several months. It works as well or better than the socat method, with the one downside being if I try to close my WSL window(s) while keepass is locked, I get into a db unlock loop that is really hard to get out of. |
This comment has been minimized.
This comment has been minimized.
h31
commented
Apr 21, 2017
•
WSL from Creators update allows to run arbitrary Linux command from the Windows executable. There's no need to use unofficial tools. |
This comment has been minimized.
This comment has been minimized.
saxonww
commented
Apr 21, 2017
|
Does this new capability extend to reading and writing from an Linux socket file? |
This comment has been minimized.
This comment has been minimized.
h31
commented
Apr 21, 2017
|
Haven't heard about such possibilities. I've posted a link above, maybe it will help. |
This comment has been minimized.
This comment has been minimized.
strarsis
commented
Sep 15, 2017
|
I use this now in .bashrc:
It uses the msysgit2unix-socket python script, a recent fork you can find here: |
This comment has been minimized.
This comment has been minimized.
saxonww
commented
Dec 19, 2017
•
|
https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/ !! Doesn't interop with WSL yet, apparently, but the blog makes it sound like it will soon-ish, and it's listed in the WSL release notes for 17063... |
dlech
added this to Windows
in Enhancements
Dec 20, 2017
This comment has been minimized.
This comment has been minimized.
strarsis
commented
Jan 14, 2018
|
Currently working howto: https://gist.github.com/strarsis/e533f4bca5ae158481bbe53185848d49 |
This comment has been minimized.
This comment has been minimized.
strarsis
commented
Feb 26, 2018
|
What is cool is that it also works with FileZilla Normal login and some other SSH clients on Windows. |
This comment has been minimized.
This comment has been minimized.
pscheit
commented
Aug 1, 2018
|
if [ ! -f /tmp/ssh-agent-pipe ]; then and enable the experimental open ssh support after reading this thread i should've known, that there is already a tcp socket available to bind with socat, but leaving this here for someone who's interested .. |
This comment has been minimized.
This comment has been minimized.
strarsis
commented
Aug 1, 2018
•
|
@pscheit: Where do I have to enable the experimental open ssh support? |
This comment has been minimized.
This comment has been minimized.
pscheit
commented
Aug 1, 2018
This comment has been minimized.
This comment has been minimized.
strarsis
commented
Aug 1, 2018
|
@pscheit: How can I avoid sudo prompt at the beginning of each shell session? |
This comment has been minimized.
This comment has been minimized.
reynoldsbd
commented
Jan 14, 2019
|
Hello! I am not a KeeAgent user, but I got a tip that folks here might be interested in wsl-agent-bridge. In short, it allows WSL to transparently use the Windows port of ssh-agent via an AF_UNIX socket. |

katekarnage commentedJul 13, 2016
The good news is, this already works and should just need some documentation adding to tips and tricks.
Using the MSYSGIT socket functionality already provided, the bash/linux subsystem on windows 10 Preview can be made to use KeeAgent as it's ssh agent.
I managed to do it using socat (apt-get install socat within bash on windows) a script like the one below (pretty crude, ignores some things like proper host/network translation on the port number, because, well... the target architecture is known! and some cleanup could be added to .bash_logout etc)