Cool Solution - Printing on a Thin Client
From Univention Wiki
- 1 Introduction
- 2 Thin client as a local print server
- 3 Printing locally from a remote print server
- 4 References
Univention Corporate Client (UCC) is a solution for the central operation and administration of PCs, Notebooks, Thin Clients or kiosk systems. A client is typically rolled out via images. A thin client image offers a minimal desktop for RDP and UCC sessions and the standard image provided by UCC does not have support for local printers.
The redirection of local printers on the client computer to a print server would allow printing jobs from other computers (eg. RDP server) to be printed on the thin client. This is useful in a Home Office environment for example.
Here is shown how to enable support for local printers on the thin client and manually configure printer redirection from a UCS print server.
Thin client as a local print server
The idea is to install a local printing server (CUPS) on the thin client, that would recognize printers that can then be shared with a remote printing server.
Getting CUPS into the thin client
The default thin-client image does not have support for local printers. So CUPS should be installed, configured (at least one local user must be allowed to add printers and share them) and set up as a local service. There are several ways to add CUPS into an image, these are some of them, next section shows how to install cups on an existing image:
- The image is already built, so it should be modified and reloaded to the client(s) (explained next).
- The client(s) can be rebooted with rw support, updated and set back to ro (See UCC Manual - UCC Persistent configuration and Overlayfs sections)
- A new image that includes the cups package can be rebuilt and rolled-out to the client(s) (by adding the package 'cups' to the list, see UCC Manual - Generation of adapted images)
Modification of the image
Follow the instruction in this article to open an existing image for modification.
Once installed, it will use around 50MB, so for the installation process, around 200MB free are needed.
~# apt-get -y --no-install-recommends install cups
dpkg will try to start the cups service after installation, showing errors. This is not a real problem in the chroot environment. The cups service should start properly once is rolled out and booted (the post-installation script invokes Upstart outside the chroot: UCS, which instead uses Init more here).
cups-bsd for XenApp
Install CUPS BSD commands to print from XenApp sessions.
Citrix Receiver uses the lpr command to print files. lpr is part of cups-bsd (a suggested package for cups)
~# apt-get -y --no-install-recommends install cups-bsd
A cups administrator
Grant a local user permissions to administer CUPS: (the local root account is also a CUPS administrator)
~# useradd -s /bin/false -G lpadmin cupsadmin ~# echo cupsadmin:Adm1n*pr1nt | chpasswd --crypt-method SHA512
Don't forget to run 'sync' to force a commit before 'exit'
Since the service is not running, we won't be able to use cupsctl within the chroot environment, instead we will edit the configuration file:
~# nano -w /mnt/img/etc/cups/cupsd.conf
To allow other to see local printers: Change Browsing to 'On' and add the following lines
# Show shared printers on the local network. Browsing On BrowseOrder allow,deny BrowseRemoteProtocols BrowseAddress @LOCAL BrowseLocalProtocols CUPS dnssd
To share printers to the local network or to other networks, go to '<Location />' and change Allow to '@LOCAL' or to 'all'
# Restrict access to the server... <Location /> Order allow,deny Allow all </Location>
and comment out the lines 'Order allow,deny' in <Location /admin> and <Location /admin/conf>
In nano, use Ctrl X to exit, answer "yes" to save and hit ENTER
Unmount the image, it can now be rolled-out to the thin client, and started again.
Printing locally from a remote print server
By now the thin client should have an updated image with a CUPS server. Please verify it by opening http://localhost:631 on the thin client. Steps to add a printer, share it with the network and use it from a remote print server are described next.
Plug in and set up a local print queue
CUPS is able to recognize and manage USB/LPT printers connected locally. To test it, please make sure your printer is turned on and plugged.
Go to Administration on the Web interface. CUPS will ask for an authorized username (cupsadmin) and its password (Adm1n*pr1nt).
Add a new printer
Under Printers click Add printer.
After that, your printer should appear under Local Printers:, please select it and click Continue
On the second prompt make sure you thick off the box for Sharing:  Share This Printer. Follow the prompts and choose the family of drivers for your printer. (See: CUPS documentation for further details).
Since it's shared with IPP, the local printer can now process printing jobs from other computers!
In order to save this configuration, the image must be saved with these new CUPS configuration files (mainly 'cupsd.conf' and 'printers.conf' in /etc/cups. See the UCC doc as well: UCC Persistently stored system settings)
Set up the remote server and send printing jobs
With a local printing queue accessible from the network, the UCS Master can set up the printer on the print server and share it from there. We can follow the instructions on UCS Creating a printer share.
We will need:
- The name of the printer you used on the thin client (here: hp-4960).
- The IP addresses or FQDN of both, print server (here: server1.example.qa) and thin client (here: thinclient04.example.qa)
- A name for the new UCS-shared printer (here: hp4960ex)
Basically, we are telling the UCS master server that server1.example.qa will share a printer that is on thinclient04.example.qa. Such queue exists as ipp://thinclient04.example.qa/printers/hp-4960 and is going to be available to the UCS network as hp4960ex