Tuesday, July 30, 2013

Use LPD to print to Windows shared printer from Linux

  1. Enable LPD Print Service on Windows
    • Go to Control Panel -> Add Remove Programs
    • Click Turn Windows Features On or Off
    • Expand Print and Document Services
    • Put a check in LPD Print Service
    • Click OK. Restart once you are told to
  2. Share printer on Windows
    • Right-click on the printer you want to share, click Printer Properties
    • Click the Sharing tab
    • Check Share This Printer and give it a name
    • Make sure the name has NO SPACES!
    • You can set security from the Security tab. In my situation, I just set it to let everyone print
    • Click OK to save and close

  1. Configure Linux
    • Ensure CUPS is installed
    • Visit the CUPS administration page in the browser (http://localhost:631)
    • Click Administration and then Add Printer
    • Under the Other Network Printers section, click LPD/LPR Host or Printer and click Continue
    • In Connection put: lpd://hostname_or_ip/PrinterName . In my situation it looks like lpd://192.168.79.130/LabelPrinter where 192.168.79.130 is the IP of my Windows machine, and the printer share name is LabelPrinter. Click Continue
    • Give the printer a name(remember the name), description and location. You can also share this printer from here as well. I did not do this in my situation because I will be printing directly from this Linux server to Windows. Click Continue
    • Next comes the driver portion. In my situation I used a ppd file, so if you have one of those you can pick it here. Otherwise you will have to pick a make and model of your printer. Click Add Printer.
    • You can set up some defaults for the printer here if you so desire.
  2. Test Print!
    • From linux I ran these 2 commands:
      echo “Hello” > test.txt
      lpr -P PrinterName test.txt
      (where PrinterName is the name we gave CUPS for our printer)
    • You should see a print come through that says Hello
This is a very basic configuration described here, but it should at least get you started.

No comments: