MicrosoftDocs / WSL

Source code behind the Windows Subsystem for Linux documentation.
https://docs.microsoft.com/windows/wsl
Other
1.88k stars 554 forks source link

Attach USB Device Documentation is Incorrect #1875

Closed definity closed 6 months ago

definity commented 6 months ago

Documentation Issue

The listed instructions are incorrect. The 'wsl' subcommand has been removed and there's a new syntax and sequence that should be followed. When following the current documentation, this is the output. Also not the link in the error message points to the same documentation that's broken.

PS C:\WINDOWS\system32> usbipd wsl list
usbipd: error: The 'wsl' subcommand has been removed. Learn about the new syntax at https://learn.microsoft.com/windows/wsl/connect-usb#attach-a-usb-device.
PS C:\WINDOWS\system32> usbipd wsl attach --busid 1-13
usbipd: error: The 'wsl' subcommand has been removed. Learn about the new syntax at https://learn.microsoft.com/windows/wsl/connect-usb#attach-a-usb-device.
PS C:\WINDOWS\system32> usbipd attach --wsl --busid 1-13
usbipd: error: Device is not shared; run 'usbipd bind -b 1-13' as administrator first.

Based on me following it and seeing the result of the output of usbipd this is what success looks like.

PS C:\WINDOWS\system32> usbipd list
Connected:
BUSID  VID:PID    DEVICE                                                        STATE
... redacted ...
1-13   0951:1666  USB Mass Storage Device                                       Not shared
... redacted ...

Persisted:
GUID                                  DEVICE

PS C:\WINDOWS\system32> usbipd bind -b 1-13
PS C:\WINDOWS\system32> usbipd attach --wsl --busid 1-13
usbipd: info: Using WSL distribution 'Ubuntu' to attach; the device will be available in all WSL 2 distributions.
usbipd: info: Using IP address 172.29.128.1 to reach the host.

Link to documentation page

https://learn.microsoft.com/en-us/windows/wsl/connect-usb#attach-a-usb-device

Suggested Improvements

The first command to run is usbipd list

Followed by usbipd bind -b <BUSID>

Followed by usbipd attach --wsl --busid <BUSID>

mattwojo commented 6 months ago

Thanks for filing this issue @definity. It is being resolved in https://github.com/MicrosoftDocs/WSL/pull/1870

upsangel commented 5 months ago

Suggested Improvements

The first command to run is usbipd list

Followed by usbipd bind -b <BUSID>

Followed by usbipd attach --wsl --busid <BUSID>

Thank you for the sharing. I resovled the problem by your method. But surprisingly see the wrong doc still alive on MS website.