Home » Questions » Computers [ Ask a new question ]

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

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

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?

Asked by: Guest | Views: 194
Total answers/comments: 1
bert [Entry]

"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."