title: How to access USB ports from Docker Container on Mac OS
body: <p>I have created a Docker container for building and testing my <strong>Flutter</strong> apps. I want to connect my mobile device to the USB port of my Macbook and run Flutter apps directly on the device from the Docker container. But, I am unable to access the USB ports from the container and receiving this error.</p>
  
  <p><a href="https://i.stack.imgur.com/gNpAS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/gNpAS.png" alt="Error"></a></p>
  
  <p>I am using <strong>Remote Development</strong> extension inside my VS Code for running the container.</p>
  
  <p>The <code>devcontainer.json</code> file is attached below:</p>
  
  <pre><code>{
      "name": "flutter_docker",
      "context": "..",
      "dockerFile": "../Dockerfile",
      "remoteUser": "developer",
      "mounts": [
          "source=/dev/bus/usb,target=/dev/bus/usb,type=bind"
      ],
      "settings": {
          "terminal.integrated.shell.linux": null
      },
      "runArgs": ["--privileged"],
      "extensions": ["dart-code.flutter"],
      "workspaceMount": "source=${localWorkspaceFolder}/workspace,target=/home/developer/workspace,type=bind,consistency=delegated",
      "workspaceFolder": "/home/developer/workspace"
  }
  </code></pre>
  
  <p>Whenever I remove the <code>mounts</code> from the <strong>json</strong> file, it runs fine without any error.</p>
  
  <p>Removing this line:</p>
  
  <pre><code>"mounts": [
      "source=/dev/bus/usb,target=/dev/bus/usb,type=bind"
  ],
  </code></pre>
  
  <p><strong>Dockerfile:</strong></p>
  
  <pre><code>FROM ubuntu:18.04
  
  # Prerequisites
  RUN apt update &amp;&amp; apt install -y curl git unzip xz-utils zip libglu1-mesa openjdk-8-jdk wget
  
  # Setup new user
  RUN useradd -ms /bin/bash developer
  USER developer
  WORKDIR /home/developer
  
  # Prepare Android directories and system variables
  RUN mkdir -p Android/Sdk
  ENV ANDROID_SDK_ROOT /home/developer/Android/Sdk
  RUN mkdir -p .android &amp;&amp; touch .android/repositories.cfg
  
  # Setup Android SDK
  RUN wget -O sdk-tools.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
  RUN unzip sdk-tools.zip &amp;&amp; rm sdk-tools.zip
  RUN mv tools Android/Sdk/tools
  RUN cd Android/Sdk/tools/bin &amp;&amp; yes | ./sdkmanager --licenses
  RUN cd Android/Sdk/tools/bin &amp;&amp; ./sdkmanager "build-tools;29.0.2" "patcher;v4" "platform-tools" "platforms;android-29" "sources;android-29"
  
  # Download Flutter SDK
  RUN git clone https://github.com/flutter/flutter.git
  ENV PATH "$PATH:/home/developer/flutter/bin"
  
  # Run basic check to download Dark SDK
  RUN flutter doctor
  </code></pre>