How To: Configure Linux Client (Fedora 20) to Use Printer on Windows Server 2008 R2 Print Server

TABLE OF CONTENTS:

  1. BACKGROUND
  2. DIRECTIONS
    1. Basic Linux Client Configuration
    2. Configure Linux Client to Use LPD Protocol
    3. Configure Linux Client to Use IPP
  3. Printing a Test Page
  4. Wrapping Up

BACKGROUND:

This is the second post in this two post series, with the first covering how to configure the Windows Server 2008 R2 print server.  I will go over how to configure a Fedora 20 client, however most of what I do is applicable to other Linux distributions.  The printer I am using is a Canon Pixma MP620 with a share name, but you can use any printer that has Linux drivers available for it (can be configured by checking the manufacturers website, or following part of this guide).

As mentioned in the previous post, if you use IPP your credentials used to authenticate to the server will be stored in a text file on your Linux system.  There is a way to configure the Linux client so they are not stored there, however, if you choose this method then you will not be able to send test print jobs to the printer and you will not be able to print from the command line (ex: lp myFile.doc).  Also note that most if not all GUI programs will prompt you for credentials when you try to print; if you do not have the credentials saved then you must type in the correct credentials each time whereas if you had them saved then you could supply empty credentials and it will still print.

DIRECTIONS:

  • Note: Anywhere it says “serverName”, you should put either the DNS name of your server (ex: myPrintServer), or the IP address of the server (ex: 192.168.1.50)
  • Note: The share name I created for my printer is CanonMP620, whenever you see that name below, you should replace you configuration with the share name of your printer.

Basic Linux Client Configuration

  1. Verify the Cups service is installed and running
    • (on Fedora 20) $ sudo systemctl status cups.service

      Cups Status Output
      output of: sudo systemctl status cups.service
    • (on most other distributions and versions) $ sudo service cups status OR sudo service cupsd status
    • (alternatively) $ /etc/init.d/cups status OR /etc/init.d/cupsd status
  2. If you get a message saying it is stopped, then start the service
    • (on Fedora 20) $ sudo systemctl start cups.service
    • (on most other distributions and versions) $ sudo service cups start OR sudo service cupsd start
    • (alternatively) $ /etc/init.d/cups start OR /etc/init.d/cupsd start
  3. If you get a message saying the service is not found, then install cups:
    • (Fedora and most rpm based distros) $ sudo yum install cups
    • (OpenSuse) $ sudo zypper install cups
    • (Most Debian based distros) $ sudo apt-get install cups
  4. Verify that it is now running by performing step 1 above

Configure Linux Client to Use LPD Protocol

If you choose to use the LPD protocol (it is older than IPP but still works pretty well), then follow this portion of the guide, otherwise skip down to the “Configure Linux Client to Use IPP” section.

  1. Open a web browser (ex: Firefox) on your Linux client and go to http://localhost:631
  2. Click Administration
  3. Click Add Printer (If prompted for username and password, you can use “root” for username and the root user’s password)
  4. Select LPD/LPR Host or Printer, click Continue

    Selecting LPD Printer
    Selecting LPD/LPR Printer
  5. For “Connection” use lpd://serverName/PrinterShareName, then click Continue

    LPD Connection Name
    LPD Connection Name
  6. Fill in a name (required), and any other info (not necessary). Do not check “Share This Printer”, it is not necessary since it is already being shared from your print server (sharing it here would make it available so other computers could use your Linux client as a print server).
  7. Click Continue
  8. Either search for your printer driver based on the Make and Model list (select your Make, ex: Canon, click Continue, then select your model), or provide a PPD file (Linux printer driver file).
  9. Click Add Printer
  10. Edit preferences to your default liking, then click “Set Default Options”
  11. To verify printing works, go to the “Printing a Test Page” section

Configure Linux Client to Use IPP

  1. Open a web browser (ex: Firefox) on your Linux client and go to http://localhost:631
  2. Click Administration
  3. Click Add Printer (If prompted for username and password, you can use “root” for username and the root user’s password)
  4. Select “Internet Printing Protocol (https)”

    Select IPP Printer
    Select IPP Printer
  5. (saving credentials to a file) For “Connection” use https://username:password@serverName/printers/PrinterShareName/.printer
    Note: There is a typo in the picture below, the value for “Connection” should say “.printer” at the end, not “.priter”

    IPP Connection Name
    IPP Connection Name
  6. (not saving credentials to a file) For “Connection” use https://serverName/printers/PrinterShareName/.printer
  7. Fill in a name (required), and any other info (not necessary). Do not check “Share This Printer”, it is not necessary since it is already being shared from your print server (sharing it here would make it available so other computers could use your Linux client as a print server).
  8. Click Continue
  9. Either search for your printer driver based on the Make and Model list (select your Make, ex: Canon, click Continue, then select your model), or provide a PPD file (Linux printer driver file).
  10. Click Add Printer
  11. Edit preferences to your default liking, then click “Set Default Options”
  12. To verify printing works, go to the “Printing a Test Page” section

Printing a Test Page

  1. In the CUPS administration web site, Click Printers
  2. Click on the name of your Printer
  3. Click on the drop down where it says “Maintenance” and then Click on “Print Test Page”
    Dropdown Option to Print Test Page

Wrapping Up

Hopefully your test page printed successfully and everything is good to go.  If you’re having issues, have any questions, or have a comment to add to the post then leave it below!

How To: Configure Windows Server 2008 R2 Print Server for Use with Linux Clients

TABLE OF CONTENTS:

  1. BACKGROUND
  2. DIRECTIONS
    1. Install the “Print and Document Services” Role
    2. Install the Printer on the Server
    3. Share the Printer
    4. Configure Server for LPD
    5. Configure Server for IPP
  3. Wrapping Up

BACKGROUND:

At my house I have a Canon Pixma MP620 printer which has some Linux compatibility, but has always proven difficult to get it to work with my Linux computers.  The main issue is that this printer uses Canon’s BJNP protocol, which requires a special port to be created on the computer (usually during install of the Canon software & drivers) to be able to use the printer — the following link talks about BJNP a bit more, and some of its many woes: http://www.qwhatis.com/what-is-bjnp/.

Linux users might have some luck with installing the cups-bjnp package to get their BJNP printers to work, but I decided to go a different route. I already had a Windows Server 2008 R2 machine up and running, and I had never gotten a Linux client to print using the print server on my old Server 2008 machine, so I figured I would try to setup a print server on the Server 2008 R2 machine and have my Fedora desktop use that to print to the Canon printer.

This post is going to focus on setting up the Windows Server 2008 R2 print server, and the next post will focus on configuring my Fedora desktop to print to it.

DIRECTIONS:

 Install the “Print and Document Services” Role

  1. Open Server Manager: Start -> Administrative Tools -> Server Manager

    Server Manager
    Server Manager Screenshot
  2. Click Add Roles
  3. Select “Print and Document Services”, click Next
  4. Select the Role Services you would like to use.
    These are the printing protocols you would like to make available to your clients.  In my case, I selected both LPD Service and Internet Printing; I did not select the Distributed Scan Server, this requires extra install information.
  5. Click through the rest accepting defaults

Install the Printer on the Server

This process will differ from printer to printer.  For my printer, the Canon MP620, I had to download and install the Windows 7 64-bit driver package.

Share the Printer

  1. Open the “Print Management” mmc: Start -> Administrative Tools ->Print Management
  2. Under “Custom Filters” on the left, select “All Printers”
  3. Right-click on the printer you want to share and select “Manage Sharing”
  4. Check “Share this Printer”, and type in a share name (ex: CanonMP620)

    Sharing Printer
    Sharing a Printer on Server 2008 R2
  5. Click Apply, then click OK

Configure Server for LPD

At this point you are done on the server side if you are going to be using LPD as the printing protocol.  It might be a good idea to verify that the firewall on your server is allowing inbound traffic on TCP port 515.  The built-in Windows Firewall with Advanced Security automatically created the rule for me when I performed the install of the “Print and Document Services” role (see screen shot below)

LPD firewall rule
Automatically added firewall rule to allow LPD traffic

Configure Server for IPP

A few things to note here:

  • Windows creates an IPP website under the default IIS site, which usually listens on TCP port 80 and TCP port 443 (http and https) — verify your firewall allows inbound traffic on TCP 443.
  • The security on the IPP site requires authentication.  I suggest you keep this for security reasons; not just anyone can print to your printer.
  • The security on the IPP site requires that you use HTTPS, even though the site also listens on HTTP.  I also suggest keeping this for security reasons; someone sniffing your network traffic won’t be able to see the credentials you send to the server when printing.
  • I suggest you create a new user on the server with minimal privileges, since its username and password will be stored in a text file on the Linux client (In the Linux client setup I will also show an alternative way where the credentials aren’t stored)
  1. Open “Internet Information Services (IIS) Manager”: Start->Administrative Tools->Internet Information Services (IIS) Manager
  2. Expand “Sites”, expand “Default Web Site”, click on “Printers”

    ipp web site
    IPP Web Site
  3. In the middle pane, double-click “Authentication”
    Open_Authentication
  4. Edit the settings so only “Basic Authentication” is Enabled (if you didn’t want to require any authentication, then edit the settings so only “Anonymous Authentication” is Enabled)

    Only Basic Authentication
    Only Basic Authentication

Wrapping Up

At this point your server is configured and ready go.  If you are using IPP, then you should be able to browse to https://<serverName-or-IPaddress>/printers/ (if it asks for a username and password, use the username and password of the new user you created).  Now you can move on to configuring your Linux client.

If you have any questions or comments, leave them below!