Using Linux as a printserver to XP
Linux makes a great file and print server but getting xp to print to the printer using samba and cups can be a bit tricky. here is a quick How-to.
The Setup
Linux can
use a print server program called cups and the smb protocol to allow
windows PC's to print to it's printers. One can also print directly to
cups from a windows box but that is for another how-to.
This How-to assumes that you have cups printing setup and
working properly on the linux box that the printer is hooked up to. It
also assumes you have samba installed on the linux box and it can be
browsed from the windows box. In your smb.conf you will need
to define a share for the printer. something like this. (example for an
HP deskjet)
[hp940] printer
= HP940
comment = deskjet
940c
printable = yes
public =
yes
path =
/var/spool/samba
use client driver =
yes
The last line is critical or
you will get "Access Denied" errors on XP. Now add a new
network printer in the XP printer control panel. Browse to
the share and when it mentions that the server does not have a driver
go ahead and install the right one in XP.
At this point you will also need to edit 2 cups config
files on
the linux box to allow
raw printing or the jobs will
vanish into thin air. :-)
In the file
/etc/cups/mime.types:
uncomment the following line. #application/octet-stream
And in /etc/cups/mime.convs:
uncomment the following line. #application/octet-stream
application/vnd.cups-raw 0
Now restart cups.
/etc/init.d/cupsd
restart
restart samba
/etc/init.d/samba
restart
and windows should now be able to print.
Happy Printing!
Update:
It has become a bit easier to get XP to talk directly to cups obviating the need for samba so this howto may now be of limited use.
