This guide is provided for educational purposes. The author is not responsible for any damage to your system, hardware, or USB devices that may result from following these instructions. USB device forwarding, driver modifications, and running commands as administrator carry inherent risks. Always ensure you understand the commands before executing them, have appropriate backups, and verify device compatibility. Use at your own risk.
- Windows 11
- WSL2 (Ubuntu or other distro)
usbipd-wininstalled on Windows:winget install dorssel.usbipd-win
This guide shows how to connect USB devices such as STM32 boards or TinyFPGA to WSL2 using usbipd-win.
Important: All usbipd commands must be run in PowerShell as Administrator.
Open PowerShell as Administrator and run:
usbipd listLook for your target device by BUSID (e.g., 1-3).
Example:
1-3 0483:374b ST-Link Debug, USB Mass Storage Device, STMicroelectronics Not shared
Still in PowerShell as Administrator:
usbipd bind --busid 1-3Still in PowerShell as Administrator:
usbipd attach --busid 1-3 --wslIn your WSL2 terminal:
dmesg | grep ttyExample output:
ttyACM0: USB ACM device
ls /dev/ttyACM0or
ls /dev/ttyUSB0sudo apt install minicom # if not installed
minicom -D /dev/ttyACM0 -b 115200When you're finished using the USB device, you can detach it from WSL2. In PowerShell as Administrator:
usbipd detach --busid 1-3This will disconnect the device from WSL2 but keep it bound for future use. To completely unbind the device:
usbipd unbind --busid 1-3You can also check which devices are currently attached:
usbipd list- This must be done each time the device is replugged or the system is restarted.
- You can access other USB-based tools (e.g., TinyFPGA) the same way.
- For FPGA development (e.g., TinyFPGA + icestorm):
- Bind and attach the device as above
- Then run:
tinyprog --program firmware.bin