USB storage (exFAT) couldn't be mounted in WSL2 Kali

Kali is running in WSL2(Windows11) and usbipd is installed in both WSL2 and Kali. Now, after attaching USB storage to Kali in WSL, USB device could be found by the command “lsusb” and “dmesg | grep -i usb”, but it is not in the partition table by the command “fdisk -l”. Pls refer to the below information for detail. Thanks!


└─$ lsusb
Bus 002 Device 002: ID 0951:1666 Kingston Technology DataTraveler 100 G3/G4/SE9 G2/50
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[    0.116900] ACPI: bus type USB registered
[    0.116906] usbcore: registered new interface driver usbfs
[    0.116911] usbcore: registered new interface driver hub
[    0.116914] usbcore: registered new device driver usb
[    0.350038] usbcore: registered new interface driver cdc_ether
[    0.350293] usbcore: registered new interface driver cdc_ncm
[    0.350551] usbcore: registered new interface driver r8153_ecm
[    0.351517] usbcore: registered new interface driver cdc_acm
[    0.351784] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    0.352096] usbcore: registered new interface driver ch341
[    0.352297] usbserial: USB Serial support registered for ch341-uart
[    0.352601] usbcore: registered new interface driver cp210x
[    0.352817] usbserial: USB Serial support registered for cp210x
[    0.353077] usbcore: registered new interface driver ftdi_sio
[    0.353340] usbserial: USB Serial support registered for FTDI USB Serial Device
[    0.353782] vhci_hcd vhci_hcd.0: USB/IP Virtual Host Controller
[    0.354037] vhci_hcd vhci_hcd.0: new USB bus registered, assigned bus number 1
[    0.354794] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[    0.355223] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.355543] usb usb1: Product: USB/IP Virtual Host Controller
[    0.355824] usb usb1: Manufacturer: Linux 5.15.90.1-microsoft-standard-WSL2 vhci_hcd
[    0.356161] usb usb1: SerialNumber: vhci_hcd.0
[    0.356500] hub 1-0:1.0: USB hub found
[    0.357140] vhci_hcd vhci_hcd.0: USB/IP Virtual Host Controller
[    0.357378] vhci_hcd vhci_hcd.0: new USB bus registered, assigned bus number 2
[    0.357729] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    0.358167] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.15
[    0.358464] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.358740] usb usb2: Product: USB/IP Virtual Host Controller
[    0.358969] usb usb2: Manufacturer: Linux 5.15.90.1-microsoft-standard-WSL2 vhci_hcd
[    0.359837] usb usb2: SerialNumber: vhci_hcd.0
[    0.360336] hub 2-0:1.0: USB hub found
[    0.365180] usbcore: registered new interface driver usbhid
[    0.365368] usbhid: USB HID core driver
[   78.536856] usb 2-1: SetAddress Request (2) to port 0
[   78.537989] usb 2-1: new SuperSpeed USB device number 2 using vhci_hcd
[   78.590113] usb 2-1: New USB device found, idVendor=0951, idProduct=1666, bcdDevice= 1.10
[   78.592078] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   78.593359] usb 2-1: Product: DataTraveler 3.0
[   78.594625] usb 2-1: Manufacturer: Kingston
[   78.595454] usb 2-1: SerialNumber: F542FAEF10B6E660A92314C4

└─$ sudo fdisk -l
Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram1: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram2: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram3: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram4: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram5: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram6: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram7: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram8: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram9: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram10: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram11: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram12: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram13: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram14: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/sda: 363.32 MiB, 380968960 bytes, 744080 sectors
Disk model: Virtual Disk
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sdb: 2 GiB, 2147487744 bytes, 4194312 sectors
Disk model: Virtual Disk
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/sdc: 256 GiB, 274877906944 bytes, 536870912 sectors
Disk model: Virtual Disk
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
└─$ sudo lsblk
NAME MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda    8:0    0 363.3M  1 disk
sdb    8:16   0     2G  0 disk [SWAP]
sdc    8:32   0   256G  0 disk /mnt/wslg/distro
/

When using USB devices with WSL (Windows Subsystem for Linux), you may encounter some difficulties due to the fact that WSL is not a full-fledged Linux kernel and does not have complete hardware support for certain devices like USB storage.

That being said, WSL 2 does support USBIP which is a protocol that enables to use USB devices over a network by routing USB device traffic.

If you’ve correctly set up USBIP and the device is showing up with lsusb and dmesg, but not with fdisk -l, there are several possible causes:

  1. The device is not a storage device or does not have a valid partition that fdisk can recognize.
  2. The device could be mounted already. Try checking your mount points with the mount command.
  3. The device could be in use or locked by another process, possibly on the Windows host.

Here are some steps to diagnose the issue:

  1. Confirm the device type: Make sure that the USB device you are trying to access is indeed a storage device. You should see this information when you run the lsusb command.
  2. Check if the device is already mounted: Run the mount command to list all the mounted filesystems. If your USB device is listed, then it is already mounted and that’s why it’s not showing up with fdisk -l.
  3. Unmount the device: If the device is mounted, try to unmount it with umount /path/to/mount/point.
  4. Check for locked resources: It’s possible that the device is in use or locked by another process. You can try using the lsof command to check if any processes are using the device.
  5. Check on the Windows side: Make sure that Windows is not using the device. Windows may take over control of the device when it’s plugged in, preventing WSL from accessing it.

If the issue persists, there may be deeper problems with WSL’s USB device support or with the USBIP setup. Please provide additional information about your setup and the steps you’ve taken so far if you need more specific advice.