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):
- For an HP LaserJet 2200, the recommended printer driver was Foomatic/Postscript – I didn’t use this but selected Foomatic/hpijs instead.
- 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).
- 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
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:
lpadmin -x _default
lpadmin -x hplj2200dn