# Why can't samba provide printer drivers to windows machines?

## Xamindar

I used to have this printer attached to a win2000 machine because it would automatically provide the driver when any other windows machine tries to connect to the printer. I finally decided to move it over to a cups/samba server instead because I found some old posts about samba supporting sending windows drivers to the windows machines. Printer now works fine on the new machine and my linux computers can print to it. Samba doesn't apparently support this very well at all or they at least make it almost impossible to set up. 

Has anyone been able to get this working at all? Or am I better off just giving up and keeping the drivers on a usb stick?

According to what I have read you need a special section in smb.conf. I think I have that here:

```

[print$]

        path = /var/lib/samba/printers

        write list = @adm, root

        guest ok = Yes

```

That is supposed to be where the drivers are. It seems to have the same directory structure as the spools directory on any windows box so I copied my printer drivers into it to match my windows machines. No go. 

I then found something about using some script called "cupsaddsmb" in some old threads dated from 2005 to 2008. It even had me emerge some package called "cups-windows" and install some generic postscript drivers. That script seemed to do just what it was supposed to do - it moved the drivers over to the samba drivers directory and a few other things. Still no go. Windows keeps telling me it doesn't know the correct driver for the printer. This is beyond frustrating and I'm about to just give up. Does the samba team not care about features like this?

----------

## keyson

Hi,

It work on my computer. I have a wireless network, and it was problems when anyone want to print

from the laptop. So I set it up and use my machine as print server.

Check out this:

http://www.gentoo.org/doc/en/quick-samba-howto.xml

I used it, and now when they want to print, for the first time, they get a warning that it need to download drivers

for the printer is added. It is only to push OK and it load the drivers and add it.

I have a HP printer.

The drivers is in /etc/samba/printer/W32X86/ on my computer after running the script.

----------

## Xamindar

I did follow that howto and did it again to make sure.

```
media-server drivers # cupsaddsmb -H media-server -U root -h media-server -v -a

Password for root required to access media-server via SAMBA:

Running command: smbclient //media-server/print$ -N -A /tmp/4b6df2ebaee6d -c 'mkdir W32X86;put /tmp/4b6df2e8345ea W32X86/Deskjet_D1300.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'

params.c:Parameter() - Ignoring badly formed line in configuration file: ¸)

Domain=[RADNIMAX] OS=[Unix] Server=[Samba 3.4.5]

NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86

putting file /tmp/4b6df2e8345ea as \W32X86/Deskjet_D1300.ppd (4400.0 kb/s) (average 4400.1 kb/s)

putting file /usr/share/cups/drivers/ps5ui.dll as \W32X86/ps5ui.dll (37447.2 kb/s) (average 31700.0 kb/s)

putting file /usr/share/cups/drivers/pscript.hlp as \W32X86/pscript.hlp (6356.8 kb/s) (average 27945.5 kb/s)

putting file /usr/share/cups/drivers/pscript.ntf as \W32X86/pscript.ntf (39834.1 kb/s) (average 33777.7 kb/s)

putting file /usr/share/cups/drivers/pscript5.dll as \W32X86/pscript5.dll (26524.9 kb/s) (average 31790.7 kb/s)

Running command: smbclient //media-server/print$ -N -A /tmp/4b6df2ebaee6d -c 'put /usr/share/cups/drivers/cups6.ini W32X86/cups6.ini;put /usr/share/cups/drivers/cupsps6.dll W32X86/cupsps6.dll;put /usr/share/cups/drivers/cupsui6.dll W32X86/cupsui6.dll'

params.c:Parameter() - Ignoring badly formed line in configuration file: ¸)

Domain=[RADNIMAX] OS=[Unix] Server=[Samba 3.4.5]

putting file /usr/share/cups/drivers/cups6.ini as \W32X86/cups6.ini (17.6 kb/s) (average 17.6 kb/s)

putting file /usr/share/cups/drivers/cupsps6.dll as \W32X86/cupsps6.dll (1753.3 kb/s) (average 1122.2 kb/s)

putting file /usr/share/cups/drivers/cupsui6.dll as \W32X86/cupsui6.dll (4450.4 kb/s) (average 1835.4 kb/s)

Running command: rpcclient media-server -N -A /tmp/4b6df2ebaee6d -c 'adddriver "Windows NT x86" "Deskjet_D1300:pscript5.dll:Deskjet_D1300.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:pscript5.dll,Deskjet_D1300.ppd,ps5ui.dll,pscript.hlp,pscript.ntf,cups6.ini,cupsps6.dll,cupsui6.dll"'

params.c:Parameter() - Ignoring badly formed line in configuration file: ¸)

Printer Driver Deskjet_D1300 successfully installed.

Running command: rpcclient media-server -N -A /tmp/4b6df2ebaee6d -c 'setdriver Deskjet_D1300 Deskjet_D1300'

params.c:Parameter() - Ignoring badly formed line in configuration file: ¸)

Successfully set Deskjet_D1300 to driver Deskjet_D1300.

```

Apart from a few warnings it seemed to do what it was supposed to do.

```

media-server drivers # cd /var/lib/samba/printers/W32X86/

media-server W32X86 # ls

3  Deskjet_D1300.ppd  cups6.ini  cupsps6.dll  cupsui6.dll  ps5ui.dll  pscript.hlp  pscript.ntf  pscript5.dll

media-server W32X86 # ls 3/

Deskjet_D1300.ppd  cups6.ini  cupsps6.dll  cupsui6.dll  ps5ui.dll  pscript.hlp  pscript.ntf  pscript5.dll

```

The stupid thing just wont accept the driver.

----------

## bobspencer123

what do you mean by "the stupid thing just won't accept the driver"? I'm assuming the windows client? 

you could try adding some extra options in smb.conf  ... this is mine

```

 [print$]

         comment = Printer Drivers

        # this path holds the driver structure

         path = /etc/samba/printer

         browseable = yes

         guest ok = yes

         read only = yes

         write list = root

```

edit: on a side note I agree that getting my client to share printing and drivers was way harder then it should be and from reading posts on every major distro forums it appears a ton of people have trouble with it and the same solution doesn't work for everybody all the time.

good luck.

----------

## Xamindar

Thanks for that pointer, I'll give it a try. 

The main issue I am having is with my winXP machines. I decided to try the ones running Vista (hardly use vista) and they were able to install the printer and print a test page no problem. I wonder if Vista is using a built in driver or if it is able to get it from the samba server? If I check the properties of the printer under vista all the options are grayed out and I am not allowed to change anything.

----------

## Xamindar

Nope, that didn't help at all. But thanks for the suggestion. Now I remember why I stuck with a windows print server way back then.

I have tested it with two windows vista and one winXP box.

One vista loaded the printer and prints just fine.

The other Vista appears to load it up just like the first vista but when I try to print nothing happens (no error, nothing, just disappears)

The winXP can't even get passed the driver part.

Sometimes I really hate samba.

----------

