[Tutorial] Proper CUPS printing with Chrome OS - Adding a printer via Crostini CUPS-Sharing with any PPD / Driver (e.g. Samsung Unified Linux Drivers)

If you're like me and can't stand the limited quality of Google Cloud Printing you're currently out of luck - theoretically Chrome OS actually provides a way to add a CUPS Printer but it's bugged and you cannot really add any custom PPD file - it seems like you require a special PPD file that works with Chrome OS (close to non-existant I guess).

But fear not - There is a way around that - it involves installing CUPS in Crostini and enabling sharing the installed printer with the host.

  1. Open up the Crostini Terminal
  2. sudo apt-get install cups
  3. sudo apt-get install system-config-printer
  4. Get your drivers and extract or install them (e.g. Samsung Unified Linux Drivers)
  5. xhost +
  6. sudo system-config-printer
  7. add your printer via the GUI (f.e. if you've installed the Samsung Unified Linux Drivers you don't have to do much, otherwise you might have to load your own ppd here that you aquired from the net).
  8. sudo cupsctl --remote-admin --remote-any --share-printers
  9. sudo systemctl restart cups

The last two commands will make CUPS available to the host ...

you should now be able to browse to:

http://penguin.linux.test:631/

Now that enables us also to use the configured printers as generic shared printer in Chrome OS

  1. Go to Settings -> Advanced -> Printing
  2. Select Printers
  3. Add or Manage CUPS Printer
  4. Choose a name
  5. Address: penguin.linux.test
  6. Protocol: Internet Printing Protocol (HTTP)
  7. Path (not sure how it's named in english): printers/nameOfYourPrinter
  8. As Driver choose Generic -> Generic PostScript Printer (or other Generic you might have to experiment with this).

Afterwards - print a test page. It should be working now.

If everything went trough you should be able to print from Chrome OS in 1200 DPI (or whatever your printer and driver actually supports), in the correct format - instead of the medicore 300 DPI with a weird format trough the cloud.

The only limitation there is that you of course need to have started Crostini ... but I guess most of us already have an instance running anyway.

Sorry for any spelling mistakes - it's really late here and I have to get to work tomorrow ... I just had to print some sheets and was pi**ed with the quality. Now I can sleep happily.

Cheers!


Bonus:

If you want to administrate your printer via the CUPS webinterface (e.g. to cancel jobs) you need to make sure your user is part of the correct group:

sudo useradd printeradmin
sudo usermod -aG lpadmin printeradmin
sudo passwd printeradmin

Then login via printeradmin and your password.


Edit:

In case you encounter errors check:

/var/log/cups/error_log


Edit 2 - important notice - Ghostscript 9.26 (currently installed by default from the standard repos) breaks PDF conversion so you'll get printer errors with some PDFs - you'll have to downgrade it, see here:

https://github.com/spatie/laravel-medialibrary/issues/1323

Edit 3 - downgrading to 9.20 did it for me ...

first 1. sudo nano /etc/apt/sources.list.d/snapshot.list

#added for ghostscript-9.20
deb http://snapshot.debian.org/archive/debian/20180830T090254Z/ stretch main

then 2. sudo nano /etc/apt/preferences.d/ghostscript

 Package: ghostscript
 Pin: version 9.20~dfsg-3.2+deb9u2
 Pin-Priority: 700
 
 Package: ghostscript-dbg
 Pin: version 9.20~dfsg-3.2+deb9u2
 Pin-Priority: 700
 
 Package: ghostscript-doc
 Pin: version 9.20~dfsg-3.2+deb9u2
 Pin-Priority: 700
 
 Package: ghostscript-x
 Pin: version 9.20~dfsg-3.2+deb9u2
 Pin-Priority: 700
 
 Package: libgs-dev
 Pin: version 9.20~dfsg-3.2+deb9u2
 Pin-Priority: 700

 Package: libgs9
 Pin: version 9.20~dfsg-3.2+deb9u2
 Pin-Priority: 700
 
 Package: libgs9-common
 Pin: version 9.20~dfsg-3.2+deb9u2
 Pin-Priority: 700

afterwards:

  1. sudo apt-get install libgs9-common=9.20~dfsg-3.2+deb9u2
  2. select yes - uninstall cups & cups-filter (needed, don't fear it).
  3. sudo apt-get install libgs9=9.20~dfsg-3.2+deb9u2
  4. sudo apt-get install ghostscript=9.20~dfsg-3.2+deb9u2
  5. sudo apt-get install cups
  6. sudo apt-get install cups-filter

Edit: Stupid Markdown formating ...

Posted Feb 21, 2019, 2:19 AM UTC · edited

126
Loading comments…