Ubuntu as Home Print Server

Filed Under Linux | Comments (1) | Page Tools

I recently acquired a dead Dell 4700 desktop machine from my father. After replacing the power supply, adding some memory and a gigabit ethernet card, it was ready to go. I’d been thinking for some time of setting up a Linux-based home server for print sharing and backup. I installed Ubuntu 9.04 desktop and proceeded to configure the machine.

This article looks at how I configured the machine as a home print server, exploring the terminology and options for the un-initiated (like me).

Terminology and Options

Like anything to do with UNIX/Linux, there are dozens of ways to do anything and dozens of tools that seem to do the same (or similar tasks). There are also untold number of websites, blogs, wiki’s etc. telling you how to do stuff, some based on knowledge and many based on the “I did it this way and it worked so it must be right” approach. Many assume a fundamental level of knowledge that the newbie Linux person may not have.

So my humble attempt to give folks a starting point for a Linux server as a home printer sharing system is covered in the following sections.

What Software Do I Need To Do Print Sharing

There are two key pieces of software involved in Linux printing and printer sharing:

  • The Common UNIX Printing System (CUPS) is the default printing system for most Linux distros (distributions) such as by Ubuntu 9.04 system. It handles the printing to physical printers, manages the printer drivers and provides a web-based administrative interface. The Overview of CUPS page contains some great introductory information. CUPS supports network access to printers (more on this below).
  • The Samba package provides file and printer sharing from UNIX/Linux systems to Windows systems in a format that Windows can understand; the SMB/CIFS protocol that is represented as the “Microsoft Windows Network”.

So to print on a Linux machine you will normally use CUPS. To share the Linux-connected printer with a Windows machine, you can use CUPS or CUPS+SAMBA. This is described in the following section.

Remote Printing Options

The following figure shows the main components in a shared printer environment where the printer is attached to a Linux machine and shared to Windows machines.

printer_sharing

The physical printer is physically connected to the Linux server (on the left). The Linux server uses print queues to write to the printer. There are two types of queues needed for the printer:

  • A smart queue that will take the content from various Linux apps (like a word processor or web browser) and format it for the printer. This needs a Linux print driver to convert the content into a form the printer can consume and use. This queue is used by someone working directly on the Linux machine.
  • A raw queue that will take already formatted data and pass it directly to the printer for printing. This is used by the Windows machines as they have their own drivers for formatting content.

CUPS runs on the Linux machine and handles all requests to print; it effectively owns the physical printer. Samba can also run on the Linux system for sharing files and printers. It can also host a share (repository) of printer drivers that can be distributed to other machines (like Windows machines) to use. This means there are a number of options for sharing the Linux-attached printer with the Windows machines:

  1. Using Samba to share the printer as a Microsoft Network Printer:
    1. Without distributing the appropriate drivers to the Windows machine at printer setup, or
    2. Distributing the appropriate drivers to the Windows machine at printer setup.
  2. Using CUPS-only, where the printer is defined on Windows as an Internet Printer (IP) and accessed in CUPS directly using a web url.

Which option should you chose? If it’s a home network and you rarely add a new printer, then you don’t need the overhead of Samba. You are better off just using CUPS and when you define the printer on a new machine, load up the driver CD. If you’ve got a network where machines come and go often, then using the Samba driver sharing mechanism may be appropriate. I chose to go down the CUPS-only path. The remaining sections of this document describe the setup.

Page Tools

  • RSS
  • Email this Post
  • Print This Post

No related posts.

Comments

One Response

  1. I am new to Linux and was struggling to understand the documentation and the multitude of advice on the Internet. Your article gave me the light and just enough knowledge to get my print server working.

    Thank you

    Comment by Pierre at January 26th, 2010 at 8:41 pm

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.