Docker Community Forums

Share and learn in the Docker community.

Docker for Windows USB Support


(Ageraluon) #1

I am having trouble finding a definite answer as to whether or not docker for windows does currently support USB passthrough with the --device option. Is that the case?

Also, what options are available (VMWare / Docker Machine) to get USB support to run?
How about serial device support?

I am using windows server 2016 but desperately do need usb support for communication purposes…

Can anyone help me out in getting one or several of these questions sorted out?

Thank you!


Docker webcam access from Windows 10
(Tagc) #2

I also would really like to know if this is possible. It is on Docker Toolbox (you can passthrough USB devices to VBox) but it would really suck if this can’t be done on Docker for Windows under Windows 10 or Windows Server.


(Ericthealfabee) #3

Ditto me! running node-red as a container makes sense but buggered if it’s any use without access to the USB/Serial i/o


(Rolf Neugebauer) #4

Docker for Windows does not support USB pass through. I did a quick search and it appears that Hyper-V does not support this natively. Even if it did we would have to instrument the docker CLI and intercept the --device option and emulate them, which is non-trivial.


(Ageraluon) #5

Thanks for your replies, seems this is a use case that is also interesting to some others who want to connect docker applications with the “real world”

I’ve not had a chance to look over current progress in the last days, but am picking it up again right now. @rneugeba, according to my results, it seems that docker for windows does not use hyper-v but something called Windows Server Silos for windows containers (is that correct?), therefore there might still be a chance, for Windows host to windows container passing through, less so for linux containers, I agree.

As to my current research, there are two ways that might seem possible to me, I’ll test them further in the upcoming days.

  1. This approach here that I just stumbled over and am quite excited about:
    Windows Container App Compat: Access host COM ports from a Windows Server container
    He seems to describe a way to allow for direct device pass-through from Windows Hosts to Containers

  2. A more indirect approach, in which a USB Device is interfaced at driver-level, data translated to IP packets and then emulated as a device on the target.
    USBIP

  • The open-source free packet usbip seems to allow for that, any USB device (probably low-speed) can be transmitted over network and then emulated on the target. Disadvantage: The Host must currently be a linux pc, so the USB device would for example need to be inserted in an external raspberry pi. In my first approaches, I got a raspberry host set up, however the emulation in a docker container does not seem quite straightforward. In theory, the container should be able to be a windows or a linux container.

  • A commercial project based upon usbip: VirtualHere
    Seems to support Windows hosts, and is in comparison to the alternative above quite easy to use (GUI!). However, in order to use more than one device, you’d have to buy the software. With the free version, I was also not able to setup a device in the container in the end.

Both softwares cause a problem for me when emulating the device in the docker container. Although the software successfully connects to the host and sets up the device, I do not seem to be able to see/access it on the container. Maybe one of you would have more luck here…

@rneugeba, What would you say about an option to virtually pass usb devices via virtual network adapters, would you deem this feasible?


(Moshikkalash) #6

did you find something new ? i am using virtual box of Linux machines and it’s working find , but i would like to work with docker on windows directly without virtual box


(Wattsun) #7

Following this thread… very interested in knowing if this will be something that is rock solid in the near future?
I am interested in developing a container where a USB check scanning application can run in Windows


(Lehongduc87) #8

After installed Docker for Windows (with turning on Hyper-V) on Windows 10, I could not access my portable drive anymore. Even if I quit docker. USB port isn’t now showing my drive.
Please help me to get it back. Thanks.