Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Samba] Procedure for installing Windows drivers on Samba with CUPS

1,222 views
Skip to first unread message

Adam Nielsen

unread,
May 12, 2013, 9:30:01 PM5/12/13
to
Hi all,

This isn't a plea for help, but rather I have just been through the
procedure for installing Windows drivers on a Samba machine using CUPS,
and I thought I'd post my notes in case it helps someone one day as the
documentation doesn't focus too strongly on my particular set up (it
focuses on using Windows drivers without CUPS, or PostScript drivers
with CUPS, but there's less about using Windows drivers with CUPS.)

So if you are using CUPS and Samba, and you want to use "point-n-print"
on your Windows machines with the manufacturer's drivers (in this case
Ricoh MFDs) here is the process, which has only been tested on Win 7
64-bit, and assumes you have already set up the print$ share and can
write to it from the Windows machine you will be using for this procedure.

1. Create a new CUPS print queue. IPP works best, but any protocol
will do (IPP causes usernames and job titles to appear on our machines'
front panels.)

2. Select the "Raw" manufacturer, with the "Raw Queue" model and
continue until the queue is ready.

3. "killall -HUP smbd" to make it see the new printer, possibly even
killing your own session ("smbstatus | grep username" then "kill" those
PIDs.)

4. Run \\server and on the menu below the normal menu (where it says
Organize, Search, etc.) choose the last option "View remote printers".
This view allows remote printers to be examined without trying to
install them.

5. If the printer is not visible, in the address bar type in
\\server\queuename and then cancel anything that comes up, and go back
and refresh the list of printers. The missing queue should now be
visible. It seems to take a while before it will show up reliably.

6. Right-click properties on the new printer, and when asked to
install the '' driver, it is *very* important to say no.

7. On the Advanced tab click New Driver, then follow the prompts. If
the New Driver button is greyed out, you need to give yourself more
permissions. Giving permission to an AD group doesn't seem to work, you
seem to have to grant your own (Windows) user print management
permissions with the 'net' command (on the Linux box.) This worked for me:

$ net -U server\\root rpc rights grant 'DOMAIN\username'
SePrintOperatorPrivilege

8. In the New Driver window, click Have Disk and find the driver you
want to install.

9. If you get an error about needing x64 drivers, edit the driver's .inf
file in the driver and replace all instances of "NT.5.1" (or higher)
with "NT.5.0". If this doesn't work, duplicating the 64-bit stuff and
putting it in a header for 32-bit works too (but this is only advisable
if you don't have any 32-bit Windows machines.)

10. Click OK to close the printer properties and don't worry if you get
a weird error.

11. Click properties again and you should see the full printer
properties with the new driver.

12. On the Sharing tab click "Additional Drivers" and install the x64
drivers (it seems to install only 32-bit ones.) If you are prompted for
where to install them from select the same driver again.

13. On the Advanced tab make sure you click Printing Defaults and change
something and apply the changes so the default settings aren't null (you
can change it back, but usually you have to change it to A4 or set
paper-to-tray assignments anyway.)

14. On the General tab make sure the queue name matches the CUPS queue
name. Some drivers change this from something like "my-queue" to "Bob's
Fantastic Printer Company PCL 6", but you won't be able to install the
printer on client machines if the names don't match.

15. You should be able to double-click on the printers from client
machines normally and have the driver install automatically now. If you
get prompted for admin access and you're connected to a domain, add your
Samba server in to the approppriate group policy so drivers can be
installed from it with no elevation required. Plenty of pages on Google
explaining this.

16. If you get an error installing the printer (something about being
unable to install the driver), wait for a few hours as this often helps.
Maybe restarting Samba would help too, but for us it was a production
machine so that wasn't possible.

I have successfully used this procedure to install four Ricoh MFDs and
their fax driver, so I hope this guide comes in handy for someone else
one day!

Cheers,
Adam.
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba

Tim Vangehugten

unread,
May 16, 2013, 9:30:02 AM5/16/13
to
Hi,

I have spend a lot of time searching for a solution to automatically
install printerdrivers over the network until I stumbled on this.
I followed your method with samba 4.0.5 in Ubuntu 12.04 and a windows 7
professional x64 client and everything worked. I had some problems at
finding ntprint at first but this tutorial:
http://techsugar.wordpress.com/2011/04/26/obtaining-ntprint-inf-file-when-installing-x86-printer-drivers-on-windows-server-2008-64-bit/has
helped me to obtain it. Now my drivers are automatically installed, if
only the printing in samba 4.0.5 would work that would be nice...

Best regards
Tim Vangehugten




2013/5/13 Adam Nielsen <adam.n...@uq.edu.au>
> instructions: https://lists.samba.org/**mailman/options/samba<https://lists.samba.org/mailman/options/samba>

steve

unread,
May 16, 2013, 10:50:02 AM5/16/13
to
On Thu, 2013-05-16 at 15:22 +0200, Tim Vangehugten wrote:
> if
> only the printing in samba 4.0.5 would work that would be nice...

Hi
The printing doesn't work in 4.0.5
https://bugzilla.samba.org/show_bug.cgi?id=9745

maybe you could add this thread/your use case to the bugzilla?
Cheers,
Steve

Gerry Reno

unread,
May 16, 2013, 12:30:02 PM5/16/13
to
On 05/16/2013 10:46 AM, steve wrote:
> On Thu, 2013-05-16 at 15:22 +0200, Tim Vangehugten wrote:
>> if
>> only the printing in samba 4.0.5 would work that would be nice...
> Hi
> The printing doesn't work in 4.0.5
> https://bugzilla.samba.org/show_bug.cgi?id=9745
>
> maybe you could add this thread/your use case to the bugzilla?
> Cheers,
> Steve
>

4.0.5 is useless without printing.

I've backed out of 4.0.5.


.

Tim Vangehugten

unread,
May 17, 2013, 9:10:02 AM5/17/13
to
@Gerry, which version are you using?
Does printing works in 4.0.4?


2013/5/16 Gerry Reno <gr...@verizon.net>

Tim Vangehugten

unread,
May 22, 2013, 7:50:02 AM5/22/13
to
Hi,

Just an update:

Tried today samba 4.0.6, printing works there with the automatic driver
install.

Best regards
Tim Vangehugten


2013/5/17 Tim Vangehugten <timvang...@gmail.com>

Gerry Reno

unread,
May 22, 2013, 12:20:02 PM5/22/13
to
On 05/22/2013 07:41 AM, Tim Vangehugten wrote:
> Hi,
>
> Just an update:
>
> Tried today samba 4.0.6, printing works there with the automatic driver install.
>
> Best regards
> Tim Vangehugten
>
>

I tried again after pulling 4.0.6 and it still does not install the cups drivers:

# PATH=/usr/local/samba/bin:$PATH cupsaddsmb -v -H localhost -U root -a
Password for root required to access localhost via SAMBA:
Running command: smbclient //localhost/print$ -N -A /tmp/cupsqd8nsE -c 'mkdir W32X86;put /tmp/cups8yiElz
W32X86/Cups-PDF.ppd;put /usr/share/cups/drivers/ps5ui.dll W32X86/ps5ui.dll;put /usr/share/cups/drivers/pscript.hlp
W32X86/pscript.hlp;put /usr/share/cups/drivers/pscript.ntf W32X86/pscript.ntf;put
/usr/share/cups/drivers/pscript5.dll W32X86/pscript5.dll'
Domain=[XXXXXXXXXX] OS=[Unix] Server=[Samba 4.0.6]
NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
NT_STATUS_ACCESS_DENIED opening remote file \W32X86/Cups-PDF.ppd
NT_STATUS_ACCESS_DENIED opening remote file \W32X86/ps5ui.dll
NT_STATUS_ACCESS_DENIED opening remote file \W32X86/pscript.hlp
NT_STATUS_ACCESS_DENIED opening remote file \W32X86/pscript.ntf
NT_STATUS_ACCESS_DENIED opening remote file \W32X86/pscript5.dll

Gerry Reno

unread,
May 22, 2013, 1:20:01 PM5/22/13
to

> I tried again after pulling 4.0.6 and it still does not install the cups drivers:
>
> # PATH=/usr/local/samba/bin:$PATH cupsaddsmb -v -H localhost -U root -a
> Password for root required to access localhost via SAMBA:
> Running command: smbclient //localhost/print$ -N -A /tmp/cupsqd8nsE -c 'mkdir W32X86;put /tmp/cups8yiElz
> W32X86/Cups-PDF.ppd;put /usr/share/cups/drivers/ps5ui.dll W32X86/ps5ui.dll;put /usr/share/cups/drivers/pscript.hlp
> W32X86/pscript.hlp;put /usr/share/cups/drivers/pscript.ntf W32X86/pscript.ntf;put
> /usr/share/cups/drivers/pscript5.dll W32X86/pscript5.dll'
> Domain=[XXXXXXXXXX] OS=[Unix] Server=[Samba 4.0.6]
> NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
> NT_STATUS_ACCESS_DENIED opening remote file \W32X86/Cups-PDF.ppd
> NT_STATUS_ACCESS_DENIED opening remote file \W32X86/ps5ui.dll
> NT_STATUS_ACCESS_DENIED opening remote file \W32X86/pscript.hlp
> NT_STATUS_ACCESS_DENIED opening remote file \W32X86/pscript.ntf
> NT_STATUS_ACCESS_DENIED opening remote file \W32X86/pscript5.dll
>

I opened a new bug on this issue because it may not be the same as the Win7 printing issue bug:

https://bugzilla.samba.org/show_bug.cgi?id=9901

steve

unread,
May 22, 2013, 5:40:03 PM5/22/13
to
On Wed, 2013-05-22 at 13:41 +0200, Tim Vangehugten wrote:
> Hi,
>
> Just an update:
>
> Tried today samba 4.0.6, printing works there with the automatic driver
> install.
>
> Best regards
> Tim Vangehugten

Hi
Are you sure? Its as you were here. No change. After the drivers are
seemingly copied correctly to the print$ share, windows gives up and
issues a 'Access is denied' error, as before.

The last time it worked following the instructions which are now on the
wiki was in 4.0.0

https://wiki.samba.org/index.php/Setup_a_printer_share
Are those instructions still valid?

Ricky Nance

unread,
May 22, 2013, 10:20:01 PM5/22/13
to
Those instructions should still work for XP, but its quite a bit different
for windows 7, I need to do a wiki page on it, and will when I get some
spare time, but not sure when that will be.

Ricky

steve

unread,
May 23, 2013, 2:30:01 AM5/23/13
to
On Wed, 2013-05-22 at 21:15 -0500, Ricky Nance wrote:
> Those instructions should still work for XP, but its quite a bit
> different for windows 7, I need to do a wiki page on it, and will when
> I get some spare time, but not sure when that will be.

Thanks Ricky
I just tried it with a xp client. The same error: Access is denied. Is
there anything trivial missing from those wiki notes which prevent
printing working with 4.0.6?
Steve

Tim Vangehugten

unread,
May 23, 2013, 4:30:01 AM5/23/13
to
@steve yes I am sure as I am able to print now in my test-network :)

These are the steps I have done on a freshly installed ubuntu 12.04 server:

1: Downloaded and extracted samba-4.0.6.tar.gz
2: Patched dns_crypto.c in /source4/dns_server/
with 0001-Fix-internal-DNS-dyn.-update-seen-as-TSIG-error-with.patch
3: Did provision with samba internal dns backend and downloaded an
initscript
4: Did a "krb5_newrealm SAMBA.MY.DOMAIN"
5: mkdir /var/spool/samba and /usr/local/samba/var/print
6: chmod 1777 /var/spool/samba and /usr/local/samba/var/print
7: added the following to my smb.conf in /usr/local/samba/etc/smb.conf:

[global]
...
printcap name = cups
printing = cups

[print$]
comment = Printer Drivers
path = /usr/local/samba/var/print
read only = no

[printers]
comment = All Printers
browseable = yes
printable = yes
read only = no
path = /var/spool/samba

8: installed and configured cups
9: started samba
10: added the windows drivers to the samba share like Adam Nielsen said
11: I could print


That's about it for printing, the patch I did was for my samba4-failover
server if you don't patch it it errors on dns updates...
Hope this helps.

Best regards
Tim Vangehugten


2013/5/23 steve <st...@steve-ss.com>
0 new messages