From inside of a development container for VSCode (Debian Linux) I’d like to use a COM port for communication via an USB device connnected to the Windows host machine (via WSL2). How can I make the COM port available insie of the container?
EDIT:
For WSL2 there is no official support yet.
As of right now WSL 2 does not include serial support, or USB device support.
A corresponding feature request is tracked on GitHub.
2
Answers
July 2021: As of right now WSL 2 does not include serial support, or USB device support.
Update November 2021: the same FAQ states:
Skanda Hazarika reports:
So if you have:
Then, your VSCode should be able to access mounted USB drives through WSL.
April 2023:
Now it is possible to setup the whole chain of access to USB in Windows 10 with docker assuming Ubuntu on WSL2.
wsl --status
in windows cmd line)lsusb
(apt install usbutils
)/dev
. In this case you need to create a99-platformio-udev.rules
file in/etc/udev/rules.d
and add the definition of your usb device. See the github page for the list which probably will contain your selected device as well./dev/bus/usb...
rather then as/dev/ttyUSB
"--device=/dev/..."
to you.devcontainer
file runArgs section or to yourdocker run ...
command