I’m running Docker Desktop on Windows and using an Ubuntu image.
I would like to access hardware devices from inside my container:
- USB Serial adapters (Windows shows them as COM ports, e.g.,
COM3) - Bluetooth adapter (internal laptop Bluetooth or USB dongle)
On Linux hosts, I know it’s possible to pass devices like /dev/ttyUSB0 or /dev/rfkill into the container using --device=/dev/....
But on Windows, devices appear as COM ports, and Bluetooth is managed by Windows services.
Questions:
- Is there a way to map Windows COM ports (USB serial) into a Linux-based Docker container?
- Can I directly use the host’s Bluetooth adapter from the container, or do I need a workaround?
- If not directly possible, what are the recommended approaches (e.g., WSL2 passthrough, TCP bridges, or alternative setups)?
My goal is to run Python scripts inside the Ubuntu container that can talk to serial devices and scan/connect to Bluetooth devices.
Thanks in advance!