Download your favorite Linux distribution at LQ ISO.
Go Back > Linux Answers > Hardware
User Name


By wrw3 at 2004-06-10 23:27
This Linux Answer outlines the steps to connect and print using CUPS to an HP OfficeJet 5510 attached to a Microsoft XP Pro. Please do not rely on these instructions alone without familiarizing yourself with the docs for CUPS (, information about HP printers and the HPIJS driver (, and Samba (

I crafted these instructions on a Red Hat (RH) system, kernel 2.4.18-14. No reason to believe anything here is distribution specific, however.

1. Since I had vestiges of LPD and CUPS on my system, and was not being successful in getting the new printer to work, I decided to clean house, removing all the printing software (LPD, cups) using RH's package manager.

2. Download the latest CUPS from, and the latest HPIJS from for the HP OfficeJet 5500.

3. Install CUPS (Standard routine: ./configure, then make, then make install -- you must perform make install as root)

4. Install HPIJS (same routine as above).

5. Test HPIJS ( # hpijs -h should show hpijs 1.6 Also, you should have the requisite ppd file (HP-OfficeJet_5500-hpijs.ppd) in /etc/cups/ppd, installed by the HPIJS make install. )

6. Activate the CUPS server (# /etc/init.d/cups start -- if CUPS is running (/etc/init.d/cups status) then use restart, vs start as the argument)

7. Check for the CUPS backend's knowledge of SMB services by running lpinfo -v. The first run of this on one of my workstations did NOT show network smb so I had to enter a link:

#ln -s `which smbspool` /usr/local/libexec/cups/backend/smb

and then restart CUPS: # /etc/init.d/cups restart

8. Now CUPS should be ready to create a printer, so point your browser to http://localhost:631 to open the CUPS admin utility.

Log in as root with the root password.

Select Do Administration Tasks, Printers, Add Printer. Note that the Add New Printer dialog Name field must start with an alpha and contain no white space. The other two fields (Location and Description) are more relaxed.

Declare the Device to be Windows SMB (that selection was at the bottom of the list for me).

9. Device URI: The URI that worked for me is in the form: smb://[UName}:[Password]@[Machine Name]/[Sharename]

Implied in that statement is a user set up on XP for SMB login. Here I am not sure of exact facts, because there are many postings with varied info on what works when printing to Windows print queues. Some claim logging into a user account is not necessary, but I found that I had problems unless I did. Review your samba logs if you get unexpected results. They can be found in /var/log/samba. I have a user on the XP system with rights to the printer for the purpose of accepting print jobs from my Linux workstations. On my network it works using a URI like this:


10. You should be able to print a test page from the CUPS admin utility, now, and live happily ever after.

by Sloppyunderfoot on Tue, 2005-03-01 14:56
It has taken me what seems like forever to find a way to print from my mandrakelinux box to a windows printer. Today, at home thanks to a great New England storm - spending a couple of hours reading and about an hour on the internet, I came upon this post. Five minutes after I finished the article I was able to send a test print to the printer successfully.

If it wasn't for the linux community I'd still be pounding my head against a wall. I cannot express my thanks too loudly. Thank you.

by fujijr on Mon, 2005-12-26 22:31
If you have a space in your Windows Username, you can use %20 to represent it.

by redialpause on Sat, 2006-01-07 22:18
I've just spent all morning on this and am finally printing. In case it helps anyone, I noticed that when I type
smbclient -L <IP address of Windows XP machine>
(in my case: smbclient -L
the share name of my printer is not what I thought it was (i.e. Canoni56 instead of Canoni560).

Also there seem to be many different ideas on how to set the device URI in CUPS ... I found that the IP address was the only thing that worked.

So I set the device URI to smb:// and now I'm printing

by mngmd on Thu, 2006-01-12 13:51
Can we do this the other way around? I have my Officejet attached to my Linux box. I would like to have printers running Windows print from this machine.

The printer is shared via Samba, but I can't install Windows drivers for it.


All times are GMT -5. The time now is 09:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration