Picture of FreeNAS as a Print Server
FreeNAS is an excellent network storage solution simple enough for anyone to install. The system and space requirements are ridiculously small for this stripped-down version of FreeBSD. It's got all manner of features accessible through it's clean web GUI, more than most will ever need. It even lets you stream media to game consoles!

Despite it's impressive built in abilities, there was one thing that I wanted it to do besides act as a great NAS, and that was to be a print server so I could share my HP Deskjet 6540 USB printer among my Windows and Mac OSX boxes. Easier said than done. After hours of playing around with CUPS and a few broken installs later, I saw the light.

On the FreeNAS forums, user sgrizzi created a thread on how to make it work with LPR, using the LPRng package, for a LiveCD based setup. It was EXTREMELY helpful, and he/she should get most of the credit, but the thread really needs to be condensed and clarified to be a useful guide. That is exactly what this Instructable is for, as well as modifying it for a standard full install of FreeNAS.

This guide assumes you already have a current standard install of FreeNAS set up and working.
1-40 of 119Next »
noahw6 years ago
Hey, this is a great instructable and is very informative. Just one thing is missing... pictures! It really helps a lot when trying to follow directions so you should consider taking some photographs. Once you do that and leave me a message when you have so that we can publish your work. Thanks! Thanks for the cool instructable and we hope to publish this soon!
Reytera1 year ago
the way is nolonger to support freenas 8X, i have try it, root ID cannot write nano because permission denid, but it also can use in nas4free
PumaPerez2 years ago
hi. would you be so kind and make tutorial for version 8.3 please? i dont have rc.conf in interface in this version. thank you
onosendi2 years ago
You need to remount the file system as readable/writable.

# mount -uw /

When you're finished, make sure you remount it as readonly.

# mount -ur /
eckiw-13 years ago
I reached this point: by changing pkg_add -r LPRng to:
pkg_add -r ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.4-release/Latest/LPRng.tbz
But at the end it says:
pkg_add: pkg_add of dependency 'gettext-' failed!
Does this mean a problem? or can I ignore it?
did you ever find out the workaround to this problem? i'm stuck at the same point, if i go ahead like it's no problem i can't do the next step... i thought maybe because i'm running an AMD Sempron i should get the amd64 port rather than i386 but it didn't make any difference.
Somebody help please!
No, he is correct. Even as root, /boot/kernel will not allow any new files to be added to it.
I should have included that I am trying this instructable on FreeNAS v.8.0.1. I have tried several ways to get the ulpt.ko file into the /boot/kernel directory, and it will NOT let me write to it or change the permissions on the directory.
ghost128k4 years ago
good morning, i´ll try to install but when done download file .tbz i can see in the screen:
Last login: Fri Jun 24 08:27:39 2011 from
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.

Welcome to FreeNAS!

freenas:~# pkg_add -r LPRng
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.3-release/Lates
t/LPRng.tbz... Done.

/: write failed, filesystem is full
bin/lpr: Write failed: No space left on device: No space left on device
bin/lprm: Write failed: No space left on device: No space left on device
bin/lpstat: Write failed: No space left on device: No space left on device
lib/liblpr.a: Write failed: No space left on device: No space left on device
libexec/filters/lpbanner: Write failed: No space left on device: No space left o
n device

/: write failed, filesystem is full
libexec/filters/lpf: Write failed: No space left on device: No space left on dev
libexec/filters/psbanner: Write failed: No space left on device: No space left o
n device
sbin/checkpc: Write failed: No space left on device: No space left on device
tar: Error exit delayed from previous errors.
pkg_add: leave_playpen: can't chdir back to ''

i have installed freenas in a datatravel pendrive usb with 8 gb of capacity, but when i execute df, the command shown:
freenas:~# df
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/md0 190190 190188 2 100% /
devfs 1 1 0 100% /dev
procfs 4 4 0 100% /proc
/dev/md1 31470 1292 27662 4% /var
/dev/ad4p1 473018108 12433064 422743596 3% /mnt/cosas
/dev/da0a 71062 66786 4276 94% /cf

What i can do for install the pakage?
If it is a memstick has plenty of memory try

mount -uw /

My stick was set to read only.

alique4 years ago
Is this ok? just to clear stuff up?

freenas# mv /mnt/start/ulpt.ko /boot/kernel/ulpt.ko
mv: rename /mnt/start/ulpt.ko to /boot/kernel/ulpt.ko: Read-only file system
alique4 years ago
I'm not sure if this is an error but i'm getting this...

tar: Error exit delayed from previous errors.
pkg_add: leave_playpen: can't chdir back to ''

is it ok?
4iter4 years ago
I have the same problem. hp 1020.
When l plugged my printer, FreeNAS beeping and typing "using bi-directional mode". Is it right?
rstrawsb4 years ago
Looks like the package moved, This is how I got around the error.

pkg_add -r ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages/Latest/LPRng.tbz
henke714 years ago
Hi, is it possible to use this instruction for my FreeNAS 0.7.2 (FreeBSD 7.3) ?
yoseftux4 years ago
Completed after some very careful reading, and consulting the source thread.
A few helpful hints to my fellow explorers:
1) Instead of stating requires a "standard" installation, should state up front that it requires a FULL install, an embedded install will not get past 1st base.
2) devd.conf must be placed in /usr/local/etc/devd - if the directory doesnt exist, create it.
3) once all the pieces are in place, reboot to fully initialize the system.
4) helps to manually run the
echo 'o5L25fgfab' > /dev/speaker
command so you know exactly what to listen for. This is the success trumpet :)

All in all, a very good instructable. Thanks for the hard work Tau_Zero!!!
andrewgking4 years ago
Starting LPRng,

freenas:~# lpd (enter)
2010-10-29-03:29:08.044 freenas Read_file_list: cannot stat required or included file '/etc/printcap' - No such file or directory

to fix
freenas:~# mv /usr/local/etc/printcap /etc/printcap
freenas:~# lpd (no error this time)
Thommo19714 years ago
I can't get it to print anything. As soon as I enter the IP address and name of the print queue, it comes up with a message box telling me that "the lpd request did not respond as expected to a test command". It lets me continue the set up but I cannot print. I shows in the printer properties as a document sent for print but reports "printer busy or error"
Thommo19714 years ago
I followed the instructions as given but I don't seem to have the /etc/printcap directory. Help!
on freenas the file is on /usr/local/etc/printcap
Thank you! I've now found it!
kenkenlau6 years ago
Great Job. but I have a minor problem. The ulpt.ko file attached is a *.tmp file after download. Do I need to rename it or extract it? sorry that I m unix newbie. Please let me know the command line. I tried tar -xf but seems no luck. Thanks
Tau_Zero (author)  kenkenlau6 years ago
Apparently there's a bug with instructables. Someone posted a workaround, i forget where.

"I think it's an instructables bug :( The same thing happens when I try to download files from here sometimes. The fix is to save the file as

"file name.file type"

if you put quotes around the name like above it will use the file type you put in. For example:
To save '2 inch box bottom'

  • right-click the file
  • save as
  • in the name field type (including quotes) "2 inch box bottom.stl"
This method also works just renaming files. Use the quotes and the file type extention when you rename a file an it should change the file type as well as the name."
Thanks. I renamed it. I managed to edit the files needed. Plug in my HP 3050 there is a beep. seems the lpd is running. But print from XP machines still have no response. I may need to google around and see what is the problem. LPRng installed successfully. printcap under /etc created. and the other 2 files is as described. devd folder created. devd.conf created. any command line can let me check the lpt0, lpd, is loaded and running properly? Thanks.
in the /dev directory, I can see the ulpt0 in the FreeNAS GUI -> status -> process, I can see lpd, devd. do they indicate I am going the right way? ar.....sorry for my first time to unix system....headache..... Thanks.
Tau_Zero (author)  kenkenlau6 years ago
Don't worry about being new. I'm loosely familiar with the system (I'm usually on an XP machine or my Mac, which is Unix based, but hardly the same experience). The beep and ulpt0 showing up is a good sign. It means that at the very least, your printer is being seen by the FreeNAS box. The lpd running is a good sign. Through the FreeNAS GUI -> Advanced -> command, try these commands: lpc lpd (gives you the PID of lpd or signals an error if lpd is not loaded) lpq (should return the status of the empty spool queue) lpc status (should show the queue and the spooler status) ls -l /dev/ulpt0 (should show ulpt0 setup for read-write for user, group, root) Let me know whether the first three run fine, or whether they say there's an error of some sort. Also let me know what permissions it says ulpt0 has. If everything is in order there, then we can go troubleshoot the other computer's setup for connecting.
Tau, gald to see you are still helping people on the FreeNAS printer server. I have my old NAS down after 1 year of use, and try to setup a new one (0.7.1). Get back here for some information.
In my case, the ulpt0 does not work. I read many posts in the FreeNAS forum and then change to unlpt0 in printcap. also the devd.conf.

=== then everything WORKS fine === if anyone also get the "device busy" when giving the lpq command, try unlpt0 instead of ulpt0.

Thanks for the great instructables, Tau.
Tau_Zero (author)  kenkenlau5 years ago
It's been my pleasure helping folks out. Getting a printserver out of an existing FreeNAS box is a fantastic addition to any home network that it'd be a crime not to!

Thank you very much for your research. I wish I was more familiar with the system so I'd know why that change works exactly, but I'm very glad to hear you found a resolution. Did you need to do anything except change ulpt0 to unlpt0 in steps 6 and 9?
ar....actually there is a typo, for the devd.conf
I deleted a ; before the "
also, I added 1 more sound when the printer is unplugged. here is the devd I used:

ar....actually there is a typo, for the devd.conf
I deleted a ; before the "

also, I added 1 more sound when the printer is unplugged. here is the devd I used:

# start action when USB printer ulpt0 is plugged in
# wait 3 second and then start the spooler daemon
attach 100 {
device-name "ulpt0";
action "sleep 3; lpd;
checkpc -f;
chown 0:0 /dev/ulpt0;
chmod 666 /dev/ulpt0;
chown 0:0 /dev/unlpt0;
chmod 666 /dev/unlpt0;
echo 'o5L25fgfab' > /dev/speaker";
# this will cause a beep when you unplug the usb printer1
detach 100 {
device-name "ulpt0";
action "sleep 1;
echo 'o5L10bafgffgfab' > /dev/speaker;
sleep 1;
echo 'o5L10fgfabbafgf' > /dev/speaker";


xantes5 years ago
I am introducing the FreeNAS static IP in Putty.exe and I got an error: "Network error: Connection refused." What am I doing wrong?!
Network error  Connection refused.jpg
Tau_Zero (author)  xantes5 years ago
Go into the Web GUI for FreeNAS, Services->SSH, and make sure it's enabled.
xantes5 years ago
Sorry but this is not a tutorial for anyone. It does requires more than medium knowledge about Unix, Linux and so on. Especially since is a very long tutorial not only very complex.
Tau_Zero (author)  xantes5 years ago
I'm sorry you feel that way, but 11 steps is not very long at all, and if you've got a standard full install of FreeNAS, you can do it if you know how to read and type. What part do you think requires some special knowledge of *nix systems?
ychauvel5 years ago

I'm trying to get the attached "ulpt.ko" file... I get a .tmp file!
Can anyone help?

i have the problem when I'm trying to get the attached "ulpt.ko" file... I get a .tmp file! Can you help me? Tanks
Tau_Zero (author)  ychauvel5 years ago
 Check further down in the comments.
Even puting the commands in this file /etc/devd.conf (because version 7.1 doesn't have the one informed in instructions), i don't get printer working after reboot. I'm looking for a place where I can put this command. Any ideia?
mic985 years ago
can anybody  help me to setup a 2nd printer.

I already got one printer working on a full install of freenas v7.1 but i get stuck
to do a 2nd printer. So far as i can see their is no guide for this for a full install.

I found guides for embedded or live cd's but that does'nt help me much.
So if somebody could help me out,i would appriciated.

izakw.5 years ago
to solve the problem with ftp fetch:
Error: FTP Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.2-release/Latest/LPRng.up.tbz: No address record
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.2-release/Latest/LPRng.up.tbz' by URL

i have set the domian in freenas webgui: system->general setup from "local" to "com"
and now everythings fine.

bboudewijns5 years ago

I just restarted the whole thing and i dont know why, but everything is working just fine now! Thanks again for the nice instructable, all my other comments can be deleted!

1-40 of 119Next »