reynoldsbd / wsl-agent-bridge Goto Github PK
View Code? Open in Web Editor NEWWSL compatibility bridge for ssh-agent on Windows
WSL compatibility bridge for ssh-agent on Windows
The bridge socket is not automatically cleaned up after process termination.
This is partially mitigated by attempting to delete the socket before opening it (making sure we start clean each time). However, even this seems to fail sometimes with the following OS error message: "Only one usage of each socket address (protocol/network address/port) is normally permitted."
Not sure why I'm seeing this particular message, especially since it's happening right after deleting the socket in question. One thing to try before digging deeper is gracefully shutting down the socket. This would require catching and handling a termination signal.
There are number of potential ways to make setup easier:
Probably don't want to do all of these.
Related to #2, I don't have rust installed so thought I would try it in docker. Short story:
root@f7255395061d:/src# cargo install --path .
...truncated...
Compiling tokio-uds-windows v0.1.0 (https://github.com/Azure/tokio-uds-windows#b689a914)
error[E0463]: can't find crate for `mio_uds_windows`
--> /usr/local/cargo/git/checkouts/tokio-uds-windows-c1fcfa4fd9604fb0/b689a91/src/lib.rs:14:1
|
14 | extern crate mio_uds_windows;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
rust:latest
pulled just today.
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
rust latest 84ba1f55dee3 2 weeks ago 1.21GB
I'm running this on win10_64, 2004 (just updated), under WSL2 running ubuntu-20.04. I don't know how rust works or if any of that is relevant.
Thanks!
root@f7255395061d:/src# cargo install --path .
Installing wsl-agent-bridge v1.0.0 (/src)
Updating crates.io index
Updating git repository `https://github.com/Azure/iotedge`
Updating git repository `https://github.com/Azure/tokio-uds-windows`
Updating git repository `https://github.com/Azure/mio-uds-windows.git`
Downloaded tokio-io v0.1.13
Downloaded tokio-reactor v0.1.12
Downloaded directories v1.0.2
Downloaded futures v0.1.29
Downloaded log v0.4.8
Downloaded mio v0.6.22
Downloaded bytes v0.4.12
Downloaded tokio v0.1.22
Downloaded iovec v0.1.4
Downloaded crossbeam-utils v0.7.2
Downloaded tokio-executor v0.1.10
Downloaded num_cpus v1.13.0
Downloaded libc v0.2.71
Downloaded tokio-sync v0.1.8
Downloaded parking_lot v0.9.0
Downloaded cfg-if v0.1.10
Downloaded slab v0.4.2
Downloaded lazy_static v1.4.0
Downloaded byteorder v1.3.4
Downloaded tokio-current-thread v0.1.7
Downloaded tokio-tcp v0.1.4
Downloaded tokio-fs v0.1.7
Downloaded tokio-udp v0.1.6
Downloaded tokio-threadpool v0.1.18
Downloaded tokio-uds v0.2.6
Downloaded fnv v1.0.7
Downloaded tokio-timer v0.2.13
Downloaded autocfg v1.0.0
Downloaded net2 v0.2.34
Downloaded tokio-codec v0.1.2
Downloaded crossbeam-queue v0.2.2
Downloaded lock_api v0.3.4
Downloaded crossbeam-deque v0.7.3
Downloaded rustc_version v0.2.3
Downloaded mio-uds v0.6.8
Downloaded maybe-uninit v2.0.0
Downloaded crossbeam-epoch v0.8.2
Downloaded parking_lot_core v0.6.2
Downloaded scopeguard v1.1.0
Downloaded semver v0.9.0
Downloaded smallvec v0.6.13
Downloaded semver-parser v0.7.0
Downloaded memoffset v0.5.4
Compiling cfg-if v0.1.10
Compiling autocfg v1.0.0
Compiling libc v0.2.71
Compiling maybe-uninit v2.0.0
Compiling lazy_static v1.4.0
Compiling semver-parser v0.7.0
Compiling log v0.4.8
Compiling futures v0.1.29
Compiling scopeguard v1.1.0
Compiling byteorder v1.3.4
Compiling slab v0.4.2
Compiling fnv v1.0.7
Compiling tokio-named-pipe v0.1.0 (https://github.com/Azure/iotedge#86db1763)
Compiling semver v0.9.0
Compiling lock_api v0.3.4
Compiling rustc_version v0.2.3
Compiling smallvec v0.6.13
Compiling tokio-sync v0.1.8
Compiling crossbeam-utils v0.7.2
Compiling memoffset v0.5.4
Compiling crossbeam-epoch v0.8.2
Compiling iovec v0.1.4
Compiling net2 v0.2.34
Compiling num_cpus v1.13.0
Compiling directories v1.0.2
Compiling parking_lot_core v0.6.2
Compiling parking_lot v0.9.0
Compiling bytes v0.4.12
Compiling mio v0.6.22
Compiling tokio-io v0.1.13
Compiling tokio-executor v0.1.10
Compiling crossbeam-queue v0.2.2
Compiling tokio-current-thread v0.1.7
Compiling tokio-timer v0.2.13
Compiling mio-uds v0.6.8
Compiling crossbeam-deque v0.7.3
Compiling tokio-codec v0.1.2
Compiling tokio-threadpool v0.1.18
Compiling tokio-fs v0.1.7
Compiling tokio-reactor v0.1.12
Compiling tokio-uds v0.2.6
Compiling tokio-udp v0.1.6
Compiling tokio-tcp v0.1.4
Compiling tokio-uds-windows v0.1.0 (https://github.com/Azure/tokio-uds-windows#b689a914)
error[E0463]: can't find crate for `mio_uds_windows`
--> /usr/local/cargo/git/checkouts/tokio-uds-windows-c1fcfa4fd9604fb0/b689a91/src/lib.rs:14:1
|
14 | extern crate mio_uds_windows;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: could not compile `tokio-uds-windows`.
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `wsl-agent-bridge v1.0.0 (/src)`, intermediate artifacts can be found at `/src/
target`
Caused by:
build failed
I'd love to get KeeAgent working with WSL2. Currently this repo doesn't seem to work with this configuration. @reynoldsbd
First of all thanks for the tool, it's great as it precisely solved the problem.
As to the issue mentioned in the subject, $SSH_AUTH_SOCK is used to let programs know "what is the existing SSH agent socket path that I should connect to", but not "where I should create my agent socket file".
In current case, the existing $SSH_AUTH_SOCK file got overwritten by this program if it is already set by other program, such as keeagent, a plugin of keepass. Keeagent can create cygwin and msysGit compatible socket files, so some Windows users use it to manage SSH keys and already have the $SSH_AUTH_SOCK points to the socket file create by it.
So I would like to suggest either using a different env. var. or a command line option.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.