How to Share Printers Between Multiple Windows and Linux Systems via LPD / LPR
History
- 1-14-2007: First version & revised.
- 1-16-2007: Miscellanea added; added LPD relay note for Windows.
- 2-2-2007: Found a bug in the CUPS-LPD part: changed "cups-lpd" to "printer" in the printer file and service names.
- 9-27-2007: Migrated to the wiki.
- 10-9-2007: Added Windows references.
Purpose
LPD is an older network-printing protocol developed for UNIX systems to share printers. As of 2007, support for it exists in Windows and Linux platforms, and can be quite usable in relaying print jobs over the Internet, or eschewing setting up Samba print shares. In Windows Terminal Services, it also appears to be more reliable than using IPP for relaying print jobs.
Enabling LPD sharing in Windows 2000 / XP / 2003
- Control Panel -> Add/Remove Programs -> Windows Components: make sure "Other File & Print Services" is checked. Install as needed.
- Check your firewall program to ensure port 515 is open on TCP & UDP. You may also have Windows Firewall active: make the change to it as needed.
- Right-click "My Computer" & left-click "manage." Then go to "Services" and find the "TCP/IP Print Server:" check its properties to "Automatic" and make sure its started.
- Share your printer as you normally would. The share name will become the "LPD queue name"
Printing and relaying LPD in Windows
- In the "Printers & Faxes" window, right-click and then left-click "Server Properties."
- Ports -> Add Port -> LPR port. Enter the IP/server name and the name of the LPD queue, then "OK."
- In the "Printers & Faxes" window, "Add a printer," using the "Local Port" option: pick the port you created in step 2.
- If you want to relay LPD jobs, you can share this printer and have other systems print to it as is done in steps 2 & 3 on those systems.
Enabling CUPS-LPD in Linux
Reference: CUPS installation primer from LinuxKongress
- I'm assuming you're using a version of Linux with CUPS for printing: most modern distributions have it. If you can, update it to the latest stable version noted on http://www.cups.org/ (you can search for an Ubuntu or RPM mirror and gather the required pieces).
- Install xinetd: on Debian/Ubuntu, try "sudo apt-get install xinetd"
- Make a file called "/etc/xinetd.d/printer" and put the following in it...
service printer
{
socket_type = stream
protocol = tcp
wait = no
user = lp
server = /usr/lib/cups/daemon/cups-lpd
server_args = -o document-format=application/octet-stream
flags = "IPv6"
}
- Restart xinetd: try "sudo /etc/init.d/xinet.d restart"
- Add the printer in CUPS via http://localhost:631. Your printer name will be your LPD queue name.
Printing to LPD in Linux
- Use http://localhost:631 to add an LPD print queue, using the format of lpd://<host name or IP>/<queue name>
Windows to Linux to Windows Again
- In this process, be mindful of differences in print resolution (DPI) and possible lack of color support if you cannot use the required drivers for your printer.
- On the Windows system that issues the print (aka terminal server session or remote system), use Postscript drivers from the printer manufacturer or Adobe. You can experiment to find PS drivers for your printer if ones aren't directly available: for example, the HP Laserjet 4/5/6 PS driver works well with newer Laserjet printers. CUPS seems to take in PS jobs and convert them as needed better than it does PCL.
- You can set the print driver in CUPS to whatever will successfully test print for your printer: prefer PS drivers over PCL for best results, but outputting as PCL if its hooked directly to the printer should work.
- The client Windows or Linux system can use whatever will successfully test print.
- If there is a problem with printouts, try changing the "Print Processor" on the Windows printer driver settings to "WinPrint" -> "RAW"
- The thing to remember in this process is to start the chain with PS instead of PCL print data, and then be able to pass that off to other printers successfully.
Miscellanea
- Lexmark banner pages: the Linux driver lets you turn them off, but the C510 at work wouldn't turn them off. However, if you edit the banner files for PS & PCL to be blank, the command on the driver to omit blank pages will force the page to never print.
Windows support links