Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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 -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 -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.
share|improve this answer
Where can I find the ppd file? My printer is HP LaserJet M1005. – Xiè Jìléi May 18 '12 at 8:29

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


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.

share|improve this answer
i did on 2nd method what you said.. System > Administration > Printing > New... all i did..but when i gave print from Linux its showing message like document send to canon .. but printer not printing anything..? whats the problem..? – user187215 Jan 11 '13 at 14:36
Just a guess but, could be a driver problem. In essence you have set up a communication with the printer, however if the driver (on Linux) isn't working properly you still have that issue. I would start looking for drivers for your distro that match the printer. Or try using a PPD if you can find one. – Dennis Jan 11 '13 at 22:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .