WSL2 SD Card Support Fix Guide
Root Cause
WSL2's default kernel lacks SD card support due to Microsoft removing the CONFIG_USB_STORAGE
module in their official WSL2 kernel.
Solution
Re-enable SD card support using a custom kernel.
Step 1: Install Custom Kernel
Download Prebuilt Kernel
Visit Locietta/xanmod-kernel-WSL2 Releases page- Recommended:
x64v2
version (compatible with most modern CPUs)
- Recommended:
Place Kernel File
Save the downloadedbzImage
to your Windows user directory, e.g.:
C:\Users\YourUsername\custom-wsl2-kernel
- Configure WSL2
Create
.wslconfig
in your user directoryAdd configuration (note path escaping):
[wsl2] kernel = C:\\Users\\YourUsername\\custom-wsl2-kernel
- Restart WSL2
Execute in PowerShell:
wsl --shutdown
Step 2: Configure USB Redirection
Install USB/IP Tool
Install via Winget:winget install --interactive --exact dorssel.usbipd-win
Bind SD Card Device
List USB devices:
usbipd list
Note target device's
BUS-ID
(e.g.,3-1
)Bind device:
usbipd bind --busid <BUS-ID>
Attach to WSL2
usbipd attach --wsl --busid <BUS-ID>
Verification
In WSL2 terminal execute:
dmesg | grep -i usb
Expected output:
[ 5.112233] usb-storage 1-1:1.0: USB Mass Storage device detected
Technical Context
Official Issue: CONFIG_USB_STORAGE not enabled in default kernel #11335
Custom Kernel Principle: Re-enables
CONFIG_USB_STORAGE
via Xanmod kernel patches
Note: USB device redirection must be re-executed after each host reboot