Client-side support for usbipd-win / automatic attach after boot #11226
Replies: 1 comment
-
I was hoping someone would reply. Since there has been no reply, I thought I would start by trying usbip on WSL2. When I tried to run usbip, the reply was: Command 'usbip' not found, but can be installed with: I tried to install linux-tools-common, but the output said it wasn't compatible, so I searched further. I found this: https://devblogs.microsoft.com/commandline/connecting-usb-devices-to-wsl/#comment-5658 I created the script and ran it. $ sudo install_linux_tools_generic -s After running the script, I tried running usbip. Here is the response: $ usbip You may need to install the following packages for this specific kernel: You may also want to install one of the following packages to keep up to date: Which package should I install? |
Beta Was this translation helpful? Give feedback.
-
I wish Hyper-V and WSL had native support for USB, but that's not what this is about. I'm using usbpid-win with WSL / Ubuntu. It works well-enough for my application, which doesn't require high bandwidth. My only criticism is that there is no mechanism for automatically attaching a USB device upon booting. In my case, when WSL boots, it starts a service that is required by other services and it requires a connection to a USB device (a software-defined radio). Since the USB is not attached automatically, the service doesn't start properly, causing one of the other three services to also not start properly, so I have to manually shut them all down, attach the USB, then restart the services.
I asked @dorssel about this and he considers client-side support of usbipd-win to be beyond the scope of his project. That's his prerogative, but since usb-ipd-win is the only way to support USB within WSL, the lack of client-side support is unfortunate.
I'm not a linux expert, but I understand this could either be done using rc.local, which would have to be enabled using systemd, or by making a new service using systemd.
If someone has already done this, I would like to know how you did it.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions