-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Add usbip module for usb support in WSL #263
Conversation
Why do devices need to have |
On bare-metal NixOS it has the "same" permissions, but it has a ACL associated with the usb device.
I'm new to the ACL:s and just found out about them now. But that seems to be the difference. Within WSL NixOS there is no ACL attached to the file:
Another difference is that bare-metal NixOS has Perhaps this is the key: If the user doesn't count as logged in. |
7adf602
to
a4fcd30
Compare
@nzbr and @SuperSandro2000, any ideas how to proceed? The script has now received a tag, so I have updated that. Other than that I guess it is a few open questions. I also noticed a test failed, but I am not sure if it is related to my changes? |
The test failure is related to docker being broken on the commit on stable. |
@terlar Have you figured something out regarding udev? If there's no other easy way, giving all USB devices |
@nzbr No unfortunately not, only the findings I mentioned recently. So the permissions are the same on NixOS standalone and NixOS in WSL. But NixOS standalone has ACL configured for the user so the user gets access. Not sure what is configuring the ACL and why they wouldn't be configured inside WSL. Either we leave it to the users or give the 0666 permissions to all USB devices. Up to you, I'm fine either way. I guess you are not familiar with the ACL stuff either? |
a4fcd30
to
6d5a513
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
6d5a513
to
c1954b1
Compare
Seems there was another conflict due to recent changes in I'm okay to go either way, either like this is or with modifications. Just let me know what to do :) |
FWIW I've been using the additions on this branch with the suggested For people who go a step further and build a custom WSL kernel with HIDRAW enabled to by able to use FIDO2-related features, this is the extra
|
What is the state of affairs for this ? |
I guess it is waiting for decision on proceed or if there is a way to not have those udev rules or perhaps add them by default. |
For me the question was just how to make use of all of this from the user side as depite all of the guides it was still not entirely made clear how to attach usb devices. Right I'm using @LGUG2Z 's sumup ( At least it seems to be a one-time needed thing: I also had to add the following two lines to
On NixOS side:
EDIT: Regarding the issue with |
I checked if my hack worked replacing (
|
c1954b1
to
e8576ab
Compare
This adds a module to enable USB support via usbip together with a usbip-win running on the host.
One caveat with accessing USB devices is that they will require wider permissions than that will most likely be configured. For example the infrastructure provided by NixOS to enable YubiKeys will add a rule with permission mode
0660
. While when running WSL with usbip you need to set0666
in the udev rules.So for example to get YubiKeys working you would need something like this:
If we look into the udev rule provided by the
yubikey-personalization
package it looks like this:I don't know enough about udev rules, but would it be possible to do something generic like this:
Any ideas appreciated. At least with this configuration I have YubiKey's working within WSL with auto-attach, so I just plug in/unplug and can use it like I would regularly expect on a normal Linux device.