Printing to a Windows share in Linux

Many people use Linux systems on Windows networks. Thus it is useful to be able to use a shared Windows printer for your output device. You have to work with Windows and with Linux to make this happen. First, you must verify that a Windows share is correctly installed and configured by testing it in Windows. Once that's taken care of, the remaining part of the setup is configuring the Linux client.

Open the /etc/printcap directory, create a directory for your printer at /var/spool/lpd/<printer name>/.config, and then enter the following:

# HP4MP
hp:
:sd=/var/spool/lpd/Epson:
:mx#0:
:sh:
:if=/var/spool/lpd/hp/filter:
:lp=/dev/null:

Once you have done this, check that any users you wish to print to the Windows share have access to your printer directory. Next enter the following into the. config file:

share='<servername>HP4MP
hostip=<print server IP#>

Go to the command prompt to enable the print share:
$ lpc up hp
$lpc enable hp

Finally, test your print share by sending it a file:
$ lpr <path>/<filename>


    Requires Free Membership to View

Barrie Sosinsky is president of consulting company Sosinsky and Associates (Medfield MA). He has written extensively on a variety of computer topics. His company specializes in custom software (database and Web related), training and technical documentation.


This was first published in November 2003

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.

    Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.