This site is now 100% read-only, and retired.

Howto: Canon LBP 5100 with Samba (amd64)

Posted by r0bis on Tue 8 Sep 2009 at 13:32

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

  1. Install your Canon driver for windows on the corresponding computer.
  2. Install Ghostscript on your Windows computer.
  3. Install Ghostview on your Windows computer.
  4. Test you can print with Ghostview (open an example file in your Ghostscript installation directory).
  5. Set up Ghostprint config file. (gsprint.cfg in same directory as gsprint.exe, which in turn in your Ghostview installation directory)
  6. 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.
  7. Install redmon. That is download, unzip in your directory of choice, then run setup.exe.
  8. Create a redirected port for your PS printer driver. Properties | Add Port | Redirected port. Name port as you wish:
  9. Configure the redirected port.
    • Redirect to program: enter / browse path to your GSPRINT.EXE
    • Arguments for program: - a single dash, with no spaces at all. Alternatively you could use your options to ghostprint here.
    • Output: Program handles output
    • Run as user: [ ] (unchecked)
  10. Test if you can print anything on the PS printer. There may be cmd window blink. You should now get output in your Canon printer tray.
  11. If success - share the printer. The hardest part is over.
  12. I presume you have SAMBA set up in such a way that you can browse/use files from your Linux box on the Windows box.
  13. in your browser open http://localhost:631 - this is CUPS administration interface.
  14. Choose Add printer under Management. Enter names / dscriptions as you like. For printer device select "Windows Printer via Samba".
  15. 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.
  16. 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.
  17. That should be it. Select your new printer in CUPS and print a test page.
  18. 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 "" - 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.

Your Canon printer is less of paperweight now :)

Your comments and improvements are very welcome



Re: Howto: Canon LBP 5100 with Samba (amd64)
Posted by Anonymous (213.228.xx.xx) on Tue 8 Sep 2009 at 14:50
Nice idea
That way almost any printer can be used ....

[ Parent ]

Re: Howto: Canon LBP 5100 with Samba (amd64)
Posted by r0bis (86.154.xx.xx) on Tue 8 Sep 2009 at 20:30
I think you are right. Boy, was I glad when this started working :))

[ Parent ]

Re: Howto: Canon LBP 5100 with Samba (amd64)
Posted by r0bis (86.154.xx.xx) on Tue 8 Sep 2009 at 20:45
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!

[ Parent ]

Re: Howto: Canon LBP 5100 with Samba (amd64)
Posted by Anonymous (192.171.xx.xx) on Wed 9 Sep 2009 at 09:05
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.

[ Parent ]

Re: Howto: Canon LBP 5100 with Samba (amd64)
Posted by r0bis (86.154.xx.xx) on Wed 9 Sep 2009 at 09:37
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.

[ Parent ]

Re: Howto: Canon LBP 5100 with Samba (amd64)
Posted by Anonymous (192.171.xx.xx) on Thu 10 Sep 2009 at 08:54
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.

[ Parent ]

Re: Howto: Canon LBP 5100 with Samba (amd64)
Posted by Anonymous (79.166.xx.xx) on Sun 15 Nov 2009 at 19:54
Hi r0bis, very nice way. I think it is very useful as a procedure.

If you still want to use your printer without MS Windows, download the NEW drivers from here:

*) LBP 5000: " N&category=Printers&series=Laser%20Beam%20Printers%20(Col our)&model=LASER%20SHOT%20LBP5000&menu=Download";.

*) LBP 5100: " N&category=Printers&series=Laser%20Beam%20Printers%20(Col our)&model=LASER%20SHOT%20LBP5100&menu=Download";

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.


[ Parent ]

Re: Howto: Canon LBP 5100 with Samba (amd64)
Posted by r0bis (86.163.xx.xx) on Sun 29 Nov 2009 at 15:33
Thank you Adrianos for your kind comments.

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.



[ Parent ]

Re: Howto: Canon LBP 5100 with Samba (amd64)
Posted by Anonymous (122.167.xx.xx) on Thu 4 Feb 2010 at 09:36
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.

is there any way to do this?

thank you.

[ Parent ]

Re: Howto: Canon LBP 5100 with Samba (amd64)
Posted by Anonymous (86.158.xx.xx) on Sun 28 Mar 2010 at 09:43
Yes, that should not be too difficult. You should be able to install Windows Canon driver on your windows machine and print to the network shared linux printer through that driver.

[ Parent ]

Re: Howto: Canon LBP 5100 with Samba (amd64)
Posted by r0bis (86.158.xx.xx) on Sun 28 Mar 2010 at 10:39
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.

[ Parent ]

Even better way to print
Posted by r0bis (86.157.xx.xx) on Wed 22 Sep 2010 at 23:18
I have noe found an even better way to print from linux to windows printer. Admittedly - this is a bit cumberome, needs python 2.x installed on windows, but overall this works very well.

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.

[ Parent ]

Re: Howto: Canon LBP 5100 with Samba (amd64)
Posted by Slade (76.25.xx.xx) on Thu 19 May 2011 at 21:07
This is just the sort of Canon info I was looking for, thx. Web Conferencing

[ Parent ]