Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Pass through a usb device to a docker

Featured Replies

Is it possible to pass through a USB device to a docker?

 

I'm trying to pass a Kindle to the Calibre docker. Browsing around all I can find is passing the device using Extra Paramaters. 

 

--device=/dev/bus/usb/###/###

 

I don't get errors in the docker set up, but see this in the logs. 

 

raceback (most recent call last):
  File "calibre/devices/usbms/device.py", line 561, in do_mount
  File "calibre/devices/udisks.py", line 139, in mount
  File "calibre/devices/udisks.py", line 44, in __enter__
  File "jeepney/io/blocking.py", line 342, in open_dbus_connection
  File "jeepney/io/blocking.py", line 310, in prep_socket
  File "jeepney/io/blocking.py", line 307, in with_sock_deadline
FileNotFoundError: [Errno 2] No such file or directory

 

Is this even possible? Any guidance?

  • Community Expert

yes, but sometimes a mounted usb has other locations need to pass or doen't like being mounted then pluged in to another machine...

?what device are you passing to what docker?


As the docker image may/will need additional packages etc to use the device...

For example in my plex I pass a usb antenna coax tuner device.
Extra parm

--device=/dev/dvb/

(I could use the template and add device) 

 

You need to make sure your grabbing the correct device and all its sub devices:
image.png.0fe09860f8097fc4df21ee288043bfe7.png

as example:

 

image.thumb.png.1a13dcfbf2d27febbac614deea27f80d.png

 

Some devices may need extra parm options, if full bus pass is not working you may need to pass this and look into passing via its serial ID.

--cap-add SYS_ADMIN


Proff of concept:

Docker Compose example:

devices:

- “/dev/bus/usb:/dev/bus/usb” # Mount the entire USB bus

devices:

- “//./USB/VID_1248&PID_1001/5&271999B4&0&1”

cap_add:

- SYS_ADMIN

 

Similar to sr-iov, some usb device don't support moving forward unless they are sent the system unbind command...
you can list your current devcie with this command:

ls /sys/bus/usb/devices/

 

example:

image.thumb.png.6691a0668a0f43c4a007b16170c84ffb.png

 

ls /sys/bus/usb/devices/11-2/
echo '11-2' | sudo tee /sys/bus/usb/drivers/usb/unbind

will touch my usb attached disk driver. then unmount the entire usb port, making it easer to mount and rebind elses where.

You can get more info with command:
 

udevadm info -q property -n /dev/bus/usb/$BUS/$DEV

*replace Bus# and Dev#
 

https://www.losant.com/blog/how-to-access-serial-devices-in-docker

with unraid v7 we have access and can use udev rules...

mkdir /boot/config/udev
touch /boot/config/udev/99-serial.rules

You can then make a udev rule that is applied at boot...

 

Otherwise you need to list the serial id and pass it via the serial id:

ls -l /dev/serial/by-id

extra parm:

--device=/dev/serial/by-id/#########

as: /dev/serial/by-id/ is a directory that contains symbolic links to serial devices (like USB-to-serial converters) identified by their unique ID


Usually on the forum, its peps trying to pass a Zigbee to a HA docker...

examples:

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.