SMB Shared Printer not showing shares

guru at Sisis.de guru at Sisis.de
Tue Feb 28 22:37:11 PST 2006


El día Wednesday, March 01, 2006 a las 12:01:30AM -0500, Steel City Phantom escribió:

> I have followed every howto i can find on getting printing to work with 
> cups.  i finally gave up and plugged the printer into my windows machine 
> and shared it there.  now, my wife's Linspire machine can see it and 
> print fine (Linspire uses kde 3.4, cups, samba share).  Now my fresh new 
> bsd 6 machine can't see the same smb share.  I go add printer, SMB 
> Shared Printer, put in the user administrator and password, click on the 
> refresh to see all the workgroups, workgroup shows fine, open the 
> windows server workgroup and no server.  i go to a command prompt and do 
> a smbclient -U bla -L server and i see a list of all shares, including 
> the hidden ones and the printer i wish to print to. 
> 
> If i type the information in manually, then it adds the printer to cups 
> but shows the status as stopped.
> 
> I have tried every combination of this i can think of, nothing seems to 
> work.  you guys have any ideas?

Here is a small 'how-to' I wrote while adding CUPS-controlled printers
to the Windows XP which runs in Qemu on top of FreeBSD with Samba.
Hope it helps you out.

	matthias

-- 
Matthias Apitz / Sisis Informationssysteme GmbH
ein Tochterunternehmen der OCLC PICA B.V. Leiden (NL)
D-82041 Oberhaching, Gruenwalder Weg 28g
Fon: +49 89 / 61308-351, Fax: -399, Mobile +49 170 4527211
http://www.sisis.de/~guru/
-------------- next part --------------

$Id: cups-samba.txt,v 1.3 2006/02/22 07:31:23 guru Exp $


This is how to use the CUPS system from a Windows (XP) box over
Samba. The goal is not to have to install the printers and it's drivers
on any XP box, rather using what Samba know from CUPS about them and
their drivers which are stored (central) in Samba's share.

Install /usr/ports/print/cups-samba and follow the guide of the
postinstall instructions.

MANUAL INSTALL INSTRUCTIONS:
==============================

To complete the installation of print/cups-samba, do in order:

CUPS-BASE
-----------

1) Uncomment application/octet-stream line in /usr/local/etc/cups/mime.types
2) Uncomment application/octet-stream line in /usr/local/etc/cups/mime.convs
3) Make sure in /usr/local/etc/cups/cupsd.conf that the Samba server is
   allowed to use the CUPS server at all;
4) Restart cupsd

SAMBA
-------

1) edit the [global] section of smb.conf and make sure it has these
   lines (see 'man cupsaddsmb' for more info):

[global]
        load printers = yes
        printing = cups
        printcap name = cups

2) edit the [printers] section of smb.conf and make sure it has these
   lines:

[printers]
        comment = All Printers
        path = /var/spool/samba
        browseable = no
        public = yes
        guest ok = yes
        writable = no
        printable = yes
        printer admin = root

3) edit the [print$] section of smb.conf and make sure it has these
   lines (the 'path' must be this exactly):

[print$]
        comment = Printer Drivers
        path = /usr/local/samba/printer
        browseable = yes
        # guest ok = yes works too
        guest ok = no
        read only = yes
        write list = root

4) restart Samba

____________
NOTE:  Samba needs to know about the passwords for printer admin and
write list or authentication will fail. Set them with 'smbpasswd -a root'


CUPS-LPR
----------

Now comes the tricky part.

Put the following files somehow (i.e. stolen from another XP box)
to /usr/local/share/cups/drivers

# ls -l
total 1996
-rw-r--r--  1 root    wheel    134144 21 feb 13:30 ps5ui.dll
-rw-r--r--  1 root    wheel     25113 21 feb 13:30 pscript.hlp
-rw-r--r--  1 root    wheel    792644 21 feb 13:30 pscript.ntf
-rw-r--r--  1 root    wheel    464384 21 feb 13:30 pscript5.dll

The 'cupsaddsmb' need them exactly(!) with these names, make sure
that they are no with capital letters after having copied them from
a Windows box. Watch also what 'cupsaddsmb ... -v ...' says about them
below.


Run cupsaddsmb

If only a subset of your printers will be installed as exportable to
MS Windows NT/XP/2000/2003 clients:

# cupsaddsmb -U root ps casa color ...

To export all printers to MS Windows NT/XP/2000/2003 clients:

# cupsaddsmb -U root -a

In either case, you will be prompted for the root password.

Use the flag '-v' to watch what's going on. The 'cupsaddsmb'
should create the needed driver structure below /usr/local/samba/printer
(this is the entry in smb.conf) and it should look like this

# cupsaddsmb -H localhost -U root -h localhost -v ps
Password for root required to access localhost via SAMBA: 
Running command: smbclient //localhost/print\$ -N -U'root%XXXXXXX' -c 'mkdir W32X86;put /var/spool/cups/tmp/43fb082709744 W32X86/ps.ppd;put /usr/local/share/cups/drivers/ps5ui.dll W32X86/ps5ui.dll;put /usr/local/share/cups/drivers/pscript.hlp W32X86/pscript.hlp;put /usr/local/share/cups/drivers/pscript.ntf W32X86/pscript.ntf;put /usr/local/share/cups/drivers/pscript5.dll W32X86/pscript5.dll'
added interface ip=193.31.10.34 bcast=193.31.10.63 nmask=255.255.255.224
added interface ip=172.20.0.1 bcast=172.20.255.255 nmask=255.255.0.0
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 2.2.12]
putting file /var/spool/cups/tmp/43fb082709744 as \W32X86/ps.ppd (3055.0 kb/s) (average 3055.0 kb/s)
putting file /usr/local/share/cups/drivers/ps5ui.dll as \W32X86/ps5ui.dll (65496.8 kb/s) (average 9628.2 kb/s)
putting file /usr/local/share/cups/drivers/pscript.hlp as \W32X86/pscript.hlp (24522.0 kb/s) (average 10373.0 kb/s)
putting file /usr/local/share/cups/drivers/pscript.ntf as \W32X86/pscript.ntf (96757.1 kb/s) (average 35054.5 kb/s)
putting file /usr/local/share/cups/drivers/pscript5.dll as \W32X86/pscript5.dll (90698.2 kb/s) (average 43485.6 kb/s)

Running command: rpcclient localhost -N -U'root%XXXXXXX' -c 'adddriver "Windows NT x86" "ps:pscript5.dll:ps.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:pscript.ntf"'
cmd = adddriver "Windows NT x86" "ps:pscript5.dll:ps.ppd:ps5ui.dll:pscript.hlp:NULL:RAW:pscript.ntf"
Printer Driver ps successfully installed.

Running command: rpcclient localhost -N -U'root%XXXXXXX' -c 'setdriver ps ps'
cmd = setdriver ps ps
Succesfully set ps to driver ps.

If all is fine you will see the driver structure below .../W32X86/3
with the following files:

# ls -l /usr/local/samba/printer/W32X86/3
total 1668
-rwxr--r--  1 root  wheel   53183 21 feb 13:32 casa.ppd
-rwxr--r--  1 root  wheel   74552 21 feb 13:32 color.ppd
-rwxr--r--  1 root  wheel   53182 21 feb 13:32 ps.ppd
-rwxr--r--  1 root  wheel  134144 21 feb 13:32 ps5ui.dll
-rwxr--r--  1 root  wheel   25113 21 feb 13:32 pscript.hlp
-rwxr--r--  1 root  wheel  792644 21 feb 13:32 pscript.ntf
-rwxr--r--  1 root  wheel  464384 21 feb 13:32 pscript5.dll
-rwxr--r--  1 root  wheel   53206 21 feb 13:32 smb.ppd

i.e. one *.ppd file for each printer (copied from CUPS) and
the four driver files mentioned above.


WINDOWS
---------

1) Browse and install for a network printer this way:

1. Open the Explorer window
2. Enter the location of the printer share, in XP is like this, for
   example:
   \\172.20.0.1\Drucker und Faxgeraete\
   You will (should) see all the printers added with 'cupsaddsmb'
3. Click on one printer (only needed once and for one printer) and
   select 'connect' from the pulldown.

After this you should be able to print a testpage as normal.

/usr/local/share/doc/samba/Samba-HOWTO-Collection.pdf has some
valuable information on this topic, especially chapters 17 and 18.




More information about the freebsd-questions mailing list