Printer Sharing: Windows Print Server for Suse/openSUSE Linux Clients

Simply put: it's about printing to a Windows computer from a Linux computer using Either Samba's SMB/CIFS Protocol or LPD Printing.

Versions: Suse / openSUSE 11.x clients with Windows XP, Vista or Win 7 servers

In this tutorial you share a printer on a Windows host as a print server for Linux clients using Samba networking. We will discuss two independent, alternative options, namely LPD protocol and SMB (Samba) protocol. This HowTo assumes CUPS is used for printing. Samba of course is installed and running.

The reverse scenario where you share a printer on a Linux host as a print server for Linux clients is covered in two other tutorials: Linux IPP Printer Sharing and Linux Samba Printer Sharing.

Fixed IP address or DHCP Addressing? Your print server can have either a fixed or a dynamic (DHCP) IP address. Dynamic addresses are the Suse do-nothing default. Fixed addressing is the Administrator's choice for Linux servers because it's easier to administer. Tip: there's a reason why fixed IP addressing is widely recommended for servers. Here's a tutorial on configuring addressing both ways: HowTo Configure a NIC in Suse/openSUSE.

Setting up the Windows print server.

Share the printer: In this example I have a Canon BJ200 printer shared as CanonBubicon. To share a printer do this: Start --> Printers & Faxes --> R-click printer icon --> Sharing --> Share this printer --> Type in your choice for share name. I chose CanonBub for this example. Note there are NO SPACES.

Record your server's network address: You also want the Windows network address which you can get from a dos prompt available at Start --> All Programs --> Accessories --> Command Prompt. In the command prompt enter "ipconfig/all". You'll see the IP address for the ethernet adapter, 192.168.2.4 and the network (netBIOS) name DragaXP in this example.icon You'll need IP if using fixed addressing or netBIOS name if using dynamic addressing.

Windows LPD Server: Enable Windows support for Unix printing. Note: this is for the LPD option only. It's unnecessary if you've opted for Samba printing. Here is the XP sequence. Vista is quite similar: Open Control Panel --> Add or remove programs --> Add/remove windows components. Scroll down to "Other Network File & Print Services".iconHighlight that and select "details". Put a check mark in "Print Services for Unix" and OK/Next or whatever.

Now that Unix services are installed, you activate them as a service: Open Control Panel --> Administrative Tools --> Services (Local) and findiconTCP/IP print server. It should be set to "Status= started" and "Start type=Automatic". To change settings you double Lclick the line "TCP/IP print server" and adjust appropriately.icon

Update for Vista and Windows 7: Go to Control Panel --> Programs and Features --> Turn Windows features on or off --> Print and Document Services --> LPD Print service (enable it). Now check that the service is running: go to Control Panel --> Administrative tools --> Services --> LPD Service. It should be set to "Started" and "Automatic".

OK, now you have a windows workstation sharing a Windows printer to Linux clients. The next segments show HowTo set up the Linux client to print to this Windows print server, using two alternative network protocols.

Authority to change CUPS: When you attempt to make changes in the CUPS admin GUI (which is at http://localhost:631 -- click to see) you'll be asked for a username/password pair. Simply use the root credentials.

Setting up a Linux client to print using LPD protocol (alternative to Samba)

Note: the client does NOT use or need Samba for LPD. Open Cups Admin's GUI by entering this address in your browser (or click this link): http://localhost:631 where you can review the existing situation.icon. The GUI differs across the various Suse releases. Find the "add Printer" function, click and fill in a useful name and optionally a location & description.icon

"Continue" on and select "LPD/LPR Host or Printer" as the device type for your CanonBub printericon. Then "continue" and fill in the URI. The server address is DragaXP for dynamic addressing and 192.168.2.4 for fixed addressing - and the exact shared name for the printer on the server is CanonBub. So for dynamic (DHCP) addressing use this address --> lpd://DragaXP/CanonBub and for fixed addressing use this --> lpd://192.168.2.4/CanonBub. Next select the modeliconand the printer driver.iconFinally, you can set the default printer and test the connectivity to the Windows server. You should now be printing from Linux_To_Windows via LPDicon

That's all for the cups network client on Linux folks. It's really very easy but ONLY if you know how first.

Setting up a Linux client using Samba's SMB/CIFS Protocol (alternative to LPD)

Check that Samba has been configured for cups printing. The [global] entry will contain at least these lines if it has been configured for cups printing.

[global]
printing = cups
printcap name = cups

Open cups admin on http://localhost:631 and execute these steps:

  • Open Printers and Add Printer
  • Enter the exact name you used when you shared the printer: CanonBub. You can fill in the optional Location and Description to suit.
  • In Device type choose Windows Printer via SAMBA from the drop-down list
  • Fixed IP: In Device URI enter smb://workgroup/username:password@192.168.2.4/CanonBub, where "username", "password" and "workgroup" are real and give access to the server.
  • Dynamic IP: In Device URI enter smb://workgroup/username:password@DragaXP/CanonBub, where "username", "password" and "workgroup" are real and give access to the server.
  • Note: If no username/password authentication is needed on the Windows server, use these variations: smb://workgroup/192.168.2.4/CanonBub or smb://workgroup/DragaXP/CanonBub
  • Choose the printer driver from the cups database on the final screens
  • Execute a Print Test Page and you should be printing from Linux_To_Windows via Samba

OK folks that's it for the Samba client on Linux and for this Tutorial.

Hope this Tutorial makes life a bit easier for you.

Swerdna: 31 December 2006; last updated 27 May 2010