Windows 2019 core docker container unabel to mount usb device

Madhu Kumar Reddy 1 Reputation point
2021-10-08T10:31:00.35+00:00

i'm trying to mount host usb device into windows 2019 core docker container with below command and it ran without any errors and in container no usb device found.

docker run -it --device="class/36fc9e60-c465-11cf-8056-444553540000" mcr.microsoft.com/windows/servercore:ltsc2019 powershell

Need help to mount usb device inside windows docker container.

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,315 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,436 Reputation points
    2021-10-11T08:20:04.033+00:00

    Hello

    I would do it in a different way. You can use the --device flag that use can use to access USB devices without --privileged mode:

    docker run -t -i --device=/dev/ttyUSB0 ubuntu bash

    Alternatively, assuming your USB device is available with drivers working, etc. on the host in /dev/bus/usb, you can mount this in the container using privileged mode and the volumes option. For example:

    docker run -t -i --privileged -v /dev/bus/usb:/dev/bus/usb ubuntu bash


    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments