sbs20 / scanservjs

SANE scanner nodejs web ui
https://sbs20.github.io/scanservjs/
GNU General Public License v2.0
686 stars 137 forks source link

Scanserv in an lxc container #715

Closed kingtat closed 4 months ago

kingtat commented 4 months ago

I've successfully run Scanservjs in a privileged docker container on my desktop machine as per the docs. I have resurrected an old scanner I had not realised was now supported by SANE! I'm now attempting to run in a Proxmox lxc container:

arch: amd64
cores: 1
features: nesting=1
hostname: scanserv
memory: 512
ostype: debian
rootfs: vmdisks:vm-140-disk-0,size=8G
swap: 512
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/001 dev/bus/usb/001 none bind,optional,create=dir

Within the container, the scanner is detected and a scan image successfully generated:

# scanimage -L
device `avision:libusb:001:023' is a Xerox DocuMate152 sheetfed scanner
# scanimage --device "avision:libusb:001:023" --format=tiff --output-file test.tiff

However Scanservjs does not find the scanner. How does scanservjs's device detection differ from that of say SANE utilities? I guess /var/run/dbus is some how involved. I have not made any provision for this in my container config other than making it privileged, nested and allow access to the relevant USB bus.

kingtat commented 4 months ago

This was a permissions issue. The scanserv process did not have write permission on the device. After modifying the permissions on the host via udev rules, I then ttried unprivileged lxc. Seems to be working well.

Many thanks for scanservjs.