Sharing Printers via CUPS

From Info Wiki
Revision as of 06:09, 28 July 2012 by Lpb (talk | contribs) (Initial page copied from TIP Wiki)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Overview

CUPS is the printing sub-system which is generally used in Unix-like OS (Linux, Mac OSX etc).

One feature of CUPS which can frequently be useful is its ability to print to a network/shared printer when the computer from which the print job is created has no relevant printer drivers installed. Three examples:

  • a laptop/netbook computer being used away from its home location
  • an OS for which a suitable printer driver can't be obtained eg Windows 7
  • a computer where the administrator password (which may be required to install drivers) is unknown.

Limitations with Windows OS

CUPS is not universally available for Windows and its use can be more complicated in that environment:

Windows 7

This section requires input from an experienced Windows 7 user

  • CUPS, per se, is not apparently available
    • the underlying protocol IPP is available, (but not necessarily installled) for editions other than "Starter"
    • it prints via the Internet, which may not meet a user's security requirements

Windows XP

  • requires 3rd party software, which wont be installed by default
  • installing CUPS on Windows XP is complicated
  • when installed, it can work only with Postscript capable printers (this excludes most ink-jets and many low cost laser printers)
    • this limitation may also apply to Windows 7

networks having mixed Windows and Unix-like OS will additionally require SAMBA software, on the Unix-like side, to cope with the different network used in Windows. Use of SAMBA is not covered here

Mac OS

Apple's implementation of CUPS includes some proprietary extensions. That is unlikely to effect Mac to Mac printing but may introduce limitations in printing between Mac OS and other Unix like OS.

Situation

This guide assumes that CUPS is installed and generally functioning on both computers. The screen shots are from CUPS version 1.4.x. Versions 1.3.x provide the functionality required but have different menus.

Prerequisites

Definitions

  • "client computer" means the computer from which the print job will be generated
  • it must have CUPS client installed, which is the default condition for Max OSX and Linux
  • it need not have any printer drivers installed
    • indeed, it is less confusing if it does not
  • "server computer" means the computer controlling the printer. It can be:
  • for network printers, which are connected directly to the LAN, any computer having the relevant CUPS print drivers installed
    • it is perfectly acceptable to configure several computers to use a particular network printer
  • for USB/parallel attached printers, the computer to which the printer is attached
  • it must have CUPS server installed, which is the default condition for Max OSX and Linux
  • the relevant printer must appear in its "Printers" list, and be working.


Cups printers listing.png


Configuration

CUPS is configured via a web browser. Its URL on the local computer is:

http://localhost:631

Windows might not implement the short-cut "localhost". If not, then substitute the real IP address of the PC. Execute "IPCONFIG" from a Windows command line to find this address.

From the server computer, in the CUPS "administration" tab, ensure that "Share printers connected to this system" is checked:


Cups admin home.png


then click "Change Settings" button to save any changes, if necessary

Then click on the "Manage Printers" button in the same tab, select the relevant printer and pull down the "Administration" menu

  1. select "modify printer" then click the "continue" button to proceed to its second screen


Cups printer network.png


Cups printer configuration2.png


  1. ensure that "share this printer" is checked
  2. it will be helpful to make the "Location" the name of the computer controlling this printer
  3. click "continue" until the process completes

From the client computer, in the CUPS "administration" tab, ensure that "Show printers shared by other systems" is checked


Cups admin home.png


then click "Change Settings" button to save any changes, if necessary

Quicktest

Both computers must be connecting to the local LAN via wired or wireless interface. A quick test is to start a web browser and check that the Internet is accessible. Provided that network access is working:

  1. Start a text editor (kate, leafpad etc)
  • if the application is already running then it may need to be shutdown and restarted to recognize newly available printers
  1. Open a new document and type a few words
  2. From the file menu, select "Print"
  3. Select the relevant printer from the drop-down dialog
  • which should list all shared printers on the LAN
  1. click on the properties/settings button
  2. ensure that the key settings are suitable eg A4 paper size, portrait orientation
  3. click OK/print

Preliminary Troubleshooting

1. No printers listed in the print dialog

This problem frequently is the result of a firewall running on one or both computers. Network printing can work only if either:

  • firewalls on each computer allow port 631 through or
  • Ethernet zones are set as "trusted/internal" in the firewalls on each computer

Only printers powered up will appear in the list

  • confirm that the relevant printer is powered on
  • if it is attached to another PC via parallel or USB cable then that PC must also be powered on
    • (it is not necessary to log in to the sharing PC)

2. Print Job accepted but no output on Printer

This can be a result of many possible causes. Some simple checks:

  1. is CUPS known to be installed and working on the computer from which the text was created ?.
  2. Can it print to some printer at its home base ?
  3. does a similar print job created on the server computer give output on the printer ?

3. Print Job rejected by Server

  • as of late 2011 this can be a transitional issue. Earlier releases of CUPS expected the job to be transferred as a PS (postscript) file. Macs now transfer it as a PDF file, which provides much greater functionality and Linux is following suit, but not all Linuxes have yet migrated. Servers will accept only the file type for which they are compiled.
    • for maximum interoperability, use a distribution which does accept print jobs in the form of PDF files on the server.
    • Current releases of Fedora, openSUSE & Ubuntu already do.
    • a new version of the driver for each printer is required at the server end, to support PDF print jobs
      • if a binary driver, from the manufacturer, was previously used, check whether an open source driver is now available or, failing that, whether an updated driver can be obtained from the manufacturer.

If all else fails, then the CUPS Administration page has a button "View Error Log". Text towards the end of that file may give some clues.

--Rpeters 04:26, 21 April 2012 (UTC) --