3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

FreeNAS as a Print Server

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.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Preparation

Preparation
First, let's get together a few things and take a look at the setup.

The Network
Your setup may be different, but mine is as follows.
- Linksys WRT54GL router running Tomato firmware v1.23
- FreeNAS box - v0.69, old Sony Vaio, 2 hard drives, static IP: 192.168.1.50
- PC - Windows XP SP3
- Macbook Pro - OSX 10.5.6
- HP Deskjet 6540 - USB connected printer, attached to FreeNAS

You will need to assign your FreeNAS box a static internal IP from within your router. There's plenty of guides online for that, all straight-forward, so do a quick Googling.

Stuff You'll Need
- Windows install disk if you're using Windows (necessary files may be availible elsewhere, but this is the easiest)
- Printer Drivers for your particular make/model
- The file "ulpt.ko" taken from a full FreeBSD install. File attached to this instructable.
- SSH client - For Windows, go with PuTTy. For Linux, Unix, Mac, etc you can just use the terminal/command line
ulpt.ko11 KB
« Previous StepDownload PDFView All StepsNext Step »
118 comments
1-40 of 118next »
Mar 13, 2009. 9:19 AMnoahw says:
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!
Jan 8, 2012. 11:04 AMeckiw-1 says:
Hi,
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-0.18.1.1' failed!
Does this mean a problem? or can I ignore it?
Mar 6, 2012. 11:01 AMweecho77 says:
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!
Oct 5, 2011. 7:13 AMMurphys_Lawyer says:
No, he is correct. Even as root, /boot/kernel will not allow any new files to be added to it.
Oct 5, 2011. 7:20 AMMurphys_Lawyer says:
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.
Jun 24, 2011. 1:36 AMghost128k says:
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 80.26.36.12
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
ice
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 ''
freenas:~#

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?
Thanks
Sep 16, 2011. 5:10 PMjimchest says:
If it is a memstick has plenty of memory try

mount -uw /

My stick was set to read only.

Jun 12, 2011. 6:44 PMalique says:
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
Jun 12, 2011. 6:20 PMalique says:
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?
May 3, 2011. 4:56 AM4iter says:
I have the same problem. hp 1020.
When l plugged my printer, FreeNAS beeping and typing "using bi-directional mode". Is it right?
Jan 16, 2011. 9:29 PMrstrawsb says:
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
Dec 30, 2010. 1:31 PMhenke71 says:
Hi, is it possible to use this instruction for my FreeNAS 0.7.2 (FreeBSD 7.3) ?
Dec 17, 2010. 2:50 PMyoseftux says:
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!!!
Oct 28, 2010. 8:38 PMandrewgking says:
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)
Oct 16, 2010. 4:10 PMThommo1971 says:
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"
Oct 7, 2010. 2:04 PMThommo1971 says:
I followed the instructions as given but I don't seem to have the /etc/printcap directory. Help!
Oct 15, 2010. 11:49 AMjccl2 says:
on freenas the file is on /usr/local/etc/printcap
Oct 16, 2010. 4:01 PMThommo1971 says:
Thank you! I've now found it!
Jun 24, 2009. 10:13 AMkenkenlau says:
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
Jun 24, 2009. 11:57 AMkenkenlau says:
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.
Jun 24, 2009. 1:36 PMkenkenlau says:
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.
Sep 7, 2010. 1:03 PMkenkenlau says:
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.
Sep 7, 2010. 2:12 PMkenkenlau says:
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";
};


enjoy~


Aug 13, 2010. 5:50 AMxantes says:
I am introducing the FreeNAS static IP in Putty.exe and I got an error: "Network error: Connection refused." What am I doing wrong?!
Aug 12, 2010. 10:42 AMxantes says:
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.
Dec 5, 2009. 2:02 AMychauvel says:
Hello,

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

Thanks.
Jul 17, 2010. 11:15 AMaaam1967 says:
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
Jun 25, 2010. 11:07 AMmebkopcznski says:
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?
May 19, 2010. 4:09 AMmic98 says:
hello
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.

Thanks
May 9, 2010. 6:43 AMizakw. says:
hello,
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.



Apr 13, 2010. 4:57 PMbboudewijns says:
Hi!

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!

Cheers!
Feb 22, 2010. 9:40 PMpeephuhpeep says:

Thanks for the nice instruction here! (and thanks to sgrizzi as well as the original author!)

I got a problem that keeps coming back: the file permissions of the /dev/ultp0 keep changing when a printer is plugged out. This we all know that happens..

But I changed the devd.conf file (resided in /etc/devd.etc and also put it in /usr/local/etc/devd/devd.conf).

This is how it looks like:
.....

#

 

# This example calls a script when the AC state changes, passing the

# notify value as the first argument. If the state is 0x00, it might

# call some sysctls to implement economy mode. If 0x01, it might set

# the mode to performance.

notify 10 {

match "system" "ACPI";

match "subsystem" "ACAD";

action "/etc/acpi_ac $notify";

};

# 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;

echo 'o5L25fgfab' > /dev/speaker;";

};

*/
END OF FILE HERE

So this should work? But it doesn't? What could be wrong here?

Apr 13, 2010. 8:51 AMbboudewijns says:
I have exactly the same problem. If i chmod and chown manually the printer is working fine, but the devd.conf is not loaded at boot indeed. I dont get it. Dont here the sound as wel...

Any help would be appriciated!

Thanks
Apr 12, 2010. 11:57 AMbboudewijns says:
Hi!

First of all, thanks very much for this nice guide! But i'm stuck..I did everything you told me step by step but my printer is recognized as a ugen0, ugen0.2 and ugen0.3 instead of the ulpt. It is a common samsung ML-2010 laserprinter.

My ulpt is up and running according to freebsd. Already tried rebooting first and then connecting te printer as well, no change what so ever.

Can you help me please! Thanks in advance!

Greets

PS.
Output:
freenas:/dev# kldstat
Id Refs Address            Size     Name
 1    3 0xffffffff80100000 ab6fb0   kernel
 2    1 0xffffffff80bb7000 3948     ulpt.ko
 3    1 0xffffffff9526e000 c745     geom_mirror.ko

1-40 of 118next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
3
Followers
1
Author:Tau_Zero(Napkin Diagrams)
Twitter: @Tau_Zero