Skip to content

Friendly reminder

WSL (Windows Subsystem for Linux) is recommended for development — it is lighter and starts faster than a virtual machine.

Operation Steps

1
Open PowerShell as administrator

Search for PowerShell in the Windows Start menu, right-click it and choose Run as administrator, then run the command below to install the Linux subsystem (it downloads from the internet, so be patient):

wsl --install
2
Restart your computer

Restart your computer as prompted (save your work first). The first time you open WSL after rebooting, component initialization finishes automatically.

3
Install Ubuntu

After WSL is ready, install the Ubuntu distribution and finish the basic setup — see Ubuntu installation tutorial — WSL section

4
Install USBIPD-WIN (serial mapping tool)

Windows 11 WSL2 does not support automatic serial port mapping, so serial devices must be mapped into WSL2 manually. First download and install USBIPD-WIN: download usbipd-win_5.2.0_x64.msi. Double-click the installer, follow the prompts, then restart your computer.

5
List USB devices

Open PowerShell as administrator and run the command below to list all USB devices attached to Windows; select and copy the bus ID of the device you want to attach to WSL (e.g., 4-4):

Keep a WSL command line open before attaching a device so the WSL2 lightweight VM does not go to sleep.

usbipd list
6
Share the USB device

Run usbipd bind to share the device so it can be attached to WSL (requires administrator rights). Replace 4-4 with the bus ID you copied, then run usbipd list again to confirm the device is shared:

usbipd bind --busid 4-4
7
Attach the device to WSL

Run the command below to attach the device to WSL:

  • While attached, Windows cannot use the device — this is expected
  • Once attached, every distribution in WSL2 can access the device
usbipd attach --wsl --busid <busid>
8
Verify the device in WSL

Open Ubuntu (or your preferred WSL command line) and list the serial devices — seeing the attached device means the mapping worked:

ls /dev/ttyACM*
9
Detach the USB device

After using the device in WSL, you can unplug it physically, or detach it from PowerShell with the command below (replace <busid> with the actual bus ID):

usbipd detach --busid <busid>

FAQ

usbipd is not recognized as a command

USBIPD-WIN was not installed successfully, or the computer was not restarted after installation; reinstall, restart, and open PowerShell as administrator again.

usbipd attach says the device is not shared

Share the device first with usbipd bind --busid <busid> and confirm it shows as shared in usbipd list, then attach.

ls /dev/ttyACM* shows nothing

Make sure a WSL command line is kept open. Serial devices are usually /dev/ttyACM0 or /dev/ttyUSB0; you can also run lsusb to check whether the USB device is attached.

Have questions?

For any other questions, visit the unified Q&A and discussion board: Ai-Thinker Discussions

Released under the MIT License. Build Time 2026-09-11 14:52:23