Hacker News new | past | comments | ask | show | jobs | submit

Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

https://printervention.app/details
I did this with a Raspberry Pi. The printer in question only has WiFi and USB, no ethernet (the WiFi wasn't stable, and I don't trust the TCP/IP stack anyway). So what I did was I connected it to a Raspberry Pi via USB which is connected via ethernet to the living room. I added AirPrint and brscan, and the device can be shared via usbip.

For example, you can use a USB SDR and connect to it via usbip.

Initially, I also had to actually use qemu x86-64 for the scanner part which wasn't ideal.

The only UI computers which use it, are Apple's (iPhone and iPad). In a world where the network is the computer, usbip and iscsi are very cool tech.

The reason I went with a Raspberry Pi is since it already acts as an interface for Valetudo. So it was already in use anyway. Also, I want to add Bluetooth for IoT scanning, considering to run Home Assistant on it.

But yes, what it does lack is a UI. I was thinking of adding something with a reverse proxy, but I have no idea what, and this whole project isn't residing in my house. It is in my mother's apartment.

I've been using a pi print server for a few years now. Runs my shipping label printer, an excellent HP color printer from the early 2000s, and a few other oddball printers
If you are using an LLM, wouldn't it have been a lot easier to just have the LLM find the relevant CUPS driver decompile or just capture the USB traffic, and rewrite it in Go or something native? (No need to deal with the system printing framework, the goal was just an app that accepts JPEG input.)
Interesting suggestion: I guess that would have been possible. On the other hand I think this is a more general solution, and it does minimal reinventing-the-wheel.
That's definitely possible for simpler drivers (CUPS filters) which accept CUPS-raster data for input. That's a majority of drivers for old printers.
Or ask the agent to write a Dockerfile (to abstract the build environment) that builds CUPS and all your stuff around it directl in WASM, instead of targeting x86 and then emulating x86 with WASM.
Is there a Docker-to-WASM pipeline, and how does it do anything differently from emulating x86?
>Perhaps I could set them up a Raspberry Pi as a print server? But that would make it not so cheap. And anyway, I’m not convinced they’d go for the extra plugs and wires.

$35 and it's yours, with tech support and CUPS/SANE development funding included, and all open source: https://printserver.ink

Extra plugs could be eliminated with the help of "IEC320 3 pin C14 TO Male C13+2" cable: https://ae-pic-a1.aliexpress-media.com/kf/S4c8681fb1283499b8...

loading story #47683394
loading story #47686563
I'm using an ancient Canon Selphy photo printer... on Windows 11 without any issues. Using the Windows 7 64-bit driver, worked basically out-of-the-box. It's definitely not officially supported, but to date it works totally fine.
Huh, interesting. Is the driver built in to Windows, downloaded from Canon, or acquired some other way?

TBH the web app story on Windows isn’t ideal anyway because you have to install Zadig before it will work.

loading story #47681716
Okay, this is reasonably genius. I have quite a few USB devices lying around that are either old enough or were niche enough that they don't work on modern _anything_, even Linux. One of them is a GameBoy Advance flash cartridge.
Oh, there's a thought - v86 supports lots of old DOS/Windows versions too, so assuming you could get the right port through (probably easy with anything USB, maybe possible with other things?) you could probably use your choice of old drivers:)
One thing I appreciate here is that it treats old hardware as worth saving, not as a nuisance to route around. There’s a lot of hidden value in software that extends the life of perfectly functional devices, especially when the alternative is replacing them for reasons that are mostly ecosystem drift. This is the good kind of absurd.
> I must apologise that I haven’t so far open-sourced any part of this that I don’t have to. Mainly that’s because I think this would be an awesomely sticky web property for a printer consumables firm to integrate with their sales site. And I’d much prefer it if they paid me to white-label it for them, rather than just forking a repo and getting it all for free.

They might be interested if they cared at all about the ease of use of their printers

loading story #47681814
loading story #47681294
loading story #47680679
I know that it is a heavyweight solution, but it could be useful for some situations with old driver/devices/applications. I have some old hardware that is compatible only with pre-WinNT OS, and I could do something similar to provide a simple solution for the end user.
loading story #47681705
Thank you, loved this and it made me "duh!".

I have an old-ish Samsung laser printer that works perfectly and a Linux file server at home and the printer no longer supports AirPrint.

I never thought about using the Linux box as an AirPrint server! This will free me from all the odd print requests from my kids! (probably)

Been doing something similar with a Samsung printer and CUPS for years, it’s great

Found this helpful for generating some of the config files: https://github.com/tjfontaine/airprint-generate

It’ll work great if you can get the drivers all aligned properly. I’ve tried a few times to get my 12 year old Brother laser setup like that, and each time I end up throwing in the towel.

Maybe I’ll try it again someday with an LLM assisting.

I have a Samsung ML-1740 kicking around still that I just can't bear to part with; I've been meaning forever to RasPi-ify it, but it's one of those projects that feels like it's going to end up being a rabbit hole.
loading story #47682880
loading story #47681315
So. Does this methodology mean someone can surreptitiously boot up a Linux VM running Wireguard in your browser and be inside your firewall via chrome.sockets API?
You don’t need a VM. Do what Netbird does. Compile wireguard-go to WASM and you’re g2g

https://docs.netbird.io/about-netbird/browser-client-archite...

No? It's still a web page. And the chrome socket API was deprecated and removed for everyone except ChromeOS users in certain cases. The closest you can get is installing a Chrome extension that exposes sockets, but if someone is able to do that, they don't need the browser for help.

Moreover, you don't even need Linux and Wireguard. WebRTC accomplishes p2p encrypted traffic without libraries.

I have an old Epson MX80 dot-matrix printer in the closet, have thought about getting a Raspberry Pi and setting that up so we can wirelessly print to it. But... who would really want that?
For a printer like an Epson MX80 an esp32 should be enough to share the printer on a raw TCP interface (AppSocket I think the protocol is named) on port 9100. It is supported by Windows and CUPS.

Very easy implementation as it essentially it just forwards the data to the printer. Since it's a raw interface you need the proper driver, but luckily Epson provides a Windows 10 driver for the Epson MX-80 (!) [1] CUPS doesn't have driver for the MX-80 but it has a number of generic Epson drivers and my guess is that one of those will work.

The most difficult part is probably the parallel interface (unless you have a printer with a serial interface in which case it will be much easier)

[1] https://epson.com/Support/Printers/Impact-Printers/MX-Series...

Doesn't Apple outright uses CUPS in the first place ? Did they just removed old drivers in their version ?
You might think that such an important and long-standing feature as printing would undoubtedly be backed up by a large company. This was true until 2019, when it was backed by Apple. Currently, however, CUPS and all related projects are supported by volunteers, including myself.

Apple abandoned CUPS years ago, and recently have archived the repo on github: https://github.com/apple/cups

All the current development runs in OpenPrinting github: https://github.com/OpenPrinting, and mostly focused on newer projects, such as CUPS v3, PAPPL, Printer Applications.

Recent versions of CUPS v2 are still used in Chrome OS and Chromebooks though (apart from all Linuxes).

I'd be curious if cups works on wsl as well...
loading story #47682990
This is pretty cool! Thanks for sharing.
I would have asked Claude to write a driver. But this works, too. :)
Isn't cups a de facto apple project? What's the VM getting you?
The gutenprint drivers to support the specific printer don't support darwin
loading story #47679897
Too bad Apple is still preventing the WebUSB spec from being standardized. They won't even make suggestions to get it through committee because WebUSB might cut into their native app store.
loading story #47680209
loading story #47680719
what the heck we're not in web 1.0 anymore are we
Oh neat. v86 is mentioned in the FOSDEM 2025 slides [0] for another wasm port of QEMU. Interesting that what appears to be v86's inability to run x86 executables didn't fuck you.

I wonder why the decision wasn't made to use the network sharing features of SANE and CUPS, instead of requiring one to use Chrome due to the WebUSB dependency. Seems to me that you'd have a way more general solution if you could usefully deploy your VM both in any major web browser and as a standalone program.

[0] <https://archive.fosdem.org/2025/events/attachments/fosdem-20...>

loading story #47681690
surely a glorious OS like osx would not be without support for hardware that linux supports? when will it be year of osx desktop?
loading story #47679412
loading story #47685409