-
Notifications
You must be signed in to change notification settings - Fork 847
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
[WSL 2] Attaching an USB device #5158
Comments
WSL 2 operates in a lightweight VM and does not have USB pass-through access. Even if enabled in the Linux kernel, that is still simply inside the VM. This is a duplicate of #689. |
Nope, it "was" somehow possible. See this pull request microsoft/WSL2-Linux-Kernel#45. I tried it once but the compiled kernel did not boot WSL2 VM, maybe I did something wrong. |
@sirredbeard so for now there’s no way to attach USB devices into WSL? |
Generally yes. There are hacks that use USB over IP but they aren't supported and YMMV. |
Also tried by me. But usbip can’t attach usb devices with WSL. I’m already having a long discussion here- cezanne/usbip-win#149 |
Bad news. |
My issue is solved with USB/IP tool from this repo: https://github.com/cezanne/usbip-win |
I tried to attach the kinect,using usbip and this is what happened : root@DESKTOP-N9UN2H3:~/Desktop# sudo ./libfreenect2/build/bin/Protonect |
@sirredbeard Any news about the support in default build? |
I'm glad it worked for you, but I personally do not think that USB support in WSL2 should require recompiling a custom Linux kernel and installing a prerelease of a Windows kernel driver. This feature should just work out of the box. |
I wanted to follow up with this and see if there has been any news of this feature coming by default? |
After getting Steam for Linux installed in Ubuntu On Windows, i am interested in this feature request or limitation of WSL2 as well. Could not help thinking of VirtualHere but have only used android server with non linux clients (mostly remote cloud gaming VMs like Paperspace and Shadow running windows or windows server) and can see VirtualHere has CLI for linux clients at https://www.virtualhere.com/node/955. Yeah YMMV but am sure a custom kernel and VH can help out for many end user case scenarios in WSL. |
The issue is not resolved by usbip because when you install the windows part you have to remove protection, test signature. This could be an attack vector on your machine and could not be accepted on work computer, So we need to have some internal tools to be able to do that. If USB-IP is working correctly why we don't have it available directly by Windows when se enable some additional tools ? |
Well, it would be addressed by USB/IP if USB/IP kernel code was merged into the Microsoft's WSL2 kernel. But you are right, this issue is not fixed and it should not be closed. |
Not only the USP/IP kernel code, wee need to have the USP/IP Windows driver available and signed by microsoft to avoid to do: bcdedit.exe /set TESTSIGNING ON because this in not safe as you have to disable the UEFI secure boot to do that. |
the problem is deeper,since actually on WSL2 there is no official passthrough for the multimedias USB devices. |
But the problem can be fixed with this solution : onomatopellan commented on 6 May I found it very easy to use. It's free if you connect 1 device and you use the gui linux version as client. For the server, just download and run it: For the client (you need an XServer and gtk2): wget https://www.virtualhere.com/sites/default/files/usbclient/vhuit64 After that you can right click -> "Specify the hub" and add YOUR_PC_IP:7575 And that's it. You should see the device with lsusb. |
modprobe: FATAL: Module vhci-hcd not found in directory /lib/modules/4.19.104-microsoft-standard |
you should recompile the kernel and u should activate a lot of parameters
related to usb. its better if u don't choose to load as modules.but built
into the kernel.
|
Rebuilding the WSL2 kernel from sources may work, but functionality as basic as USB support should not require it. |
it seems that it is required. but I think that depends about the wsl-config
file that's used.
|
The issue is not closed. The title is Attaching an USB device. I'm trying to attach an USB modem and it is not working, It is not supported by VirtualHere so it is not the solution for all USB device. |
yes this is not closed and its the most important feature for me |
For me too. I can't replace my vm with wsl2. |
you can try this : https://www.flexihub.com/download.html
|
Why was this closed??? I don't understand why Microsoft has prioritized running a linux DE concurrent with window's over this basic feature?? |
+1 not having USB-Passtrough is really a dealbreaker. |
+1 |
2 similar comments
+1 |
+1 |
@Wolf1098 @Rhodderz @MuZhou233 @bossbeagle1509 @mrchrisster @Gallium70 @JaccoVeldscholten @fulcrumEFX @bogdant @ZimmerA @lexxxel @leofabri @v-bortsov @Johnsel @Olegvarmy @eugenov @lucascoelhof @MomoRazor @flasher297 @th33xitus @thiscantbeserious @jonashger @luggi @fjalvarezdd |
@noverby This is your first comment on this topic if i see that correctly. So you weren't even affected by those notifications up until now with your comment. Why do you even feel annoyed? You don't even seem to be involved in this repository (correct me if i am wrong). Probably the amount of comments a topic gets can be a good metric too (activity in a topic = possible demand). Anyone who feels annoyed can just unsubscribe and just keep a bookmark to this topic. Back to topic: EDIT:
With every day, you learn something new :) i wasn't aware. Thanks for the hint. |
@th33xitus I'm affected since I'm subscribed. (You don't have to comment to be subscribed) Please consider my plea. I'm stopping this off-topic discussion now. |
+1 |
+1 |
honestly github might need a spam filter, if everyone properly +1'd the issue via reaction this can be used as a better sorting filter than comment count also and most notably because everyone can only give one reaction. rather than just writing +1 try something productive in the comment, e.g. writing for what you want to use it, or if you can (sure I cannot but maybe some can) try writing on how to go with this. for example I would love to use this as I have sometimes dockers as build VMs for firmware of stuff and it's a lot easier being able to just flash in the docker rather rather than using whatever crazy methods available to get the firmware out (which is in my case a curl to a specially prepared PHP script) just to flash from the host. having USB in the WSL VMs would be making that whole process a lot easier. |
Chill, it's just baiting to let them lock the conversation to contributors. You should open new issues instead, referencing this one. |
I understand your request. I commented because this issue has been closed multiple times. Upvotes did not give enough attention to this issue, but email notification do 'push' attention. I hope you can understand that. |
Same. Not going to upvote an already closed thread. Open to better
suggestions though..l
Op ma 24 mei 2021 om 08:50 schreef Alexander Petermann <
***@***.***>
|
Well, It seems that my new issue was closed in favor of #2195 |
Is there any plans for this? |
This issue is closed and will be ignored. Please follow #2195 instead, for updates, and make sure to upvote the OP in that thread as well. |
Nice, but how is this relevant for the general theme: “accessing USB devices from WSL2”? There are many more USB device types.
From the referred documentation:
USB flash drives and SD cards are not supported at this time and will fail to attach to WSL 2.
As will: YubiKeys, asynchronous communication adapters, camera’s, speakers, and in circuit debuggers for IOT and much, much more.
From: Aleksey Tsalolikhin ***@***.***>
Sent: Friday, 3 September 2021 15:17
To: microsoft/WSL ***@***.***>
Cc: Gijs Mos ***@***.***>; Comment ***@***.***>
Subject: Re: [microsoft/WSL] [WSL 2] Attaching an USB device (#5158)
See https://docs.microsoft.com/en-us/windows/wsl/wsl2-mount-disk
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#5158 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AALUWEESEPD2MJHUDOXBLHLUADDFLANCNFSM4MVQUUZQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@gmos Right. To be honest, I stopped reading the vendor documentation when I saw the functionality to mount USB drives was only supported in Windows 11 Preview. I don't have that. I was trying to mount a USB flash drive, so it wouldn't have worked for me anyway. I'm glad Microsoft is working on improving USB support for WSL though. Cheers, and thanks for the correction. |
TLDR to mount
|
Im getting people asking if virtualhere can pass through usb into wsl2. The answer is now yes with the latest wsl2 kernel |
For those who found their way here: https://devblogs.microsoft.com/commandline/connecting-usb-devices-to-wsl/ |
I want to attach an USB device (iPhone) with WSL, how to accomplish that? USB device is connected with Windows host. I'm using kernel 4.19.104 and enabled USB support manually by compiling it from source.
Any suggestions regarding above mentioned issues?
The text was updated successfully, but these errors were encountered: