microsoft / microsoft/WSL

Add USB device passthrough support for WSLC

Open
#41,031 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature wslc
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

**Is your feature request related to a problem? Please describe.**
Yes. There is currently no apparent way to pass USB devices into WSLC containers.
This limits the usefulness of WSLC for hardware-related workloads.

For example, USB devices can be attached to WSL successfully using usbipd-win:
```usbipd attach --wsl --busid ```
The device is visible inside a normal WSL distribution:
```lsusb```
However, inside a WSLC container, the USB device is not visible:
```lsusb```
returns no devices, and:
```ls /dev/bus/usb```
returns:
```No such file or directory```

Currently, `wslc run --help` provides options such as `--gpus` and `--volume`, but there does not appear to be an equivalent to Docker's `--device` option.
This prevents WSLC containers from being used for many hardware-accelerated Linux workloads, such as robotics, cameras, embedded development, and scientific instruments.

**Describe the solution you'd like**
I would like WSLC to provide a way to pass USB devices (or more generally Linux device nodes) into containers.
A Docker-compatible approach would be:
`wslc run --device /dev/bus/usb ...`
or a WSLC-specific mechanism such as:
`wslc run --usb all ...`
The solution should allow devices already attached through `usbipd-win` to WSL to be selectively exposed to WSLC containers.

A more general device passthrough mechanism (similar to Docker's `--device` or `--privileged`) would also be useful for:
- USB cameras (`/dev/video*`)
- USB serial devices (`/dev/ttyUSB*`)
- development boards
- FPGA/JTAG adapters
- industrial sensors

**Describe alternatives you've considered**
Using Docker Desktop with WSL2 is currently the main alternative.
Docker already supports device passthrough through options such as:
```
--device
--privileged
```
However, this introduces another container runtime layer on top of WSL.

One of the main advantages of WSLC is that it is a native Windows-managed Linux container environment with direct integration into WSL features such as GPU support. Adding device passthrough would make WSLC a more complete alternative for hardware-enabled Linux containers.
Another workaround is running applications directly inside a WSL distribution instead of a container, but this loses the isolation and reproducibility benefits of containers.

**Additional context**
Environment:
- Windows 11
- WSLC version: `2.9.3.0`
- USB forwarding: `usbipd-win`

WSLC has great potential for workloads that combine:
- GPU acceleration
- Linux environments
- Windows hardware integration
Examples:
- ROS2 robotics
- NVIDIA Isaac / FoundationPose
- RealSense and depth cameras
- USB cameras
- embedded Linux development
- FPGA tools

Adding USB/device passthrough support would significantly expand the practical use cases of WSLC
: )

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the `wslc run --help` entry point and compare its existing `--gpus` and `--volume` options with Docker's `--device` and `--privileged` behavior. Done means WSLC can selectively expose devices already attached to WSL through `usbipd-win`, including USB, video, serial, or other Linux device nodes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, docker, linux
Domain
infrastructure, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.