The usual way printing works on Linux is by connecting your printer directly to your system, or printing through IPP. But what if you need to print to a printer connected to a Windows system?
Here is how to get it working while keeping fuss to a minimum. Once again, these instructions are made with Debian Squeeze in mind, so adjust them if you’re using a different distribution. I used Windows XP but I believe these instructions should also work for Vista and Windows 7.
- In Windows, make sure the printer is shared.
- In GNOME go to System/Administration/Printing. On the menu bar go to Server/New/Printer. You’ll probably have to provide your root password to continue.
- Click “Network Printer”, then select “Windows Printer via SAMBA.”
- On the right pane you’ll see a textbox to enter the address for the printer itself. Click Forward.
- It is likely CUPS already has a working driver for your printer, so look for it on the list of drivers. If you want to provide a PPD file or look for another driver, you can also do that.
- Assign a printer name, description, and location. You may have to re-enter your root password to save all settings.
- Print a test page.
Make note of the printer’s share name and the system’s hostname, viewable in System Properties (right-click the My Computer icon).
# aptitude install smbclient
You have to enter both the Windows hostname and the printer’s share name, so you’d type something like
mywindowspc/myprinter. Make sure you get the case right.
In my own case there were three available drivers for the printer, so I went with the one marked “recommended” by the wizard.
That should do the trick. If it doesn’t work you can try using another print driver. If that still doesn’t work, try looking for a Linux driver for your printer.