-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serial port unavailable under Windows even with --privileged flag #1018
Comments
Thanks for opening this issue for tracking this feature request. We've had a few similar requests for USB device support. Currently this is not a design use-case for Docker for Windows. You might be able to achieve what you want by setting up a separate hyper-v (or virtualbox) VM and installing Docker in that. That would give you more freedom to use hyper-v features like attaching special host-hardware and using it with Docker Linux containers. You can even use Docker Machine to automate part of this process: https://docs.docker.com/machine/drivers/hyper-v/ |
Does this issue still persist? I'm also looking for a way to connect serial devices to containers in Docker for Windows. |
Nope it doesn't seems to be an issue that is going to be solved soon. I've
simply dropped using docker in this context and moved to something else.
Le 17 nov. 2017 23:55, "Vitalii Plagov" <[email protected]> a écrit :
… Does this issue still persist? I'm also looking for a way to connect
serial devices to containers in Docker for Windows.
@sieben <https://github.com/sieben> did you find any working option for
your use-case?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1018 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AASXIq-dYQ_ySN0g9H9RBUfAy8EjVOtkks5s3g7tgaJpZM4O796v>
.
|
I would also love to have serial ports implemented in Docker For Windows. |
There is high demand from people that want to use Docker for cross platform embedded toolchain environments. Maybe the Docker team should reconsider... |
I would definitely love to see this implemented. It will be a much more common request since Azure IoT Edge leverages docker containers for modules -> http://docs.microsoft.com/en-us/azure/iot-edge |
Does this issue still persist? this issue is highly demanded by a lot of people |
Hyper-V does not seem to allow passing through local USB devices to a VM so we can't expose serial USB device or similar to the VM running linux containers |
Any update on this issue? is it supported now? i was exploring for similar results on windows host. |
This feature is highly desired to use with Azure IoT Edge. Is this going to be implemented soon? |
I'd be very interested in this feature as well. (Need to talk to COM-ports from Docker containers..) |
Hi folks, My team is interested in learning more about the needs discussed in this thread and to better understand what outcomes you are trying to enable. We'd be interested in hearing your responses to the following questions:
Thanks in advance for any details you can provide to help us better understand how your needs could be met. |
|
|
What scenarios are you targeting? Azure IOT Edge scenarios that talk to hardware... Are the scenarios primarily for IoT enterprise solutions? yes What type of devices are you interfacing with that require serial or USB access (specific examples would be great)? industrial machines that talk over RS232; Modbus over serial; GPIO/I2C/SPI-based sensors Is there any workaround or interim solution that might solve your needs in the absence of access from containers? Nope Are you looking to use Win32 APIs (CreateFile, ReadFile, WriteFile, DeviceIoControl, etc.) or some other APIs to access these devices? System.IO.Ports for C#; pyserial for python; serialport for node, etc... Can you identify which APIs would be required to meet your needs? |
Thanks for the responses you provided and apologies for not getting back to this thread sooner. I was waiting for a blog post to go live that explains some work Microsoft is doing in this area. Please take a look at the post here and feel free to provide feedback directly on the TechNet site: https://blogs.technet.microsoft.com/virtualization/2018/08/13/bringing-device-support-to-windows-server-containers/ |
@lenz45 Is it possible to use a com device insinde a linux container on a windows host?? |
@s4ndst0rm |
All we need to be able to do is map Windows COM ports to /dev/ttyUSBxx devices inside the Docker container. Our Dockerfile works on Linux. |
We also need access to an RS232 interface from Linux Docker running on a Windows host. |
@lenz45 |
Embedded device build, flash and test |
For the sake of a "me too":
|
|
I think everyone in this thread faces the same issue that we had hoped docker would solve: How do I consistently deploy a program on any environment which requires access to embedded system peripherals? On linux, docker solved a lot of problems I was having with machine-specific compatibility issues which made deployment a pain. I would be a raving fan if the same could be said for windows and mac. What scenarios are you targeting? Are the scenarios primarily for IoT enterprise solutions? What type of devices are you interfacing with that require serial or USB access (specific examples would be great)? Is there any workaround or interim solution that might solve your needs in the absence of access from containers? I will need to give up the standardization of a docker container and ensure that each machine can run the software manually. Are you looking to use Win32 APIs (CreateFile, ReadFile, WriteFile, DeviceIoControl, etc.) or some other APIs to access these devices? Can you identify which APIs would be required to meet your needs? Just need simple way to get a linux container to access com ports on a windows host. Thanks |
|
In my case I have Win 10, with Zigbee USB stick (serial COM) and Home Assistant running as a docker container based on Linux image. |
I'm having the same issue, but is there any other way or an alternative? This issue could potentially prevent me from using Docker with my project. |
I'd be very interested in this feature as well. (Need to talk to COM-ports from Docker containers..) |
is anybody have idea - connecting docker container with COM2 port? |
@Manish5432 Just a workaround, try with a network COM port forwarder. |
Can you give me some sample url or guide me how i can do with network COM port forwarder. |
It has been a while since I used this technique. And back then I mapped a USB port on a Raspberry Pi to Linux. |
Aparently it is posible to access serial ports on WSL: https://icircuit.net/accessing-com-port-from-wsl/2704 Is it still impossible to do this on Docker? EDIT: Argh, I guess this is the problem: microsoft/WSL#4322 |
Seems like "me, too" isn't going to help me -- my need is now. This stinks. I was halfway into my project and now need to recalibrate to do it without docker I guess. |
I switched to native Linux. In fact that made me optimize my solution so i don't install Hassio anymore and I don't regret it much. |
I am trying to interface a serial device via csv file to a COTS windows based program. I think I need to try to run a windows container for my app (a la https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/hardware-devices-in-containers) and linux containers for the database, web server, etc. UPDATE: From https://hub.docker.com/_/microsoft-windows, "Windows requires the host OS version to match the container OS version.", which doesn't exactly meet what I'm trying to achieve. Maybe I'll bolt on a serial device reader process outside of the docker environment, to feed a linux container with the serial device outputs. Bleh. |
This feature would be really nice to have. |
I haven't seen any mention of usbipd in this thread, so here it is. I use usbipb on Windows 11 to bind and attach COM ports on Windows 11 to docker containers (ttyACM0, etc) that I use for building and flashing embedded devices. The important bit is adding |
Any update on this? I also need to talk with serial ports from a docker container on Windows machines |
I ditched it and took a raspberry pi with Linux... Docker on windows seems
to be a twisted idea IMHO.
…On Sat, Aug 24, 2024, 18:25 JoseRamonGarcia ***@***.***> wrote:
Any update on this? I also need to talk with serial ports from a docker
container on Windows machines
—
Reply to this email directly, view it on GitHub
<#1018 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWBFXFBOZ22V2DT3COSIFTZTCXYXAVCNFSM4DXP32X2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMZQHA2DINZRGQ2A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
In my case, move to a linux machine is not an option, because I need to run Windows software in the host machine, and at the same time, linux software inside a docker container, and I need access the host serial port within the container. I'm trying the usbipd-win / wsl2 option, and it appears to be a good approach. |
Fwiw I put a serial driver running outside of the container and sent the
data to the container thru rest interface
On Sat, Aug 24, 2024, 8:03 PM JoseRamonGarcia ***@***.***>
wrote:
… In my case, move to a linux machine is not an option, because I need to
run Windows software in the host machine, and at the same time, linux
software inside a docker container, and I need access the host serial port
within the container.
I'm trying the usbipd-win / wsl2 option, and it appears to be a good
approach.
I ditched it and took a raspberry pi with Linux... Docker on windows seems
to be a twisted idea IMHO.
… <#m_-1715722998267304335_>
On Sat, Aug 24, 2024, 18:25 JoseRamonGarcia *@*.*> wrote: Any update on
this? I also need to talk with serial ports from a docker container on
Windows machines — Reply to this email directly, view it on GitHub <#1018
(comment)
<#1018 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABWBFXFBOZ22V2DT3COSIFTZTCXYXAVCNFSM4DXP32X2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMZQHA2DINZRGQ2A
<https://github.com/notifications/unsubscribe-auth/ABWBFXFBOZ22V2DT3COSIFTZTCXYXAVCNFSM4DXP32X2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMZQHA2DINZRGQ2A>
. You are receiving this because you commented.Message ID: @.*>
—
Reply to this email directly, view it on GitHub
<#1018 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGVVAW4PZLRH54SYTNIEA3ZTDDG5AVCNFSM4DXP32X2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMZQHA2DONRTHA3A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hitting the same idea, take a look at com0com. It works with named pipes and tcp on windows and linux. Perhaps its possible to „mount“ the named pipe and thus to send the data. |
I discarded the usbipd-win / wsl2 option, because of my serial port is native, not USB, so usbipd doesn't have access to it. I will try com0com / hub4com / socat approach. |
We now have a potential solution in the form of USB/IP. I wrote up details here. |
Description
I got a device that talk over serial port. On Unix it shows up as a /dev/ttyUSB0, on Windows as a COM.
I would like to be able to talk to this serial device from a container running on top of Docker for Windows.
Steps to reproduce the issue:
Describe the results you received:
Describe the results you expected:
There should be a ttyUSB0 showing up
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:The text was updated successfully, but these errors were encountered: