My co-worker has a Win XP machine with a USB printer that he would like to share and be able to print to it from a Linux machine. He has enabled sharing on the Win XP machine and has installed SAMBA on the Linux box. He has had absolutely no luck in even seeing the Win XP machine or the printer from the Linux machine. What needs to be done to use the shared printer?

The Linux machine is dual boot and the other operating system is Vista, which is able to print to the printer.

link|improve this question
feedback

2 Answers

up vote 2 down vote accepted

you should be able to talk with the windows machine and ask for a list of shared printers with this command:

smbclient -L rice -N

If Windows naming service is unavailable you will need to specify the IP address of the Windows PC with the -I switch as in:

smbclient -I 192.168.1.25 -L rice -N

Once you have found a Windows printer you may configure CUPS. First verify that your installation of CUPS has the smb backend with the following command:

ls -l /usr/lib/cups/backend/smb

If this file does not exist create it by issuing the following:

ln -s `which smbspool` /usr/lib/cups/backend/smb

The following is an example of setting up the printer shown above:

lpadmin -p RicePrinter -v smb://rice/INKJET -P /root/inkjet.ppd
enable RicePrinter
accept RicePrinter
lpadmin -d RicePrinter

If Windows naming service is unavailable, add the switch -h followed by the IP address of the Windows PC to the first lpadmin command as in:

lpadmin -p RicePrinter -h 192.168.1.25 -i smb://rice/inkjet-P /root/inkjet.ppd

Your printer is now ready to test. Send a file to the printer with the lp command followed by a filename, or by printing a document from within an application.

  • please note that this example is based on the debian family of distros.
link|improve this answer
Where can I find the ppd file? My printer is HP LaserJet M1005. – Xiè Jìléi May 18 at 8:29
feedback

There may be other issues going on because for me it has always been a simple menu guided operation. He has probably gone this route, but here goes

Select

System > Administration > Printing > New

At this point at the bottom of the printer type list is "Windows printer via SAMBA"

Then in the printer address dialog select browse, and navigate to the shared printer and select it.

At this point it is just like adding any other linux printer with regard to drivers (very simple and instant, or a little more work).

Then print a test page and off you go.

I just walked through the steps on a dual boot computer and it worked as it does on all my others. As I said, probably other issues, but this will be a record of how it should work.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.