WSL auto-attach #168
Replies: 3 comments 3 replies
-
Thanks for the elaborate report. a) Will be solved by #164 WSL docs are mostly handled by Microsoft (@benmcmorran) |
Beta Was this translation helpful? Give feedback.
-
Trying to unravel a similar situation, and I'm not sure I found a solution for this. This has probably been asked on multiple occasions, apologies if this is documented somewhere else. Essentially I have a flashing tool for an embedded device connected through USB that runs inside a docker container. During the process, it will reboot the target device once, which causes a USBip disconnect and make the process fail I used to use VMWare Workstation which can trigger a reconnect at reboot of USB device, but I can't find a way to do so with WSL2 and USBIP. I thought the "--force" flag would work, but I did not really find a documentaiton for it. If I use "bind" it reports an error stating "device has already been attached" (even though it's actually not attached when I run it) Thanks for any insight you can share Regards |
Beta Was this translation helpful? Give feedback.
-
See #56 (comment) for auto-attach. |
Beta Was this translation helpful? Give feedback.
-
Hi!
To start with, big thanks for developing this!
I've recently started fiddling around with usbip-win & WSL and have gotten some stuff working after doing
a) removing that filter (registered by wireshark)
b) getting wsl-side
usbip
goingc) pulling new kernel from Microsoft
d) building the kernel, with drivers!
e) figuring out that I was missing udev-rules
f) inadvertently discovering that a upgrade to Ubuntu20.04 added udev-rules
g) realizing that the udev-service needs to be manually kickstarted
h) adapting the solution here (point 2&3) to do
sudo service udev restart
if neededNow I'm pretty happy with the situation!
Except that I need to reattach the device if it restarts, disconnects, or is physically disconnected.
Which happens quite a bit when I'm programming devices or communicating with my 3D-printer running klipper.
So I thought I'd mangle the example here a bit to make it auto-attach devices of my choosing as they are registered in windows.
But before I even got started I realized that this would be a fancy feature to add to usbipd-win itself!
Do you think this would be a viable idea?
Would you be open to a PR that adds the functionality?
It wouldn't automagically fix the case of (re)attaching devices on WSL-startup, but a WSL-instance that is starting could run
usbipd.exe wsl --wsl-is-starting-reattach-autoattach-devices-please
on the windows side ¯_(ツ)_/¯Would it be alright to add a note about some of those issues I mentioned to the wiki or docs?
(How does one send PRs for the wiki-git? Seems to be unsupported by github)
Beta Was this translation helpful? Give feedback.
All reactions