Giter VIP home page Giter VIP logo

Comments (18)

dorssel avatar dorssel commented on July 17, 2024 8

@kaeltis

❯ sudo mount -t drvfs -o "uid=0;gid=0;umask=222" "C:\Program Files\usbipd-win\WSL" "/var/run/usbipd-win"
mount: /var/run/usbipd-win: failed to parse mount options 'rw,uid=0;gid=0;umask=222': Invalid argument.

Note how the error included "rw," and separates with a comma, where the other options are separated with a semicolon.

Also, it turns out that we do not need uid/gid, and mounting with "ro" is actually better.

Could you try:

sudo mount -t drvfs -o "ro,umask=222" "C:\Program Files\usbipd-win\WSL" "/var/run/usbipd-win"

This also works on Ubuntu (which appears to accept both semicolon and comma). Hopefully we'll find a syntax that works everywhere...

from usbipd-win.

enema-combatant avatar enema-combatant commented on July 17, 2024 5

Can confirm:

  1. Shutdown WSL
  2. Uninstall Official MSI
  3. Install Dev Build (not signed, will warn, SmartScreen triggers also)
  4. Fire up WSL
  5. Admin Command Prompt - bind device
  6. Normal Command Prompt - attach device
  7. lsusb in ubuntu shows device

from usbipd-win.

kaeltis avatar kaeltis commented on July 17, 2024 2

With the dev installer everything is working again and the mount is there, thanks a bunch!

drvfsa /run/usbipd-win 9p ro,dirsync,relatime,aname=drvfs;path=C:\Program Files\usbipd-win\WSL;umask=222;symlinkroot=/mnt/,mmap,access=client,msize=262144,trans=virtio 0 0

from usbipd-win.

proddy avatar proddy commented on July 17, 2024 2

4.1.1 worked for me too (same issue). thanks

from usbipd-win.

dorssel avatar dorssel commented on July 17, 2024 1

@kaeltis @Hammerflame
Could you try the (dev) installer from https://github.com/dorssel/usbipd-win/actions/runs/7813976713
Please, shutdown WSL first (with wsl --shutdown), to remove any left-over mounts. And then test if usbipd attach works out-of-the-box.

from usbipd-win.

dorssel avatar dorssel commented on July 17, 2024

Since 4.1.0, there will always be a new mount point created (the one you list does not always exist, or as a different path, or non-executable).

After failure, what is the output of (in WSL):

ls -l /var/run/usbipd-win

What is the output of the following commands (as root, so possibly prepend sudo):

mkdir -m 0000 "/var/run/usbipd-win"
mount -t drvfs -o "uid=0;gid=0;umask=222" "C:\Program Files\usbipd-win\WSL" "/var/run/usbipd-win"

NOTE: please include all the quotes, these are the exact commands that usbipd-win issues (on your machine).

from usbipd-win.

kaeltis avatar kaeltis commented on July 17, 2024
❯ sudo ls -alh /var/run/usbipd-win/
total 0
d---------  2 root root  40 Feb  6 22:14 .
drwxr-xr-x 20 root root 500 Feb  6 22:14 ..
❯ sudo mkdir -m 0000 "/var/run/usbipd-win"
mkdir: cannot create directory ‘/var/run/usbipd-win’: File exists
❯ sudo mount -t drvfs -o "uid=0;gid=0;umask=222" "C:\Program Files\usbipd-win\WSL" "/var/run/usbipd-win"
mount: /var/run/usbipd-win: failed to parse mount options 'rw,uid=0;gid=0;umask=222': Invalid argument.

I tried messing with the mount options, but no matter what I do, it either mounts it but ignores uid=0;gid=0;umask=222 or says they are invalid.

from usbipd-win.

Hammerflame avatar Hammerflame commented on July 17, 2024

i have the same issue to my kali-linux WSL2 on windows pc

from usbipd-win.

kaeltis avatar kaeltis commented on July 17, 2024

Could you try:

sudo mount -t drvfs -o "ro,umask=222" "C:\Program Files\usbipd-win\WSL" "/var/run/usbipd-win"

This works, and while the umask option doesn't show up under mount, the permissions of the files look good:

drvfs on /run/usbipd-win type 9p (ro,relatime,dirsync,aname=drvfs;path=C:\Program)

❯ ls -alh /var/run/usbipd-win/
Permissions Size User Date Modified Name
.r-xr-xr-x  3.3k root  2 Feb 17:32   auto-attach.sh
.r--r--r--  2.9k root  2 Feb 17:32   README.md
.r-xr-xr-x  1.2M root  2 Feb 17:32   usbip

Setting a different umask also changes these permissions, I guess mount just doesn't show it?

Weirdly, the automatic mounts of the Windows drives use uid=1000;gid=1000 - even with the semicolon:

drvfs on /mnt/c type 9p (rw,noatime,dirsync,aname=drvfs;path=C:\;uid=1000;gid=1000;symlinkroot=/mnt/,mmap,access=client,msize=262144,trans=virtio)

from usbipd-win.

dorssel avatar dorssel commented on July 17, 2024

while the umask option doesn't show up under mount

That's a bug of the mount command; it truncates the output after the whitespace in the path. Try cat /proc/mounts instead.

Weirdly, the automatic mounts of the Windows drives use uid=1000;gid=1000 - even with the semicolon

Yeah, that's how I came up with the original syntax. Thanks for testing, I will change the mount command to use comma's instead.

from usbipd-win.

jrozner avatar jrozner commented on July 17, 2024

You planning to cut a 4.1.1 release soon? I'm running into this too

from usbipd-win.

dorssel avatar dorssel commented on July 17, 2024

@jrozner
Just install the latest master build until then. https://github.com/dorssel/usbipd-win/actions/workflows/build-installer.yml?query=branch%3Amaster

from usbipd-win.

cmonty14 avatar cmonty14 commented on July 17, 2024

I installed the lastest master:

usbipd --version                                                                                        4.1.1+26.Branch.master.Sha.ef7dda876d6d2a579fc7a6468990c3ac5d19ea13

And performed the steps instructed here.

However, I still cannot attach an USB device; here's the relevant output:

usbipd list                                                                                                                                                                            ─╯
Connected:
BUSID  VID:PID    DEVICE                                                        STATE
2-1    0781:5530  USB-Massenspeichergerät                                       Shared (forced)
2-3    06cb:00bd  Synaptics UWP WBDI                                            Not shared
2-4    13d3:5406  Integrated Camera, Integrated IR Camera, Camera DFU Device    Not shared
2-10   8087:0026  Intel(R) Wireless Bluetooth(R)                                Not shared
3-6    0bda:8153  Realtek(R) USB GbE Family Controller                          Not shared
4-3    046d:c548  Logitech USB Input Device, USB-Eingabegerät                   Not shared
4-7    0424:284c  Hub Feature Controller, USB-Eingabegerät                      Not shared
5-1    20a0:4108  USB-Eingabegerät, Microsoft Usbccid-Smartcard-Leser (WUDF)    Not shared
5-2    0b0e:245e  Jabra Link 370, USB-Eingabegerät                              Not shared
5-4    046d:c52b  Logitech USB Input Device, USB-Eingabegerät                   Not shared

Persisted:
GUID                                  DEVICE

usbipd attach --wsl --busid=2-1                                                                                                                                                     
usbipd: info: Using WSL distribution 'Arch' to attach; the device will be available in all WSL 2 distributions.
usbipd: info: Using IP address 172.17.160.1 to reach the host.
WSL usbip: error: Attach Request for 2-1 failed - Device busy (exported)
usbipd: warning: The device appears to be used by Windows; stop the software using the device, or bind the device using the '--force' option.
usbipd: error: Failed to attach device with busid '2-1'.

from usbipd-win.

dorssel avatar dorssel commented on July 17, 2024

@cmonty14
See #447 (comment)

from usbipd-win.

cmonty14 avatar cmonty14 commented on July 17, 2024

@cmonty14 See #447 (comment)

I already used --forced, please check output of usbipd list

from usbipd-win.

dorssel avatar dorssel commented on July 17, 2024

--force sometimes requires a reboot

from usbipd-win.

cmonty14 avatar cmonty14 commented on July 17, 2024

I see.
But if I reboot Windows 11, then usbipd is going down and must be restarted.

from usbipd-win.

dorssel avatar dorssel commented on July 17, 2024

--force is permanent and survives reboot.

from usbipd-win.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.