Difference between revisions of "Cool Solution - Printing on a Thin Client"

From Univention Wiki

Jump to: navigation, search
 
(17 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Cool Solutions Disclaimer|Repository=no|UCC=1.0}}
+
{{Version|UCC=1.0}}
 +
{{Cool Solutions Disclaimer|Repository=no}}
 +
{{Out of Maintenance}}
  
This article shows how to use a printer connected to an UCC thin client.
+
== Archive ==
  
We will see how to enable support for local printers on the thin client and manually configure printer redirection from an UCS print server, or for its use from a remote XenApp session.
+
There is a version of this article for [http://wiki.univention.com/index.php?title=Cool_Solution_-_Printing_on_a_Thin_Client&oldid=12468 UCC 1.0].
 
 
= Introduction =
 
Univention Corporate Client ([http://wiki.univention.de/index.php?title=Univention_Corporate_Client UCC]) is a solution for the central operation and administration of desktop PCs, notebooks, thin clients or kiosk systems. Clients are typically deployed (rolled out) via images. A thin client image offers a minimal desktop for remote sessions (e.g. RDP, Citrix XenApp or UCS).
 
 
 
Redirecting a printer 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 also useful in a Home Office environment for example.
 
 
 
= Thin client as a local print server =
 
The idea is to install a local printing server (CUPS) on the thin client. It will manage printers that can then be used from a remote session or shared with a remote printing server.
 
 
 
== Getting CUPS into the thin client ==
 
We will add support for local printers into the default thin-client image. 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 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 - [http://docs.univention.de/ucc-manual-1.0.html#rollout:persistent 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 - [http://docs.univention.de/ucc-manual-1.0.html#imagegen:chapter Generation of adapted images])
 
 
 
== Modification of the image  ==
 
In next examples we will install the needed extra packages into an existing image. Follow the instruction [http://wiki.univention.de/index.php?title=Modifying_an_UCC_image in this article] to open an existing image for modification.
 
 
 
=== Installation ===
 
 
 
CUPS will use around 50MB once installed, but for the installation process, around 200MB free are needed.
 
 
 
~# apt-get -y --force-yes --no-install-recommends install cups cups-bsd
 
 
 
* Note I: cups-bsd for XenApp. The previous command installs BSD commands as well, useful to print from XenApp sessions. Citrix Receiver uses the lpr command for remote jobs, which is part of cups-bsd (a suggested package).
 
 
 
* Note II: dpkg Errors. dpkg will try to start the cups service after installation, showing errors:
 
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
 
invoke-rc.d: initscript cups, action "start" failed.
 
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 [http://upstart.ubuntu.com/cookbook/#run-upstart-in-a-chroot-environment more here]).
 
 
 
=== Configuration ===
 
 
 
==== Add predefined printers ====
 
 
 
In case you know which printers will be available for the users you could simply add then into (/mnt/img)/etc/cups/printers.conf
 
 
 
You will need to know the details of your Printer. (i.e. add one entry for each printer) This is an example of a generic printer (raw queue):
 
 
 
<Printer GenericUSBPrinter>
 
Info Generic raw-queue printer
 
Location building B3-2
 
DeviceURI usb://<make>/<model>?serial=<number>
 
State Idle
 
StateTime 1396866947
 
Type 4
 
Accepting Yes
 
Shared Yes
 
JobSheets none none
 
QuotaPeriod 0
 
PageLimit 0
 
KLimit 0
 
OpPolicy default
 
ErrorPolicy retry-job
 
</Printer>
 
 
 
 
 
[https://forge.univention.org/bugzilla/attachment.cgi?id=5297 Here] is another example of a printers.conf for the same printer (this time using an HP driver "MakeModel HP DeskJet Series").
 
<make>: HP
 
<model>: Deskjet%206940%20series
 
<serial>:MY79OBS0FJ04Q9
 
* '''Hint:''' use lpinfo -v in a running system with the printer connected to find out these parameters for your printer.
 
 
 
==== Share printers ====
 
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
 
 
 
Here is an example of cups configuration file with the settings described in this article: [https://forge.univention.org/bugzilla/attachment.cgi?id=5299 cupsd.conf]
 
 
 
==== Create a local administrator ====
 
If you want to allow users to manage printers, 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
 
 
 
=== Close Image ===
 
 
 
* '''Note III: sync disks.''' Don't forget to run 'sync' to force a commit before leaving the chroot environment ('exit').
 
 
 
~# sync && exit
 
 
 
Unmount the image, it can now be rolled-out to the thin client, and restarted.
 
 
 
~# umount /mnt/img
 
 
 
<!--
 
== Notes ==
 
 
 
* It should be possible to set users from the domain to be locally in the 'lpadmin' group. This can be done by adding 'lpadmin' to the list of local groups in /etc/univention/templates/files/etc/security/group.conf This way any user can administer (add, modify, delete...) local printers through the Web interface of cups. it should look like this:
 
 
 
~# cat /etc/univention/templates/files/etc/security/group.conf
 
@%@UCRWARNING=# @%@
 
*;*;*;Al0000-2400;audio,cdrom,dialout,floppy,plugdev,lpadmin,adm
 
 
 
* It should also be possible to create a policy that adds the 'lpadmin' group to users in certain group like here http://wiki.univention.de/index.php?title=Ubuntu#Configuring_user_logins (I can create a lpadmin group with GID:111 and assign some users to it, but it wouldn't appear as extragroups when the user logs in. It may be because such small number 111 is not allowed as GID...)
 
 
 
* And to allow a specific group to administer local printers, a login policy can be used for such group (See UCS Manual - Policies).
 
-->
 
 
 
<!--== Update the clients image ==-->
 
 
 
= Configuration on a UCS 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 [http://localhost:631/admin '''Administration'''] on the Web interface. CUPS will ask for an authorized username (cupsadmin) and its password (Adm1n*pr1nt).
 
 
 
===Add a new printer manually===
 
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: [http://www.cups.org/documentation.php/doc-1.7/overview.html 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: [http://docs.univention.de/ucc-manual-1.0.html#rollout:persistent 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 [http://docs.univention.de/manual-3.1-1.html#print::shares UCS Creating a printer share].
 
 
 
{|
 
|-
 
| [[Image:Add-remote-queue.png|thumb|Add a new printer on a UCS Master]]
 
| [[Image:Print-remote-job.png|thumb|See the queue on a Print Server]]
 
|}
 
 
 
 
 
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''
 
 
 
= References =
 
 
 
*[http://wiki.univention.de/index.php?title=Univention_Corporate_Client UCC Wiki]
 
*[http://www.cups.org/documentation.php/overview.html CUPS Overview]
 
*[http://docs.univention.de/ucc-manual-1.0.html#imagegen:chapter UCC Generation of adapted images]
 
*[http://wiki.univention.de/index.php?title=Building_UCC_images More on UCC custom image generation]
 
*[http://wiki.univention.de/index.php?title=Modifying_an_UCC_image UCC Modifying an image]
 
*[http://docs.univention.de/ucc-manual-1.0.html#rollout:chapter UCC Management, roll out and updates]
 
*[http://docs.univention.de/manual-3.1-1.html#print::shares UCS Creating a printer share]
 
*[https://forge.univention.org/bugzilla/attachment.cgi?id=5297 Example printers.conf]
 
*[https://forge.univention.org/bugzilla/attachment.cgi?id=5299 Example cups.conf]
 
*[http://forum.univention.de/viewforum.php?f=65 Ask in the UCC forum]
 

Latest revision as of 11:23, 8 September 2017

Produktlogo UCC Version 1.0

Note: Cool Solutions are articles documenting additional functionality based on Univention products. Not all of the shown steps in the article are covered by Univention Support. For questions about your support coverage contact your contact person at Univention before you want to implement one of the shown steps.

Also regard the legal notes at Terms of Service.
Out of Maintenance


Archive

There is a version of this article for UCC 1.0.

Personal tools