Open tnqzh123 opened 3 years ago
Thanks for reporting this @tnqzh123.
This isn't officially supported but I think it should work. Can you share the output of dmesg
? There might be something useful in there
Hi @OneBlue
This is the output of dmesg
:
And I found that it seems USB storage support is not enabled by default in WSL's kerenel: https://github.com/microsoft/WSL2-Linux-Kernel/blob/918dbaa9fa4aa665c9e5fe44489dd453da7cadeb/Microsoft/config-wsl#L2374-L2380
Does this mean I need to build my own kernel to support USB storage?
Hi @OneBlue
I tried to build my own kernel with USB_STORAGE
enabled, and it works - I can get the block files under /dev
directory.
But I get another problem now: when I try to access the SD card(e.g. mount
or fdisk
), it will be detached, and WSL will give me an error(e.g. device does not exist
). Here is the output of dmesg
:
The SD card reader(Genesys Logic USB2.0 Card Reader) is built-in my Lenovo YOGA 14sARE 2020(or, in the outside of Mainland China, Lenovo YOGA Slim 7 14ARE05). I've tried use another USB SD card reader(Genesys Logic USB3.0 Card Reader), it works normally. Is this problem caused by the built-in SD card reader, or WSL, or USBIPD-WIN?
This is a workaround that works for me: https://github.com/jovton/USB-Storage-on-WSL2
Maybe it's better way to solve this issue for those who come after. https://dowww.spencerwoo.com/4-advanced/4-4-usb.html#usbip-win
What a shame this doesn't work OOB. Needed to change dietpi wifi settings on sd card... Ended up using linux in VM.
Ridiculous that this doesn't work.
updated https://github.com/microsoft/WSL/issues/11335 w/ commit and temp. gist to build the modules .. currently presumes you've already setup the env to build it though. Confirmed mount and fdisk worked without issue as well.
(for USBIPD) wouldn't it be possibe to add the USB-Mass storage as a module with sudo modprob?
Version
Microsoft Windows [Version 10.0.22504.1010]
WSL Version
WSL 2
Kernel Version
5.10.60.1-microsoft-standard-WSL2 (installed by Windows Update)
Distro Version
Ubuntu 20.04
Hi there, I need to backup my USB storage(a partitioned 64G SDXC card used in my Raspberry Pi, adapted to PC by the built-in USB SD card reader) by
dd
tool in WSL 2. I followed Connect USB devices | Microsoft Docs, usedusbipd
to attach my USB storage to WSL lightweight VM:and the USB storage has shown up in
lsusb
output in WSL 2:But no block file appears under
/dev
directory. Could you please tell me how to access my USB storage devices in WSL 2? Thanks.