❌

Normal view

Guide - Use docker to operate legacy scanner hardware on Windows 11

Guide - Use docker to operate legacy scanner hardware on Windows 11

So I have my fairly old Canon LiDE 60 flatbed scanner, which I need occasionally to scan documents.
This scanner is somewhat like 20 years old!
Despite its age, it's doing its job, and it's doing it quite well.

The biggest issue?
Getting it to work on Windows 11, without setting up a dedicated virtual machine with Windows XP just for this scanner.
I hesitate to get a replacement, because I hate throwing away perfectly working hardware and creating unnecessary e-waste, just because driver support dropped.

What I tried:
- VueScan: The trial version works like a charm. VueScan recognizes the LiDE 60 and the scan results are beautiful, the post-processing is good.
Unfortunately, the trial of VueScan prints a huge watermark overlay, making the scans unusable. I'm absolutely not willing to pay ~ 85 € for this

(heck, even the one-year license for about ~ 25 € is not barely worth it.
For 85 € I can get a new scanner, which is compatible with Windows 11, and for 25 € a used model).
The VueScan pricing is absolutely ridiculous, at least for a bog-standard flatbed scanner (I know they also support film scanners, which is a different story and probably worth the license fee, but absolutely not in my case).

And attempting to find a crack / patcher for VueScan is the best way to get some nice Malware on the machine. The search results are flooded with fakes and I'm not willing to spend my time and taking the risk to find a legit crack.

- Reusing the Windows 7 driver: Well. It used to work until some Windows 10 update. And I haven't managed to get it back it work since then, also not on Windows 11. According to a comment, it's supposed to work, but whatever 💁

- Virtual Machines with VirtualBox: Works with Windows XP as well as Ubuntu. But this solution is fairly slow and inconvenient. Also, wasting at least 20 GB of space for a VM, just as a scanner driver replacement, is crazy. I don't need the VM all the time on my machine, but every new VM setup takes up some time and is annoying.
So, the VM solution is somewhat ok. It does its job. But it feels clumsy and I don't like this approach.

VueScan is out of the game, as is the legacy Windows 7 driver. What is left? Virtualization!
But a VM is somewhat clumsy and heavyweight. I seek a more lightweight and elegant solution.
Like Docker containers.

Can we containerise Linux scanner drivers and expose scanning software through a web interface out of the container? Yes, we can!
And luckily, someone already wrote that software. And also provides a Docker container.
May I introduce scanservjs?

So we have a Docker container with all the required software stack. We just need to connect it wit our scanner and let's go.

Prerequisites / Installations:
- Docker is installed and the WSL 2 backend enabled (this is currently the default engine). Docker must also be running.
- usbpid-win must be installed.

One-time setup:
- Download the Docker container: docker pull sbs20/scanservjs
- Open a terminal with administrator privileges for usbipd.
- List the USB devices and find the busid of the scanner with usbipd list
(the busid is 6-3 of the CanoScan LiDE 60 in this example.
It will be different on your machine! Use the busid of your scanner)

Connected:
BUSID VID:PID DEVICE STATE

1-4 04f2:b71c Integrated Camera, Integrated IR Camera Not shared
3-1 0bda:9210 USB Mass Storage Device Not shared
3-3 27c6:6594 Goodix MOC Fingerprint Not shared
3-4 8087:0029 Intel(R) Wireless Bluetooth(R) Not shared
4-1 17ef:3062 Lenovo USB Ethernet Not shared
6-2 17ef:3060 Billboard Device, USB Input Device Not shared
6-3 04a9:221c CanoScan LiDE 60 Not shared
8-2 2c7c:0600 Quectel EM120R-GL, Quectel QMUX Interconnect Not shared

Persisted:
GUID DEVICE
5e1e689d-7ca1-49ff-926d-eebd377bd1a7 USB Serial Device (COM11)
cb0cb49e-40d6-4d3b-9483-0c1f3c175fbf USB Serial Device (COM12), USB Mass Storage Device

- Bind and attach the busid of the scanner to the WSL engine.
usbipd bind --busid 6-3
usbipd attach --wsl --busid 6-3

The output should be somewhat like that:
usbipd: info: Using WSL distribution 'Ubuntu-26.04' to attach; the device will be available in all WSL 2 distributions.
usbipd: info: Detected networking mode 'nat'.
usbipd: info: Using IP address 172.23.64.1 to reach the host.

- Check the binding with usbipd list. The scanner should be in the state Attached now.

Connected:
BUSID VID:PID DEVICE STATE

1-4 04f2:b71c Integrated Camera, Integrated IR Camera Not shared
3-1 0bda:9210 USB Mass Storage Device Not shared
3-3 27c6:6594 Goodix MOC Fingerprint Not shared
3-4 8087:0029 Intel(R) Wireless Bluetooth(R) Not shared
4-1 17ef:3062 Lenovo USB Ethernet Not shared
6-2 17ef:3060 Billboard Device, USB Input Device Not shared
6-3 04a9:221c CanoScan LiDE 60 Attached
8-2 2c7c:0600 Quectel EM120R-GL, Quectel QMUX Interconnect Not shared

Persisted:
GUID DEVICE
5e1e689d-7ca1-49ff-926d-eebd377bd1a7 USB Serial Device (COM11)
cb0cb49e-40d6-4d3b-9483-0c1f3c175fbf USB Serial Device (COM12), USB Mass Storage Device

Scanning:
- Run the Docker container: docker run -d -p 8080:8080 --privileged sbs20/scanservjs
- Open http://localhost:8080/ in your browser and enjoy using your old scanner. No need to throw away fully working hardware.

Scanned handwriting: Scanned on a Canon Lide 60 on Windows 11 with scanservjs and Docker

How does this work?
The foundation is the SANE driver for Linux. Your scanner must be supported by SANE, otherwise this whole setup won't work.
usbipd is used to redirect your USB device through USB/IP to the WSL 2 engine. The USB redirect is not just for your default WSL distribution, it's also available to all Docker containers. You can verify this by executing e.g. lsusb from within a Docker container.

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 04a9:221c Canon, Inc. CanoScan LiDE 60
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Related Resources:
- https://www.geckoandfly.com/7569/canon-lide-scanner-and-printer-driver-for-microsoft-windows-7-64-bit/
- https://www.schraegstrichpunkt.de/canon-canoscan-lide-50-unter-windows-7-64-bit
- https://www.bachmann-lan.de/canon-lide-60-unter-windows-10/
- https://www.bentasker.co.uk/posts/blog/opinion/scanners-old-hardware-and-the-environment.html

submitted by /u/redderredred to r/selfhosted
[link] [comments]
❌