CUPS-based print gateway for a terminal server based on MS WS 2008 R2 and its clients based on MS Win 2k / XP with printers connected to them
It will be interesting for you to familiarize yourself with this report if the picture of your LAN development fits the following description
- New MS Windows Server 2008 R2 terminal server replaces old Windows Server 2003 R2
- Client workstations on MS Windows 2000 or on MS Windows XP with printers connected to them, which are accessible through the Microsoft network, working normally both autonomously and when connecting to them from other clients, or when connecting to a terminal server based on Windows Server 2003 R2 via Microsoft Network
- Printers are old, maybe not even HP, for which there is no driver for MS WS 2008 R2
- Or the HP printer itself is supported by a universal driver, but the OS on the client machine is MS Windows 2000, i.e. does not imply installing it
- Either the HP printer and the OS of the client machine are compatible with the universal driver, and the problem of installing it would solve the problem of incompatibility with MS Windows Server 2008 R2, but on one of the client machines there is, for example, a virtual machine with an inherited system based on MS Windows 98, which also uses this printer, which also does not imply the installation of the HP Universal Printer Driver, as there is no implementation for Win98
- Obviously, not only you are printing to your printer, but also your roommates, i.e. a redirect with remote desktop client tools is not considered here; and not always, as practice shows, it works: both because of incompatible drivers, and because of the lack of knowledge of the applicability of the nuances of such highly specialized technologies as EasyPrint
- New clients appear on the network, based on Windows 7, who may not need access to a terminal server, but who will need to print over the network to such old printers
- It is assumed that even for such problem printers there are drivers in the CUPS system
- You, as a system administrator, are not afraid to use UNIX-like operating systems in everyday tasks, and have experience with them
Also, please agree that non-functional issues - for example, security issues - are not addressed here.
The practical need for this solution
Several instances of printing devices fell under some of the cases discussed in the report preamble. For example: one XEROX DocuPrint P8ex (client OS Windows XP) and two copies of the HP LaserJet 1005 (one connected to a client computer based on Windows 2000, the other based on Windows XP).
The route that the print job follows
- Application program on a Windows 2008 R2 server or on a Windows 7 workstation; IPP client
- GNU / Linux gateway with CUPS printing system and SAMBA client
- Win 2k / XP client workstation with a locally connected printer, which is accessed from the Microsoft network
Gateway idea
It occurred to me after reading [ 1 ] and looking for an alternative to installing GNU / Linux on client machines; probably also, subconsciously, the emergence of such an architecture was influenced by the acquaintance with the three-tier architecture of access to the database [ 2 ] and the search for options for using it as such and its analogies.
The very concept of a gateway does not quite fit this context, but only by analogy: according to [3, p.313]
“The gateway is a relay system that provides the interaction of two information networks.”More precisely, it would be called a virtual print gateway or otherwise; further, for brevity, this link of the route will be called simply a gateway.
The most interesting has already been stated, it is time to move on to the routine. The following is ...
Gateway Deployment Instructions Concept
- On the client machine with the address
192.168.a.b
there is a userprn_user
with a passwordsecret
- for printing via the Microsoft network, the printing subsystem is configured and works as it is in the Windows 2000 / XP / 2003 environment. We look at the name of the printer on the network: the printer’s context menu, the "Properties" item, the "Access" tab, the "Share:" fieldxerox
. % computername% of this client:UHost01
- we will need it, for example, to generate a meaningful name in the CUPS system; although, if it matches the DNS name inside the local zone, and resolving names into IP addresses works well in your farm, and the search inside the domain suffix of this zone is enabled, then it can probably be used as a replacement for the address192.168.a.b
later in the text . - Set up a print gateway
- System-wide work with the CUPS server
- The base part of the gateway. Looks like that
- Gateway hardware: old server system unit DELL PowerEdge 1400 2xCPU iP-III-800/1536 MB RAM / 18 GB HDD
- OS: Debian GNU / Linux 6.0 i386
- Gateway Address:
192.168.a.c
- Installing packages
If CUPS is not already installed, give a command to install it# aptitude install cups
...
0 packages updated, 52 new ones installed, 0 packages marked for deletion, and 0 packages not updated.
You need to get 26.7 MB of archives. After unpacking, 83.2 MB will be taken.
Want to continue? [Y / n /?] Y
...
See if CUPS is running# /etc/init.d/cups status
Status of Common Unix Printing System: cupsd is running.
As required, move on.
Also, the smbclient package is required on the system, as the output to the network printer will be via the SMB protocol, and this package has a backend for CUPS. - You need to make sure that CUPS is configured to accept tasks from outside.
Go to the admin panel, for example, like this:192.168.a.c:631/
click on the “Administration” tab, then in the “Server” - “Server Settings:” section, check the box “Allow printer sharing connected to this system ”and“ Allow printing from the Internet ”; if not, then click "Save", after clicking which we will be asked for a username and password, by default it is the username / password from our Linux system root account, i.e. from root.
- The base part of the gateway. Looks like that
- We connect the printer in CUPS
- The "Administration" tab, in the "Printers" section, click the "Add Printer" button
- In the section “Other network printers:”, select the value of the “Windows Printer via SAMBA” radio button and click “Continue”
- Section "Adding a Printer", In the field "Connection:" enter the value "
smb://prn_user:secret@192.168.a.b/xerox
" (hereinafter: enter the value without quotes) and click "Continue" - Further, we
fill in the fields in this way. Name: drive in "Uhost01_xerox
" - this will be the name of the printer in CUPS.
The following two fields are not so critical, their values should be invented by you for your convenience:
Description: "Xerox DocuPrint P8ex
"
Location: "1 этаж, комната 13, Парфюмерия, пользователь Сидорова А.И.
"
Connection: "smb://prn_user:secret@192.168.a.b/xerox
" (already hammered, displayed for reference)
"shared:" - "Allow sharing this printer" - here it is necessary to put a check mark
Press the button "Continue" - We select a printer driver with the same name as ours, if not, then the nearest one by name; this approach works in most cases
Create: “Xerox” - click “Continue”
Model: select “Xerox DocuPrint P8e Foomatic / hpijs-pcl5e (recommended) (black and white, duplex printing)” and click on the “Add Printer” button below - We get to the page "Set default settings for
Uhost01_xerox
" - here are various options for trays and paper size; I left everything as it is and clicked on “Save default settings” - A window will appear for a few seconds informing you that our printer uses the default settings.
- We get to the page of the newly added printer and give the command “Maintenance - print a test page”
- If the test page printed OK, then the printer is ready to work in CUPS, you can go further
- System-wide work with the CUPS server
- Configure MS WS 2008 R2 server or Windows 7 client
- Preset
- Turn on the Internet Printing Client
- For the case of Windows 7 OS , we
check: the Internet printing client must be enabled in the components: Start - Control Panel - Programs and components - in the window that appears, click on the inscription on the left “Turn Windows Components On or Off” in the tree: “Print and Document Services ”-“ Internet Printing Client ”- should be at the last daw; if not, then set. Click “OK” to confirm the changes made or “Cancel” if no changes have been made. - For the case of MS Windows Server 2008 R2,
this component is disabled by default [ 4 , Tuesday, March 15, 2011 1:49 AM], and I had to tinker with it to understand why the printer addition described in Section 3.2 does not work.
Start - Control Panel - Programs - Turning Windows components on or off
In the window that appears, select “Components” on the left, find the button with a green plus sign “Add components” and check the box next to “Internet Printing Client”, click “Next” “Install” .
- For the case of Windows 7 OS , we
- If the “Internet Printing Client” component was turned off and we turned it on, i.e. performed paragraph 3.1.1., then after that we restart the print server, for which at the command line:
> net stop spooler
> net start spooler - We change the settings for the proxy server.
All users of this printer must disable their proxies in the browser properties, or register an exception, i.e.192.168.a.c
or for its subnet as a whole, i.e. for192.168.a.*
.
- Turn on the Internet Printing Client
- Printer setup
This item is also done with administrator rights; initially, the printer will be available to all users.- Start - devices and printers
- Installing a printer (a wizard window appears)
- For MS Windows Server 2008 R2 there will be an additional step in which we click on "Add a local or network printer as administrator."
- Add a network, wireless or bluetooth printer
- Click “the desired printer is not in the list”
- The radio button should be in the position "Select a shared printer by name", next to it - the field where we drive "
192.168.a.c:631/printers/Uhost01_xerox
", click "Next" - If the contact with the printer is successful, the “Add Printer Wizard” will appear; if it is unsuccessful, an error message will appear. If the line indicated above opens in the browser, then there is a network connection, and we just forgot to install the Internet Printing Client and / or restart the spooler.
- Choose a printer: manufacturer "Generic", printers "MS Publisher Imagesetter". OK
- "You have successfully installed ...." - then everything is ok. click "Next"
- Click "Print a test page" to print a test page. “The test page was sent to the printer” - click “Close”. “Finish” - to close the wizard
- Preset
- Rejoice with users
Sources
- avz.org.ua/wp/2011/06/17/printing-to-cups-from-windows
- en.wikipedia.org/wiki/ Three-Link_architecture
- Yakubaitis E.A. Information networks and systems. Reference book. - M.: Finance and Statistics, 1996. - 386 pp., Ill.
- social.technet.microsoft.com/Forums/en-US/winserverprint/thread/8e6130df-acba-4a8c-b984-a455667e9e49