dorssel / usbipd-win

Windows software for sharing locally connected USB devices to other machines, including Hyper-V guests and WSL 2.
GNU General Public License v3.0
3.57k stars 229 forks source link

`lsblk` not displaying USB Mass Storage Device But Shows Up On `lsusb` #883

Closed bootsareme closed 6 months ago

bootsareme commented 7 months ago

I did see issue #345 and similar issues but they all had the problem where they did not recompile the kernel. I recompiled the kernel and here is exactly what I did. I first downloaded usbipd-win on to my Windows 11 device. I opened up a elevated powershell prompt and typed usbipd list. Here is what I got back:

Connected:
BUSID  VID:PID    DEVICE                                                        STATE
1-7    05ac:12a8  Apple Mobile Device USB Composite Device                      Attached
1-8    046d:c52b  Logitech USB Input Device, USB Input Device                   Not shared
1-12   1462:7c95  USB Input Device                                              Not shared
1-13   8087:0029  Intel(R) Wireless Bluetooth(R)                                Not shared
3-4    1a2c:4c5e  USB Input Device                                              Not shared

As you see, I already binded and attached BUSID 1-7. Now, I recompile the latest version of WSL using sudo make menuconfig making sure to enable the setting "USB Mass Storage" under device drivers. It compiled without error. I went to my home directory and I specified a .wslconfig pointing to my newly generated kernel. After all that is said and done, I go back to WSL2 and I run lsusb and I get:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 05ac:12a8 Apple, Inc. iPhone 5/5C/5S/6/SE
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

When I run lsblk, I still get:

NAME MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda    8:0    0 388.5M  1 disk
sdb    8:16   0     4G  0 disk [SWAP]
sdc    8:32   0   256G  0 disk /mnt/wslg/distro

What has it there? I recompiled the kernel and enabled all the device drivers. I am at a point of not knowing what to do anymore.

dorssel commented 7 months ago

What's in the WSL syslog when you attach?

bootsareme commented 7 months ago

/var/log/syslog does not exist as a file or directory.

dorssel commented 7 months ago

If you are not running a syslog daemon (syslogd or journald), you can get live logging if you leave dmesg running.

This is really a Linux administration issue, judging from:

Bus 001 Device 002: ID 05ac:12a8 Apple, Inc. iPhone 5/5C/5S/6/SE

usbipd-win is working fine.

dorssel commented 7 months ago

usbipd-win just forwards the device, it does not care about the device type. The fact that the attach worked means that usbipd-win is working. It is now up to the client to load a driver for it and send URBs to the device.

I don't know that device type it is, maybe a block device requiring a special driver, maybe some other device type. But as far as usbipd-win is concerned, it doesn't matter. You really need to check the client (WSL) side logs/device tree to see what device drivers are required. A normal starting point would be syslog, or dmesg, or lsusb -v.

dorssel commented 7 months ago

There is no storage class amongst the interface listed. Maybe you need to enable that in the device (either before you plug it in, or approve file access after you plug it in). All seems working correctly otherwise.

dorssel commented 6 months ago

The device (in its current configuration) simply does not expose a mass storage interface; the mass storage driver simply isn't activated because the device does not support it (in its current configuration). That has nothing to do with the kernel. You probably need to configure the device itself somehow; maybe proprietary software is needed to configure the device (it has several "Vender Specific" interfaces after all).

In the end, this has nothing to do with usbipd-win, which itself is entirely device type agnostic. usbipd-win just passes through all USB traffic irrespective of the device type.