olbat / dockerfiles

A collection of Dockerfiles
https://hub.docker.com/u/olbat/
GNU General Public License v3.0
134 stars 73 forks source link

Printer not detected under 'add printer' #86

Closed micookie closed 1 year ago

micookie commented 1 year ago

Printer not detected under 'add printer'

deploy in Synology Docker

run docker command:

docker run -d --privileged=true -e TZ="Asia/Shanghai" -v /var/run/dbus/:/var/run/dbus/ -v /dev/bus/usb:/dev/bus/usb --net=macnet --name cupsd2 olbat/cupsd

Printer Device : HP 1020 Plus, the printer connect to windows11 printer is ok.

On host lsusb command show:

root@DSM:/dev/usb# lsusb
|__usb1          1d6b:0002:0404 09  2.00  480MBit/s 0mA 1IF  (Linux 4.4.180+ xhci-hcd xHCI Host Controller 0000:00:14.0) hub
  |__1-5         0424:2514:0bb3 09  2.00  480MBit/s 2mA 1IF  ( ffffffd1ffffffb2ffffffdbffffffad) hub
    |__1-5.2     03f0:2b17:0100 00  2.00  480MBit/s 98mA 1IF  (Hewlett-Packard HP LaserJet 1020 S40NYLT)
|__usb2          1d6b:0003:0404 09  3.00 5000MBit/s 0mA 1IF  (Linux 4.4.180+ xhci-hcd xHCI Host Controller 0000:00:14.0) hub
  |__2-1         f400:f400:0100 00  3.00 5000MBit/s 896mA 1IF  (SanDisk Ultra 4C531001390903111360)

i try many docker container, only gmkey/cups-avahi-airprint can find my Printer device, but it still can not print Test-Page.

but i want use olbat's

tks~

EnerGeh commented 1 year ago

Beside it's not recommended to run containers privileged, try out to run it unprivileged and pass the usb device directly via command line switch --device=/dev/bus/usb/001/005 and would be good if you'd avoid that usb hub and attach the printer directly.

olbat commented 1 year ago

Is the problem solved with that trick @micookie ?

micookie commented 1 year ago

sorry, not work。

olbat commented 1 year ago

Is the printer still plugged in through thhe same port?

olbat commented 1 year ago

No answer, I assume that the problem is gone. Closing the issue.