Reviving old scanners with an in-browser Linux VM bridged to WebUSB over USB/IP

Hacker News Top Tools

Summary

Describes yes-we-scan.app, a web app that uses an in-browser Linux VM (v86) and WebUSB to allow users to revive old USB scanners without native drivers, by running SANE in the browser.

No content available
Original Article
View Cached Full Text

Cached at: 05/21/26, 06:25 AM

# Yes We Scan: backstory and how it works Source: [https://yes-we-scan.app/details](https://yes-we-scan.app/details) [<< Home](https://yes-we-scan.app/) **Do you have an old USB scanner that your computer can’t talk to? If so, this is the web app for you\. And this is how it came about\.**But first, here’s a short demo of[yes\-we\-scan\.app](https://yes-we-scan.app/)in action \(at 3x actual speed\): ## It starts with a printervention I started out wanting to make an old Canon photo printer usable by my parents and in\-laws\. So I made[printervention\.app](https://printervention.app/), which I[wrote about before](https://printervention.app/details)\. While working on that app, I remembered I also had an old Canon USB scanner tucked away on a shelf\. The last time I’d used that, I think I’d resorted to setting up a Windows 95 VM\. But the same technology that powers printervention\.app would clearly work for scanners too\. ## How does it work? The core of both apps is the amazing[v86](https://github.com/copy/v86), which emulates an x86 CPU — and the whole machine around it — in a browser\. It compiles machine code to WebAssembly modules at runtime, which is rather clever and makes the whole thing tolerably quick\. So I set up an emulated v86 machine to run[SANE](http://www.sane-project.org/)\(Scanner Access Now Easy\) on Alpine Linux, discreetly, in your browser\. The interface between your browser and SANE is provided by a small custom C program that Claude helped write\. This connects to the scanner, provides a JSON dump of its settings we can use to build a settings UI, and streams scan data over the hypervisor console \(hvc0\) in v86\. Back in the browser, that scan data is received and either written to a <canvas\> context \(when previewing\), or sent to a Web Worker running[wasm\-mozjpeg](https://github.com/3bl3gamer/wasm-mozjpeg)or[fflate](https://github.com/101arrowz/fflate), compressing it to JPEG or PNG on\-the\-fly\. ## Bridging v86 and WebUSB I’d already got the USB side of things working for printervention\.app: - [USB/IP](https://usbip.sourceforge.net/)runs on the Linux machine\. It packages up outgoing USB data into TCP packets, and unwraps USB data out of incoming TCP packets\. As far as SANE can tell, it’s just connected to an ordinary USB scanner over ordinary USB\. - [tcpip\.js](https://github.com/chipmk/tcpip.js/)runs on the JavaScript side, mainly by compiling[lwIP](https://github.com/lwip-tcpip/lwip)to WebAssembly\. The v86 machine has an emulated network card, but what emerges from that into the JavaScript environment is raw Ethernet frames\. Since the browser exposes no network stack to turn this L2 Ethernet traffic back into L4 TCP/IP traffic, this is the job tcpip\.js takes on\. - Lastly, the reconstituted USB/IP packets are bridged to your computer’s USB via the browser’s WebUSB API, thanks to a JavaScript module for which I must again credit Claude\. ## What’s next The app has only been tested on my CanoScan LiDE 100, but it should work for hundreds of other models \(including scanners from Agfa, Canon, Epson, HP, Lexmark, Microtek, Mustek, Ricoh, Samsung, Trust, Xerox and more\)\. If you try it, do let me know how you get on\. I must repeat[my apology](https://printervention.app/details#whatsnext%22)that I haven’t so far open\-sourced any part of the code that I don’t have to\. [George MacKerron](https://mackerron.com/) May 2026 [<< Home](https://yes-we-scan.app/)

Similar Articles

WebUSB extension for Firefox

Lobsters Hottest

A Firefox extension that adds WebUSB functionality through native messaging, enabling web applications to access USB devices in Firefox similar to Chrome's implementation.

Plexus P/20 Emulator

Hacker News Top

A new open-source WebAssembly-based emulator for the 1980s Plexus P/20 Unix server, letting users run SystemV Unix in the browser.

Smashed Toilet Phone Web Server

Hacker News Top

The author revives a smashed, water-damaged Samsung A70 and turns it into a functional web server using a USB-C hub for power and Ethernet connectivity, demonstrating how old phones can be repurposed.