Thursday, October 27, 2011

CUPS Samba 64bit automatic driver download

The same ease of using Samba hosting for automatic download of the CUPS/Windows Postscript drivers for 32 bit clients can be implemented for 64 bit clients as well.


Brief overview of stuff you already need to know how to do:
  1. Your printer needs to be added to CUPS
    • generally consists of placing proper PPD files - many available at http://cups.org/ppd.php - in /usr/share/cups/model/ and following the CUPS documentation.
  2. Set Samba up properly for CUPS

OK, let's dive in and do it.

We need the drivers. Some from CUPS, some from your Windows system.
The 32 bit CUPS drivers are available from: http://svn.easysw.com/public/windows/trunk/i386/
The 64 bit CUPS drivers are available from: http://svn.easysw.com/public/windows/trunk/x64/

EDIT: the above links to the CUPS drivers are now dead. A sad day for Linux printing when Apple bought EasySW.
The Windows drivers are on the client systems. We need these files:
  • ps5ui.dll
  • pscript.hlp
  • pscript.ntf
  • pscript5.dll
Extract the 32 bit ones from  (a 32 bit system):
  • \Windows\System32\spool\drivers\W32X86\PCC\ntprint.inf_<random-stuff>.cab
Extract the 64 bit ones from (a 64 bit system):
  • \Windows\System32\spool\drivers\x64\PCC\ntprint.inf_<random-stuff>.cab
Prepare the drivers that we have downloaded.
Prepare/populate the directories.
  • The 32 bit drivers that we have obtained and prepared need to be copied to:
    • /usr/share/cups/drivers/
  • The 64 bit drivers that we have obtained and prepared need to be copied to:
    • /usr/share/cups/drivers/x64/
  • Due to cupsaddsmb quirk (lower case "x"), check and "fix", if necessary, the Samba x64 directory:
    • ls /var/lib/samba/printers/
      • if your distro/installation created an X64 (upper case) instead of an x64 directory symlink to it:
        • cd /var/lib/samba/printers
        • ln -s X64 x64
Add the printer drivers to Samba.

Now we use cupsaddsmb, which handles all the rpcclient calls, to add the printers to our Samba installation. Simplest is:
  • cupsaddsmb -v -a
Read "man cupsaddsmb" for more options.

7 comments:

  1. I've tried about 4/5 different tutorials with no luck on driver sharing to Windows 7 64-bit from Samba on Ubuntu Server.

    This one looks the most hopeful, but how do you "patch" the cups6.inf file with the patch file?

    ReplyDelete
  2. man patch

    plenty of examples on the net

    or hand edit per Microsoft guidelines (view the patchfile to see what is changed)

    ReplyDelete
  3. Tried multiple walkthroughs, this is the one that worked for me. I was unable to get the file to patch, not sure why, but I had to patch it manually. Also, I was getting WERR_ACCESS_DENIED errors when running cupsaddsmb -v -a, this page helped me pull it off http://threebit.net/mail-archive/samba/msg11095.html

    ReplyDelete
  4. what about for windows 8 ?
    I can download the driver for win XP, vista and 7 , but not luck with win 8,
    Does smb push driver for win 8 ?

    ReplyDelete
  5. This works fine for Windows 8 except you may need the registry edit found in another post here. However, AFAIK, the CUPS drivers are no longer available from the Easy Software site, and so although this method works fine you may want to consider it deprecated at this point.

    ReplyDelete
    Replies
    1. I have spend too much time on looking for the required sources, tools and compiling to keep the final CUPS Postscript drivers for my own. So here they are :-)

      http://eriegel.de/cups/cups-PS-Driver_x64.zip
      http://eriegel.de/cups/cups-PS-Driver_x86.zip

      Delete
    2. THANK YOU, Eugen

      Delete

Note: Only a member of this blog may post a comment.