Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 May 2004 07:36:24 +0000
From:      "Richard Liang" <squixy@hotmail.com>
To:        gerard-seibert@rcn.com
Cc:        freebsd-questions@FreeBSD.org
Subject:   Configuring Samba for Printing on WinXP Machine
Message-ID:  <BAY16-F104qXYzb07TX0001c1ad@hotmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

I recently went through all of this with a Windows 2000 machine; I ended up 
doing it using Samba and CUPS.  Apparently there are ways to do it using lpd 
and apsfilter, but I think using CUPS is the cleanest solution.

Configuring Samba won't be too bad if you're only going to be accessing 
other shares, rather than setting up shares on the FreeBSD box.  In that 
case, not very much configuration is needed; only the smbclient and smbspool 
programs (these are the client programs that access other shares).  Get 
familiar with SWAT; it's a real nice tool and makes configuring Samba mostly 
painless.  Using SWAT, you can change the workgroup name that you want the 
FreeBSD box to access, and the NetBIOS name of the FreeBSD box.  Note that 
if you do want to set up Samba shares on your FreeBSD box, you'll need to 
set "Encrypt Passwords" to yes and use smbpasswd to maintain Samba's set of 
username/passwords that allow Windows users to access the FreeBSD shares.

First, make sure it works by generating a file that is ready to be sent 
direct to your printer.  By that I mean a file in your printer's native 
raster format.  You can do this using ghostscript and a postscript file (or, 
if your printer is already postscript, you can just send the postscript file 
directly).  Use smbclient to do this.  If it works, then your Samba 
configuration is good enough.

Next, you will need to create a symlink to the smbspool program in 
/usr/local/libexec/backend (this is where CUPS keeps all of the transport 
programs it uses to deliver jobs to the printers).  Once this is done, use 
the CUPS tools to add a Windows network printer using Samba.  It will ask 
for the name of the printer, and prompt you with "smb:".  This is the name 
of the printer share.  In my experience you will also need to provide a 
username/password to CUPS in the name; this is the user account which all 
the printing will be done under.  I used the Guest account so that I 
wouldn't have my password in a file (albeit an unreadable file).  In any 
case then the full name you will have to put here is something like
smb://<username>:<password@<Windows machine name>/<printer share name>
(Type "smbclient -L <Windows machine name>" to find all the available shares 
on this machine, using the -U option if your username is different on the 
FreeBSD and Windows boxes.)

>From there you should be scot free from the parts concerning Samba.  
Potential gotchas:
1) if your printer is not natively supported by CUPS' drivers, you can use 
foomatic-db and foomatic-db-engine to generate a driver for your printer.  
Follow the documentation on www.linuxprinting.org to get the printing going 
in this scenario; note you will need to install the foomatic-rip script 
yourself (I couldn't find it in ports).

2) If you set up shares on your FreeBSD box, make sure you don't have LDAP 
support enabled when you compile.  I did by accident and it kept me from 
administering the Samba password file.

Another neat printing solution I found online, using only lpd, is outlined 
on this website:
http://www.freebsddiary.org/samba.php
It involves printing to a dummy fifo, then using smbspool to send the 
contents of the fifo to the printer.

Hope this helps,

Richard

_________________________________________________________________
STOP MORE SPAM with the MSN Premium and get 2 months FREE*    
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BAY16-F104qXYzb07TX0001c1ad>