Configuring a Solaris 10 client to print to a network printer

This content is 19 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

For weeks now, I’ve been trying to configure my Solaris client to print to a network-attached HP LaserJet 2200dn printer and I finally got it working today. It’s probably really easy for an experienced systems administrator but there were a few gotchas that caught me out – hopefully my experiences will help someone else out.

In many ways the Solaris Print Manager makes setting up a printer easy, but there were some important settings I needed to use (I found some of this on an HP support document, but there was also a lot of trial and error involved as I don’t think the advice in HP’s document applies to Solaris 10 x86):

  1. For an HP LaserJet 2200, the recommended printer driver was Foomatic/Postscript – I didn’t use this but selected Foomatic/hpijs instead.
  2. The destination is more than just the IP address or hostname of the print server (i.e. the LPD service on the printer’s JetDirect card) – I needed to append :RAW (LPD queues can be configured through the printer’s own web administration console).
  3. The protocol is BSD (not TCP as I expected).

One really handy feature is the ability to show the command line console, on which all the commands issued by the print manager will be displayed. Using this, I was able to determine that the commands to configure my printer (now saved as a shell script) were:

lpadmin -p hplj2200dn -v /dev/null -A write -n /usr/lib/lp/model/ppd/system/foomatic/HP/HP-LaserJet_2200-hpijs.ppd.gz -i /usr/lib/lp/model/netstandard_foomatic -o dest=printer1:RAW -o protocol=bsd -I postscript -u allow:all
lpadmin -p hplj2200dn -D "Laser printer in Mark's Den (duplex/network)"
lpadmin -d hplj2200dn
enable hplj2200dn
accept hplj2200dn

These will, of course, vary by model. Note that the first (very long) line will wrap on this web page – each of the first three commands should begin with lpadmin.

Don’t be put off by error messages after the enable and accept commands:

UX:enable: ERROR: Can’t establish contact with the LP print service. TO FIX: Either the LP print service has stopped, or all message channels are busy. If the problem continues, get help from your system administrator.
UX:accept: ERROR: Can’t establish contact with the LP print service. TO FIX: Either the LP print service has stopped, or all message channels are busy. If the problem continues, get help from your system administrator.

These fooled me for a while but I think the problem was just that the printer had not yet been established when I tried to enable it. By waiting a few seconds and re-issuing the last two commands, everything jumped into life.

I don’t know why there is a postscript reference in there – as far as I know this is a PCL printer, but it seems to work.

Finally, the commands to remove the printer (also now saved as a shell script) are:

reject hplj2200dn
lpadmin -x _default
lpadmin -x hplj2200dn

7 thoughts on “Configuring a Solaris 10 client to print to a network printer

  1. We have to be able to use HP PCL in our C code for use with printing out data from our Oracle database. Our Solaris 7 computer used /opt/hpnp and /opt/hpnpl. Do you know a way to install these (JetAdmin) (JetDirect) in Solaris 10 and will they work? Or do we even need them?

  2. DC, Anita,
    Sorry guys – would love to help out but really don’t know the answer. Unfortunately I gave up on Solaris soon after I wrote this post (because I was struggling to get answers on too many things).

    Mark

  3. Hi,
    My network printer IP is 172.10.21.10. Where should I specify the IP Address?
    Regards,
    Rajeesh

  4. would u like to put an example u modifed in the /usr/hosts ?
    I can’t succeed in finding the remote printer.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.