Debian container unable to access host USB devices - lsusb returns empty

I am trying to get my docker container (Debian Arm64) to access the usb devices on my Raspberry Pi OS host (RPi 4) and failing.

If I run the following command using --privileged command, nothing is returned by lsusb:

docker run --rm -it --privileged debian bash
root@fe612fde137f:/# apt-get update && apt-get install -y usbutils
root@fe612fde137f:/# lsusb
NOTHING RETURNED

If I run lsusb in a terminal outside the container, all connected usb devices are returned as expected.

Also, I am unable to see /dev/bus/usb from within the container, even when using the --privileged or --device options:

docker run --rm -it --privileged --device=/dev/bus/usb debian bash
root@fe612fde137f:/# cd /dev/bus/usb
ls: cannot access '/dev/bus/usb': No such file or directory

I have also tried mounting /dev/bus/usb as a volume, but lsusb still returns nothing.

If, however, I create an ubuntu base image, lsusb returns all devices and /dev/bus/usb is visible from within the container. However, I can only use Debian for my project :frowning:

Any ideas?

Thanks

Paul

26D. These threads aren’t that active are they?

You ran “cd”. Try -v /dev/bus/usb:/dev/bus/usb or use --device on one of the underlying usb files within the folder structure.

I had a similar problem and solved it this way:

  1. identify the device the host was using for the usb-device:
    (host) sudo fdisk -l

    Disk /dev/sdd: 1,88 GiB, 1999568384 bytes, 3905407 sectors
    Disk model: DataTraveler 2.0
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x7c7f7cbe

Device Boot Start End Sectors Size Id Type
/dev/sdd1 63 3904991 3904929 1,9G 6 FAT16

  1. run the container with --privileged option

  2. mount the device in the container:

(container) mount /dev/sdd1 /mnt

and the contents of the usb device were accessible for the container.

By the way, the --device option does not help, neither with --device=/dev/sdd1 nor --device=/dev/bus/usb/nnn/mmm nor --device=/dev/bus/usb