The Linux Print2Win mini-HOWTO

Marceloda Silva Email: marcelo@pereira.com Publication date: Jan 2002This howto contains the general configuration to get Linux printing to aWindows print share. This howto contains the general configuration to get Linux printing to a Windows print share.

Revision History:

||1.1||2002-07-19||ms||1.12002-07-19ms ||1.0||2002-01-01||ms||1.02002-01-01ms

Introduction

As we want the print service running, we'll set up all theenvironment step by step, to avoid mistakes or bad configurations. As we want the print service running, we'll set up all the environment step by step, to avoid mistakes or bad configurations.

First, set up the server; when you have the server running, configure the clients.

Server (Windows)

There is no special rules when configuring the server. Just install the printer driver in the Windows server, test it to verify that the printer is running properly, and share the printer.

Client (Linux)

The client configuration is similar to Linux to Linux printing.

Standard lpr

The simplest way to do it is to add an entry to/etc/printcap. As a quick example, the entryfor a generic matrix printer would be:# EPSON LX300 epson:\:sd=/var/spool/lpd/epson:\:mx#0:\:sh:\:if=/var/spool/lpd/epson/filter:\:lp=/dev/null: The simplest way to do it is to add an entry to

/etc/printcap . As a quick example, the entry for a generic matrix printer would be:

 # EPSON LX300 epson:\ :sd=/var/spool/lpd/epson:\ :mx#0:\ :sh:\ :if=/var/spool/lpd/epson/filter:\ :lp=/dev/null:  Be sure you have created the directory/var/spool/lpd/epson, and the users you wishto use the printer have the right access to this. Be sure you have created the directory

/var/spool/lpd/epson , and the users you wish to use the printer have the right access to this. For example, assume the Windows print server is named meriadoc, with an IP address of192.168.1.49, and the printer is shared fromWindows as epsonLX. For example, assume the Windows print server is named , with an IP address of , and the printer is shared from Windows as . So, you have to configure/var/spool/lpd/epson/.config like this:share='\\meriadoc\epsonLX'hostip=192.168.1.49 So, you have to configure

/var/spool/lpd/epson/.config

 share='\\meriadoc\epsonLX' hostip=192.168.1.49  Where:share='\\windows-print-server-name\print-share-name'hostip=windows-print-server-IP Where: share='\\windows-print-server-name\print-share-name'='\\\'hostip=windows-print-server-IP=Once your /etc/printcap is configured, youhave to enable the print share:[localhost]$lpc up epson[localhost]$lpc enable epson Once your /etc/printcap

have to enable the print share:

 [localhost]$lpc up epson[localhost]$lpc enable epson  If everything is ok, you can send jobs to the queue:[localhost]$lpr -Pepson file If everything is ok, you can send jobs to the queue:

 [localhost]$lpr -Pepson file 

/etc/printcap Tips

I have used the entry below in the first example, but this is not aparticularly good idea:...:lp=/dev/null:\ I have used the entry below in the first example, but this is not a particularly good idea:

 ... :lp=/dev/null:\  Because lpr does an exclusive open on the file you specify as lp=.It does this in order to prevent multiple processes from trying toprint to the same printer at the same time. Because lpr does an open on the file you specify as lp=. It does this in order to prevent multiple processes from trying to print to the same printer at the same time.

The side effect of this is that in your case, and can't print at the same time, (usually more or less transparent since they probably print quickly and since they queue you probably don't notice) but any other process that tries to write to

/dev/null

On a single user system, probably not a big problem. I have a system with over 50 printers. It would be a problem there.

The solution is to create a dummy printer for each. Eg: .

 [localhost]$touch /dev/eng[localhost]$touch /dev/colour 

License

This document, Print2Win-HOWTO,is copyrighted (c) 2001-2002 by Marcelo Pereira da Silva.Permission is granted to copy, distribute and/or modify thisdocument under the terms of the GNU Free Documentation License,Version 1.1 or any later version published by the Free SoftwareFoundation; with no Invariant Sections, with no Front-Cover Texts,and with no Back-Cover Texts. A copy of the licenseis available at . This document, Print2Win-HOWTO, is copyrighted (c) 2001-2002 by Marcelo Pereira da Silva. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at [http://www.gnu.org/copyleft/fdl.html ] .

Credits

Thanks to all those who sent opinions about this document, toeverybody who told me some printing tips, to Rick Bressler, and aspecial thanks to Harish Pillay, who wrote the first version of thisdocument. Thanks to all those who sent opinions about this document, to everybody who told me some printing tips, to Rick Bressler, and a special thanks to Harish Pillay, who wrote the first version of this document.

The_Linux_Print2Win_mini_HOWTO (last edited 2008-09-18 17:33:24 by SvetoslavChukov)