How to print from Linux to a shared USB printer on Win XP?

5,842

Solution 1

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.

Solution 2

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.

Share:
5,842
user1224703
Author by

user1224703

I am a infrastructure security engineer.

Updated on September 17, 2022

Comments

  • user1224703
    user1224703 almost 2 years

    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.

  • Xiè Jìléi
    Xiè Jìléi about 12 years
    Where can I find the ppd file? My printer is HP LaserJet M1005.
  • Dennis
    Dennis over 11 years
    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.