This tutorial covers connecting a Windows based printer, to Debian 6.00 - Squeeze, the latest Debian version that has been declared stable on 6th February 2011.
You can find the older version of this tutorial here, but this has been rewritten from scratch, as there are some significant differences, which are not very well known or documented at present.
To make it perfectly clear what this tutorial is all about; the printers are connected directly to a Windows XP computer and I want to give Squeeze access to those printers.
Why do it that way? Well in my case, I have some legacy programs that will only run on Windows that need direct printer access. Your reasons may differ.
Please read through the whole tutorial to get an overview, before attempting the printer configuration.
You must have samba installed and be able to access windows files through your network. This is pretty much self configured during the installation.
You must install separately; smbclient. This is the part that is not well documented or known. Squeeze will become a Windows client for the purposes of printing.
When you open cups (Common Unix Printing System) for the first time, if you don't have smbclient installed, you will not have the option to connect to a Windows based printer.
Throughout this procedure, you are changing the default configuration of your operating system. Nothing here should harm your system, but as you are making changes, each time you want to make those changes, you will be asked for your root (administrator) password. This is standard Linux practice and should not be viewed either as an inconvenience, or as something abnormal. If you opted for the sudo option during your initial installation, simply prefix any commands used in Squeeze, with sudo.
On some of the screen shots, I have edited certain information about my system that I consider could compromise it. That should not be seen as devious or suspicious. Simply good security practice. It should not interfere in any way with your understanding of the procedure.
So with that out of the way, let's begin.
Procedure common to both methods.
Open Synaptic and either search or scroll down to find smbclient
Tick the “Mark for installation box" and hit Apply.
Let the wonderful magic of Synaptic do its work.
There are now two methods to connect your printer. I've documented both and personally prefer the first, but the choice is yours.
Open your browser and in the address (URL) bar type:
(That's localhost a colon and 631 – all lower case with no spaces).
That will take you to the web based printer set-up pages for cups. Don't worry, it's all local on your own computer (hence localhost). Your not going to some unknown place on the Internet!
Next, under CUPS for Administrators, click on Adding Printers and Classes.
Now under Printers, click on Add Printer.
CUPS will now search for any printers it can find.
It did not find any printers for me, so I suspect it only searches locally. But that's just a guess.
When it gives up, you arrive here.
Click on and highlight the;
Windows Printer via SAMBA radio button and click on Continue.
You now have to enter the path to you printer. Notice cups has thoughtfully already preprinted the smb part for you.
This is where some confusion can arise and so I'm going to assume a mythical network, computer name and printer name as an example, to demonstrate how it's done.
For the example,
the network is called the traditional Workgroup
the computer is called Computer_Name
and the printer is called Printer_Name
You need to enter the full path to your printer, so in this example, it would look like this:
and here is a screen shot to demonstrate.
Notice, forward slashes (/) are use throughout and the double forward slash (//) is not a typo.
Just substitute your network, computer and printer names in the same format as above and click Continue.
Please make absolutely sure, you don't have any typo errors and that your printer name is exactly the same as it is in Windows. That is, the name it is registered in the system by, not it's description. I'm going to dwell on this for a moment, because it's vitally important to get it right.
Just for example, you may have a Cannon PIXMA iP4850, but, it may be registered on the system as iP4850. If you're not sure, you can find out by probing your Windows computer from a Linux root terminal.
To get to the terminal, go to Applications → Accessories → Root Terminal.
Again, you will need to enter your root password.
Once you have the terminal open and your Windows computer switched on, type this command in your terminal exactly as written (remember Linux is case sensitive):
smbclient -L [IP address]
You'll need to know the ip address of your Windows computer. If you don't, go to your Windows computer and to;
Start → Run, type cmd and hit OK.
A terminal will now open up in Windows and you should type this command:
and hit Enter.
Now look for IP Address and make a careful note of it including the full stops.
Most likely, it will be something like this:
Note, there is no full stop at the end.
So assuming the example address, the above command in your Squeeze terminal would become:
smbclient -L 192.168.0.1
Now if you take a look at the output, there is a section that lists the Sharename. This is what you need for your path.
Back to the procedure!
You will now be in a page that asks for a Name, Description and Location. Fill these in appropriately, but note the characters you can't use, including spaces.
Click on Continue.
Now you get to choose your printer. The first stage is to choose the manufacturer.
Click on Continue.
Now choose your model and highlight it.
Note, in this case, there is only one driver available for the printer, which makes life nice and simple. As I show in the second method, it is possible there are multiple drivers available for your particular model. If that is the case, all you can do is research your model on the Internet and find out which driver seems to be the most appropriate for you.
Click on Add Printer.
Providing your Windows machine and printer is switched on throughout this procedure (and I recommend you do that), you should now see your printer idle and waiting to accept jobs.
Note: Not Shared in this context means it's not shared from the Squeeze computer (in fact it's shared by Windows). This will not make any difference to you being able to print. So you can ignore it.
The final stage is to test you have everything set up properly. It wouldn't be the first time someone's printer is set to “legal” instead of “A4”.
So go to Maintenance and click on Print Test Page.
Providing all is well, you should get a correctly printed test page from your printer.
This is the end of method 1. If you're happy to use that, it is not necessary to read further. Method 2 is for those people that like to use the inbuilt applications to configure their printers.
The prerequisites are still necessary, so read the first part of this tutorial and make sure you have Windows shares working and smbclient installed.
This procedure uses a little application that essentially does exactly the same as cups. To access it, go to:
System → Administration → Printing
and you will get a little box appear like this.
Notice, the Epson printer is already there, as it's already been installed using method 1.
Common sense says, click on Add, but if you do, nothing will happen! What you need to do, is click on the little v to the right of Add and select Printer.
You will then be invited to submit your root password.
So enter your password and click on Authenticate.
Expand Network Printer by clicking on the little triangle
and select Windows Printer via SAMBA.
Fill in the path to your printer as described in method 1 and click on Forward.
Cups will now search for drivers.
If it can't find one, it invites you to Select printer from database.
Highlight your manufacturer and click on Forward.
In this next screen shot, I've purposefully selected a printer that has multiple drivers available for it. I touched on this in procedure one, but to repeat, all you can do is research the Internet for the appropriate driver for your own use.
Highlight the appropriate driver and click on Forward.
Fill in the required details as described in procedure one and click Apply.
Password again and click on Authenticate
Finally you get the opportunity to Print test page. I strongly advise you do that.
You are advised it's been submitted
and finally, a page appears with all the appropriate information you have submitted into the system.
The end result.
If at the end of all of this, your printer fails to print and you've checked both the Windows computer and printer is switched on, you have ink in the cartridges - in other words, all the obvious stuff, there is a strong probability you have something wrong in the path. So please recheck carefully all is as it should be.
Believe me, it's taken longer to write this tutorial than it takes to complete the process. smbclient is the key to success; don't overlook it.
CUPS is now an excellent platform for printers and has an extensive database of drivers. No longer is it hit and miss as to whether your printer will work. All but the most obscure will. It should also be noted, most of the major manufacturers now offer proprietary drivers for their printers and particularly if you have a multi-purpose printer, you may need to investigate their offerings. Clearly there are so many, it is outside the scope of this tutorial to cover such eventualities. But generally speaking, the included help files offer comprehensive instructions on how to install these drivers.