Skip to content
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

feature request - WSL auto attach based on VID:PID #371

Closed
ebabcock72 opened this issue May 6, 2022 · 2 comments
Closed

feature request - WSL auto attach based on VID:PID #371

ebabcock72 opened this issue May 6, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@ebabcock72
Copy link

Hello! I saw this PR from a few days ago #351 which enables auto-attach of a device. This is really more of an auto-reattach (that name was considered, if you look through the comments on the PR). My request is to make this even more automatic, and allow a single setup step once and then never needing to run another command.

Basically, I'd want to specify somewhere (a config file, or by running a command, or something) that any future device that matches a given idVendor and/or idProduct (VID:PID) automatically would get attached to WSL. Similar to how udev rules work in Linux. I have a udev rule that looks for a specific idVendor and idProduct and assigns it a certain name in /dev.

This would allow people who use a certain device frequently (like if they are programming a certain MCU or something) to not have to worry about entering extra commands every time they attach their device. They'd just plug it in, and Linux would automatically have access to it.

I did see that you can combine the --auto-attach with the --hardware-id to automatically reattach based on the VID:PID. This is almost what I am looking for, but you still need to manually run that command for each session and it sits there in a loop. Is there a way to have it always be waiting from a fresh boot in the background?

@dorssel
Copy link
Owner

dorssel commented May 7, 2022

@ebabcock72
This is not something that belongs in usbipd-win, as attaching is really a client-side thing. The convenience commands usbipd wsl xxx are special in the sense that that relay the command to run on WSL client side. But they are commands, not services.

Your request would require a server side service, that somehow monitors the running state of one or more WSL instances, and then magically runs the client side attach upon plugging in a device (possible even auto-binding it first). And of course all of this on a per user basis (as WSL instances are per user). This is all perfectly reasonable, but it is a totally different service compared to what usbipd-win actually does. And it would be very WSL-specific, which usbipd-win in itself is not. So, if this is ever made, it would be a new project altogether that would use usbipd-win, but will not be part of it.

This request (and the declining reasons) have been mentioned before: #56 (comment)

@dorssel dorssel added the enhancement New feature or request label May 13, 2022
@dorssel
Copy link
Owner

dorssel commented May 13, 2022

As indicated, this will not be implemented in usbipd-win since it belongs in a separate project. Now there is such a project (see #382), this issue will be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants