Howto: Canon LBP 5100 with Samba (amd64)

I bought the relatively inexpensive Canon LBP5100 colour laser printer for my XP machine at home. I thought I would crack network printing from Linux soon.

The method here should work for just about any printer

After a long chase for information about CAPT and amd64 and multiple failed installations (with compiling from "source") of the CAPT 1.80 driver from Canon I understood that actually colour printing from 64-bit linux would be next to impossible with this printer.

I almost got everything working but the error: pstocapt3 write errors 9 and 32 got me every time. I could not understand whether this was - likely printing to a local spool file, or was it writing to Canon printer over Samba that failed. Might be the latter, since the printer stopped responding to normal jobs from windows an I had to re-install windows driver.

Almost accidentally I came accross this excellent HOWTO_Canon_LBP_2900_with_Samba page on Gentoo wiki. It explains everything in very good detail, therefore I will put only a summary of necessary actions here.

What to do to get your Canon CAPT printer working from Linux over Samba

Test you can print with Ghostview (open an example file in your Ghostscript installation directory).

Set up Ghostprint config file. (gsprint.cfg in same directory as gsprint.exe, which in turn in your Ghostview installation directory)

Install a standard postscript driver on your Windows machine. This should be of a printer that has readily available drivers both on Windows and Linux. The author chose Apple Laser Writer II (which is a BW printer); I chose HP Color Laser Jet 8500 PS. When installing choose "Print to File" port. Test if you can print anyhing on it - the system should ask you for a file name and produce > 0 lenght output.

Install redmon. That is download, unzip in your directory of choice, then run setup.exe.

then for URI you will enter smb://username:password@workgroup/machine/yourNewPSprinterShare . I created a new non-admin user on Windows specifically for not leaving my XP admin account password in CUPS config files. Might also work w/o password at all.

Select make and model that you set for your Windows PS printer. If not readily available you can download a lot of *.ppd files + get recommendations on how they work from Linuxprinting.

That should be it. Select your new printer in CUPS and print a test page.

smile, if appropriate :)

A few notes:* if there is some cutting/cropping of edges at times - remember that you cannot set page size/shrinking etc via command line options in ghostprint. That is done in the actual printer driver - so you can experiment with the new PS driver or rather the Canon driver - on windows.
* At some point I also installed Print services for Unix via Windows setup, but I did it when I was desperately trying to make CAPPT drivers work. I don't think that has any relevance.
* if you fail to find redmon download, do search for "redmon17.zip" - Google should give you quite a few working mirrors.
* Not all your linux programs will print correctly. e.g. Inkscape did not print SVG file. You enable can log & debug under the virtual PS printer if you edit (configure) the redirected port.
**** There you can set logfile; you can also set debug - if needed. And there you also can set the DOS window to be hidden.

BTW - if you do this setup then also automatic Postscript file printing works from a shared directory with Peter Lerup's freeware windows program PrintFile. I think it was discontinued in about 2007, but copies are still available if you look carefully (PrFile32.exe). It is a very small program which can either print files through a dialog box or work as a spooler - i.e. watch a directory and if a .txt text or .ps postscript file is copied into this spool directory, the program then sends it to the printer _and_ deletes the file from spool directory immediately.

The catch is - you have to have a postscript printer (which LBP5100 is not). But when you have a virtual postscript printer which is redirected via redmon - works like a charm, just ask PrintFile to print to the virtual Ps printer.

This program also has fairly advanced features as well; nicely done, so thanks a lot to Peter Lerup!

Has anyone got any idea whether this could somehow be done using Wine to run the Windows printer driver? Presumably, you'd just have to get the printer driver and Ghostscript/gsprint working. Then configure the Linux print spooler to run gsprint (under Wine). So no need for redmon, samba and printer sharing.

It might be a bit difficult. Wine seems to rely on working UNIX printing to actually print things. So says the manual and User Guide. Another idea might, of course, be having a virtual windows solution such as VMWare or XEN, where Canon printer would be connected to the hosted system via USB. Some have difficulties with that, some seem to have cracked it.

You'd only need a raw print queue for Wine which is easy to setup. Getting a device in /dev for talking to a printer isn't generally a problem. The problematic bit is converting PostScript to whatever binary format non-PostScript printers expect. I thought about using a virtual machine but it uses more resources and would involve getting a copy of Windows.

I found the new drivers only in Australian site of Canon. It works fine for me (32 bit Debian Lenny and printer Canon LBP 5000). If you meet any problems to find the driver, please reply here and I will upload it somewhere.

I guess you know the installation procedure (32-bit), but it is also included in the downloaded file.

I am now quite used to print through windows box, because it is quieter - therefore is the one that remains on all the time. However it would be very useful to install the driver to be able to print directly to the printer share.

I am afraid that this share issue may confuse me a little in the process and in addition I have a 64-bit system. But I will give it a go some time this week. If you have any tips with regard how to compile/install the driver on 64 bits, please let me know.

HI all, First I would like to thanks all for this nice article. My problem is little bit different,I am connection canon LBP-3300 with linux system with CUPS and canon linux driver and shared with linux-samba-print server.

Now we have some windows system too and wants to get print from windows to linux connected canon CAPT printer.

Do you think I could install the proper CAPT driver and print through that to my windows box via SAMBA? The reason being that my windows xp box is quieter and therefore on more often, even though I do my main work on Linux.

A little bit of trubleshooting is needed if you have a selinux distro like I do, but basically setting selinux to permissive, saving the avc error messages related to cupsd and creating new policy file with audit2allow -R works very well. Then set selinux back to enforcing mode.