-
Notifications
You must be signed in to change notification settings - Fork 822
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
USB device support, libusb (ADB support, etc) #2195
Comments
Perhaps related to #825. |
@timcanham - I'm not sure but... ethanhs/WSL-Programs#29 and the first raw of list in https://github.com/ethanhs/WSL-Programs . |
The image they showed seemed to indicate it work in cmd.exe but not bash. |
@timcanham - Commands that begin with |
|
@sunjoong @timcanham |
thanks @ReVanTis , now i can build rom for my xperia.... my adb now is showing my device... |
I test it in my PC, the version of adb in bash should be same as it in cmd, because if the version of adb client not match the version of adb server, the adb server will be killed by adb client in bash and restart adb server in bash, adb server in bash can't access the devices in windows. so there are steps to make sure adb work in bash:
|
As a workaround, you can install adb.exe on Windows and access it from Linux - just create a symbolic link from adb.exe to /home/<user>/bin/adb. Tested on the latest Insider Windows build (17063). |
Even if you create a symbolic link from adb.exe to /usr/bin/adb (the path obtained after you do So technically speaking, the ADB is not the same as Windows ADB. |
@ReVanTis May I know how do you get to make both ADB in bash and cmd the same version? Thank you for your time. |
@kengkeelim Download here: https://developer.android.com/studio/releases/platform-tools |
Just a note, I was able to work for a couple weeks with windows adb version being newer and ubuntu-in-wsl adb version being older: I installed an older sdk for specific reasons, which had the older adb with it. Yes, each time I tried adb in one OS vs the other it would stop the different-version adb server and start the one for the current OS, and then it would recognize just fine. Tonight, for some reason that I was not sharp enough to track down, it stopped in both OSes - after all the various fixes I could find for adb not recognizing the device, I finally tried installing the same adb version on linux as on windows (without affecting the older sdk I had previously installed). Now both OSes recognize the device, just like the good ol days. |
anyhow |
WSL1 still lives and versions of Windows that only offer WSL1 still exist. So no it won't die for a long time. |
Some clarifications.
You don't have to wait for the update. It can be downloaded from here https://www.catalog.update.microsoft.com/Search.aspx?q=wsl or here https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
Only the WSL2 instances are running in VM mode.
The usbip feature is not distribution specific. |
The current release of |
Anything new here? |
|
@matrixes for the Yubikey, I've been successfully using it without |
Did you follow everything here? https://support.yubico.com/hc/en-us/articles/360013708900-Using-Your-U2F-YubiKey-with-Linux. I don't know enough about the yubikey but I've seen a lot of people successfully use
It's unclear how HID is supported or if it's needed for a Yubikey, so this may not be that helpful for you! |
I haven't tried personally, as I've made it successfully and reproducibly work without |
Updated post
I did not know of this, thanks for bringing it forward. I've followed the instructions (I enabled/included all USB devices/manufacturers I could find in the wsl-config interface) that are linked from #7686 and I'm unfortunately still not able to interact with the key as non-root. Here's the log up to this point. Kernel before following instructions
Kernel after following instructions
udev seems to find and attach the Yubikey properly
lsusb sees it fine
gpg does not recognise the device for my user
gpg recognises the device for root
I also tried this pointer dorssel/usbipd-win#127 (comment) without success It certainly seems like all this is close to working, but I can't tell where the answer is, only conclude that my user does not recognise the device while root does.
I have a very similar setup from https://blog.nimamoh.net/yubi-key-gpg-wsl2/ but it's janky and I'd rather get something closer to scdaemon working properly/natively instead of passing messages between WSL to Gpg4Win through socat glue. |
Unfortunately, even with Yubico's udev rules - same as I wrote here #2195 (comment) :( |
Did you try adding yourself to the plugdev group? (or whichever group your udev rules are using for the yubikey) <- the root user isn't magic (most of the time) but it usually has more memberships than normal users, hence why it can see the device but you can't. |
Updated post
As far as I can tell I have been a member of that group since default install. I haven't touched my memberships and this is what I'm a member of:
|
I recently reinstalled to Windows 11. Following these instructions https://docs.microsoft.com/en-us/windows/wsl/connect-usb (making doubly sure to update to the latest wsl-kernel) I still had the same initial issue; I could access the Yubikey as root, but not as non-root. However, this workaround I only wish this was a bit smoother, e.g. by being able to tell pcscd to restart when it sees the device using udev rules (for now), but I couldn't figure out how to make that work. In all other regards my Yubikey now works the way I want it to, even if it means having to manually restart pcscd. |
Your gpg-related functionality works well, right? |
Yup. I use it mainly for this.
I haven't used these so I'm just entering them as you state them;
The command below made no difference when run as root.
|
😮 |
Blue is the FIDO one right? are we sure that one works yet? So far I've only seen confirmations for the 5 series nano and the regular one (keychain nfc) |
Tacking on my personal experience here as well.
Yes. After attaching the device and starting
Similar story to @matrixes here. Powershell:
gpg:
ykman:
As a result I am unable to access the FIDO2 resident key for SSH, so I have to resort to use the GPG key instead. |
I got this working and wrote a tutorial, for anyone interested. |
@1-bit-wonder does this work for user presence detection as well as setting a pin? Have you noticed any issues with that approach? I'm currently using windows-fido-bridge but it isn't fully reliable and doesn't work properly with ssh-agent. So I'm keen on finding better solutions. |
@Neurrone my pin was already set, so I can't say for sure, but I assume it should just work. it takes the pin fine on operations that require it. can confirm user presence detection works. |
Is USB/IP going to be the only solution for connecting USB devices to WSL? As far as I know, this solution doesn't capture all cases, and sometimes traditional passthrough is essential. Why has Microsoft chosen this route, are there unresolvable issues with adding options for typical USB passthrough like other VM solutions? |
Thanks, you motivated me to try it, and now my ESP32's are flashing over WSL. 😱 |
Has there been any sign from the team that they intend to support this natively, while |
Is it possible to get native support for this usbipd unfortunately only works if you have adminstrator access. Which i don't on my work machine and that limits the ability to use Yubikeys from WSL linux distros. USB passthrough shouldn't need Local Admin. |
hi.. has anyone managed to get this working with usb wifi adapters? but when doing iwconfig i still can't see any wi-fi adapters |
WiFi is shared from Windows to WSL, no need to set it up on WSL. |
Is native support coming? |
Another ping and request for status on native USB support. Especially valuable for embedded devices, serial ports etc.. Many kudus to https://github.com/dorssel/usbipd-win/, but this really needs to be supported natively. Is it in any timeline? |
This bug-tracker is monitored by developers and other technical types. We like detail! So please use this form and tell us, concisely but precisely, what's up. Please fill out ALL THE FIELDS!
If you have a feature request, please post to the UserVoice. If you're reporting a BSOD, don't post here! Instead, e-mail "secure@microsoft.com", and if possible attach the minidump from "C:\Windows\minidump".
Your Windows build number: Microsoft Windows [Version 10.0.14393]
What you're doing and what's happening: Trying to use the adb package to talk to embedded boards via USB. Used apt-get to install it.
What's wrong / what should be happening instead: The adb utility finds no devices.
Strace of the failing command, if applicable: (If
<cmd>
is failing, then runstrace -o strace.txt -ff <cmd>
, and post the strace.txt output here)n/a
See our contributing instructions for assistance.
The text was updated successfully, but these errors were encountered: