HP Linux Imaging & Printing on FreeBSD HowTo


Hewlett-Packard has an air of respect among open-source enthusiasts: they've released high-quality drivers and tools for their many printers as truly free software, under the name Hewlett Packard Linux Imaging & Printing. The name implies that it's a Linux-only thing, and until a few months ago it was, but we can thank Anish Mistry for getting a working version into the FreeBSD Ports collection. Making it work, though, takes a little effort, and there doesn't seem to be a step-by-step guide to get it running yet. So, combining the information from pkg-message and my own experience, here's how to got an HP DeskJet 5650 cooperating with FreeBSD 6 using HPLIP version 1.6.12.


  1. Build the print/hplip port:
    # cd /usr/ports/print/hplip
    # make install clean

    During a successful installation, a user and corresponding group named "hplip" should be created, which are used to run the HPLIP daemons.

  2. HPLIP requires that printers are recognized as generic USB (ugen) devices, not USB printer (ulpt) devices. This means that the GENERIC kernel won't do, since it has ulpt support built in. Compile and install a new kernel with a configuration file that doesn't include the line "device ulpt" (see section 8.3 of the handbook, "Building and Installing a Custom Kernel", available locally under /usr/share/doc/handbook/kernelconfig-building.html.)

    With the new kernel running, plug in the printer, and make sure it's recognized as a ugen device:
    # dmesg | grep ugen
    ugen0: hp deskjet 5600, rev 2.00/1.00, addr 2

    The DeskJet 5650 is part of the DeskJet 5600 line of HP printers, so it's unimportant that the model numbers don't exactly match.

  3. Make the hplip.conf.sample file the configuration file to use:
    # cd /usr/local/etc/hp/
    # cp hplip.conf.sample hplip.conf

  4. Add the HPLIP daemons to rc.conf, in the following order:
    # echo 'hpiod_enable="YES"' >> /etc/rc.conf
    # echo 'hpssd_enable="YES"' >> /etc/rc.conf

    Be sure cupsd_enable="YES" is also present in /etc/rc.conf, since CUPS is required for HPLIP to work.

  5. Set up devfs.rules to make the printer usable:
    # echo "[system=10]" >> /etc/devfs.rules
    # echo "add path 'ugen*' group operator" >> /etc/devfs.rules
    # echo "add path 'ugen*' mode 0660" >> /etc/devfs.rules
    # echo 'devfs_system_ruleset="system"' >> /etc/rc.conf

    NOTE: if you've already set up devfs.rules for some other reason, just add the ugen rules to your default ruleset.

  6. Configure the printer. This can either be done through the command hp-setup, or through the CUPS web interface (usually running on localhost:631). If all went well, the printer should be automatically detected by CUPS, so adding the printer as a queue should be as simple as selecting it from the detected printers section. The command hp-setup (run as root) will start a wizard that should also have detected the printer. Both are self-explanatory.

That's it! All printing through CUPS-supporting applications should respect the newly-added HP printer as any other device. What's more, you can use hp-toolbox to perform printer tasks and monitor the status of multiple HP devices.

External Links

Daniel W. Steinbrook

Global navigation links