TLWIR 49: RELIABLY Printing From GNU/Linux to a Windows 7 Printer

by Rex Djere on November 22, 2012 · 4 comments

in TLWIR

Post image for TLWIR 49: RELIABLY Printing From GNU/Linux to a Windows 7 Printer

2. Set Up Your Windows 7 Machine for Printing
Samba is a great tool for networking a GNU/Linux machine to a Windows machine. However, I have found LPD to be a much more reliable method of printing from GNU/Linux to Windows. LPD stands for Line Printer Daemon protocol. LPD is a network protocol that was designed specifically for printing from Unix (and hence GNU/Linux) machines. It is stable, reliable, and it has been around for a very long time. Fortunately, Windows 7 supports the LPD protocol! However, the support is turned off by default, so we have to turn it on. Once we do, the Windows 7 machine will listen for GNU/Linux print requests on TCP port 515.

To configure LPD to start every time you turn on your Windows 7 machine, here are the steps: Control Panel >> System and Security >> Administrative Tools >> Services. Clicking on the Services link should give you a pop-up similar to Figure 4 below. You will have to scroll down to LPD Service. When you right-click and click on Start, Windows 7 will automatically start the LPD Service every time Windows starts up.

Figure 4: Starting the LPD Service in Windows 7

Now, you will have to share the printer on your network. Again, this is extremely easy. You’ll go to Control Panel >> View devices and printer. You’ll right-click on your printer and select Printer properties. Go to the Sharing tab, check mark the Share this printer box, put a name in the Share name box, and hit Apply. I recommend that you make the printer share name something descriptive, but easy to remember. You will need to insert this name later on your GNU/Linux system. My printer is a Canon MP560, so I just chose mp560 for my share name. This would make the share easy to identify if I had multiple printers in the house.

Pages: 1 2 3 4 5

{ 4 comments }

Tim Chase November 23, 2012 at 1:01 pm

Rather than tell Windows to use a static IP address, I’d leave the Windows machine using DHCP and then configure your router to hand out a static IP address to your Windows box based on its MAC (hardware) address. You can find the MAC in the output of the “ipconfig” command in the line reading “Physical Address” where it should look something like “XX-XX-XX-XX-XX-XX”. This allows your Windows PC to move uneventfully to other networks and still get the right internal IP address when it reconnects to your home network. It also prevents your router from accidentally handing out the Windows box’s IP address to other DHCP clients.

Rex Djere November 23, 2012 at 3:05 pm

@Tim Chase, thank you very much for the astute comment. I’ve updated the article to reflect your recommendation.

SW November 23, 2012 at 3:30 pm

If you don’t want to use nmap, you could also use netcat (nc) for this. Chances are good it will already be installed.

nc -zv
You will see this if it succeeded:
Connection to port [tcp/http] succeeded!
and this if it failed:
nc: connect to port (tcp) failed: Connection refused

SW November 23, 2012 at 3:31 pm

You can ignore my first comment as the site didn’t like angle brackets. Here’s the correct one.

If you don’t want to use nmap, you could also use netcat (nc) for this. Chances are good it will already be installed.

nc -zv (host) (port)
You will see this if it succeeded:
Connection to (host) (port) port [tcp/http] succeeded!
and this if it failed:
nc: connect to (host) (port) port (tcp) failed: Connection refused

Previous post:

Next post: