Skip to content

Feature proposal: show WSL serial device paths for attached USB devices #115

Description

@LZJ-I

Problem

Windows USB Bus IDs and WSL serial device names are different identifiers. For example, a device may use Bus ID 4-2 on Windows while appearing as /dev/ttyACM2 inside WSL.

This is easy to confuse, especially when several USB serial devices are attached. Currently, users must inspect WSL manually to determine which ttyACM node belongs to each Windows USB device.

Proposed change

Display the corresponding WSL serial device path on USB device cards for devices that are currently attached to WSL.

For example: WSL /dev/ttyACM2

I have implemented and validated this change in a fork. Since pull requests are currently disabled for this repository, I am sharing the implementation here for review.

Implementation

  • Query usbip port inside running WSL distributions.
  • Map the remote Windows Bus ID to the local USB device in WSL.
  • Walk /sys/class/tty/ttyACM* and /sys/class/tty/ttyUSB* to resolve serial device paths.
  • Display the resolved path on the matching attached USB device card.
  • Support multiple serial nodes associated with the same USB device.
  • Probe only running WSL distributions to avoid starting stopped instances.
  • Keep lookup failures non-blocking so the USB device list remains available.

The mapping uses the USB/IP Bus ID rather than VID/PID guessing.

Screenshot

The screenshot demonstrates why explicit mapping is useful: the Bus ID and ACM numbering do not have a direct sequential relationship.

Attached USB devices showing their WSL serial paths

Validation

  • Manually verified on Windows and WSL with three attached USB JTAG/serial devices.
  • Confirmed mappings for Bus IDs 2-2, 2-3, and 3-1 to /dev/ttyACM0, /dev/ttyACM2, and /dev/ttyACM1 respectively.
  • Confirmed that the Windows Bus ID remains visible alongside the WSL serial path.
  • Confirmed that serial path lookup failures do not prevent the USB device list from loading.
  • Successfully built the Windows debug and optimized release targets.
  • Successfully generated and installed the portable and Setup packages.

Source

Would you consider enabling pull requests so this can be submitted normally, or reviewing/cherry-picking the existing commit?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions