Description of System
I currently have a FreeNAS (0.7.2) system which is used to support data sharing with other family members. This is running samba to serve files around the house. I am using an Brother 5150D printer with USB interface. The server is to carry out spooling functionality only – no formatting. Print formatting is to be carried out by the clients, all running Windows 7 and XP. There are no changes required to the FreeNAS system hardware setup.
I am using the FULL version with FreeNAS running from a 1TB HD with OS in a partition and data in another partition. I have used exactly the same instructions as described previously by contributors who use the installation from a LiveCD.
Important Notes
These instructions are tested for FreeNAS version 0.7.2 only
To setup the required printing services on XP clients you must have access to your original Microsoft installation disk. You will need to use an SSH connection to access the FreeNAS system during the build. I used WINSCP and a Windows version of PuTTy on my Windows 7 client.
When you connect using the SSH console you should login as root. Your password will be the same as used during a normal FreeNAS login.
These instructions are based on the printer connecting via a USB connection.
1 – Setup the USB printer driver( the ulpt.ko file)
Use WINSCP to connect to the FreeNas
Copy the file ulpt.ko (FreeBSD 7.3 version) to the directory /boot/kernel
2 –Setup LPRng Spooler.Setup LPRng Configuration Files
In the command line of WINSCP, type
pkg_add -r LPRng
to install the package
3. Configure Things to Load on Boot
In winscp edit the file loader.conf in the folder /boot/defaults/
Scroll down until you reach a section titled “USB Modules”
Change the line
“ulpt_load=”NO” # Printer”
to
“ulpt_load=”YES” # Printer”
4. Start LPRng
Navigate to the FreeNAS web interface in a browser. Then go to System–>Advanced–>rc.conf
Use the “+” button to add two new entries:
Name: lpd_enable
Value: NO
Name: lprng_enable
Value: YES
5 –Setup LPRng Configuration Files
There are three main files that contribute to LPRng working properly.
– /etc/printcap
– /usr/local/etc/lpd.perms
– /usr/local/etc/lpd.conf
(i) printcap
The sample printcap file
# @(#)printcap Brother HL-5150D
lp|brother:\
:sd=/var/spool/lpd/bare:\
:sh:\
:lp=/dev/ulpt0:
#
Then make a directory for spooling and change a suitable right
In a command prompt type
mkdir -p -m 700 /var/spool/lpd/bare
and
chown 1:1 /var/spool/lpd/bare
(ii) lpd.perms
The default file should be OK.
(iii)lpd.conf
The default file should be fine.
6 – Prepare The File Needed To Start The Spooler Daemon (lpd).
We’re going to want to start up the proper LPRng processes when a printer is connected.
In Winscp edit or create a file devd.conf in /usr/local/etc/devd/
Add to the file:
# 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;”;
};
*/
7 – Final Checks
Reboot FreeNAS. When you hear the normal ‘beep’ to indicate FreeNAS is up and running, unplug your printer and plug it in again so that the system will “see” it again. If everything is setup properly, after about 3 seconds, you should hear a different musical “bleep” which is the acknowledgement that the lpd daemon is running.
Now use the SSH console to check out a few things:
checkpc –f
This should show if any configuration file is not correct or not loaded properly.
top
You should be able to see the lpd daemon running. Ctrl+C will stop this.
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.
ll /dev/u*
should show ulpt0 setup for read-write for user, group, root. These command will also give you a hint on where problems might be – in case you have any.
8 – Add Required Windows Components on A Windows XP Client PC
Windows XP does provide a built-in Unix LPR client, however you have to load some additional facilities from the XP setup disk.
(This is where these instructions differ from previous documentation).
On your XP machine select Start | Control Panel | Add or Remove Programs.
Select Add or Remove Windows Components (it is an icon on the left task bar).
Tick the option for Management & Monitoring Tools.
Tick the option for Other Network File & Print Services and click Next
You will probably be asked to insert your XP disk at this stage.
Once the additional components have been loaded, click Finish.
This should install the Unix LPR port that we need.
9 – Setup A New Printer – For Windows XP Client PCs
You need to setup your XP machine to use its Windows driver. This will prepare the necessary print file on your Win XP client and spool it over the network to your FreeNAS print server.
On your XP machine select Start | Control Panel | Printers & Faxes.
Step 2 – Select a port
If you can’t add LPR – either you have already set this up and need to use the existing LPR with the required FreeNAS IP address, or you haven’t loaded the LPR facility from the Windows setup disk.
Step 3 – Setup LPR parameters – Inserting the FreeNAS network address and “lp”.
Now choose a pre-defined printer, or insert your manufacturers disk. Remembering this is the Windows driver you are adding.
Now try and print something from your Windows XP client, using the newly added printer. If your printer connected to FreeNAS now prints correctly, then this is the task completed.
10 – Add Required Windows Components on A Windows 7 Client PC
The printer drivers you use here are the Windows drivers.
On the Windows 7 machine select Start | Control Panel | Programs.
Select Turn Windows Features On/Off.
Go to Print Services and expand the + box.
Select (by adding a tick) LPR Port Monitor and click Next
You will now have to wait whilst Windows 7 adds the required components (it can take a while).
Once the additional components have been loaded, click Finish.
The Unix LPR port will now be installed.
11 – Setup A New Printer – For Windows 7 Client PCs
I suggest leaving old printers unchanged and add a new printer.
You need to setup the Windows 7 machine to use its Windows driver. This will prepare the necessary print file on your client and spool it over the network to your FreeNAS print server.
On the Windows 7 PC select Start | Control Panel | Programs.
Step 1 – Add a new printer – Using the Local Printer option
Step 2 – Select a port
If you can’t add LPR – either you have already set this up and need to use the existing LPR with the required FreeNAS IP address, or you have missed the step to add the LPR facility from the Windows 7 system.
Step 3 – Setup LPR parameters – Inserting the FreeNAS network address and “lp”.
Now choose a pre-defined printer, or insert your manufacturer disk. Remembering this is the Windows driver you are adding.
Finally check the printer test page works correctly.
12 – Summary
The simplicity of FreeNAS remains intact and the boot sequence is completely automatic. You can turn this facility on or off by adding or removing the commands from FreeNAS.
It has the bonus of giving wireless printing capability if you have a wireless router in the setup.
Important Warnings
Remember to start the FreeNAS server before powering up your printer, or alternatively just turn the printer off and on to register the printer with the spooler daemon.
This note is collected from a number of sources. I have just refined these to hopefully provide a simplified guide.
Best Luck!