Exposing USB COM serial devices to Docker Windows container

Viewed 1157

I have a script that I want to run as a container. It depends on a an USB camera to run.

My host is a Windows 10 IoT Enterprise machine. I have tried exposing the COM serial ports of my host through WSL 2 to a Linux container, but exposing COM serial ports through WSL 2 its currently not supported, so my only option is using Windows containers.

I followed the process used in the Microsoft documentation to expose devices (Just mirroring the OS and version from my host which would be 20H2, and using the GUID for COM serial ports)

docker run --isolation=process --device="class/86E0D1E0-8089-11D0-9CE4-08003E301F73" mcr.microsoft.com/windows:20H2

The container is created and runs for a couple seconds, but when connected to the CLI it displays this error: container 5245931c246cc8181221354158bf7ddad64eb5099a493354a68a39d94feed6f0 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The requested virtual machine or container operation is not valid in the current state. (0xc0370105)

Docker information:

Server: Docker Engine - Community
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.24)
  Go version:       go1.13.15
  Git commit:       b0f5bc3
  Built:            Wed Jun  2 11:56:41 2021
  OS/Arch:          windows/amd64
  Experimental:     false

Any feedback will be appreciated, thanks!

0 Answers
Related