User Tools

Site Tools


wiki:advanced:multi-node:x2goserver-printing

This is an old revision of the document!


Printing and X2go

If all your X2go servers, X2go clients and the available network printers are all on the same site (i.e. in the same office), then you will not need X2go printing. Configure your print server (mostly CUPS, Common Unix Printing System) to print directly to your office printers. Also make sure that your office printers are available to user's that logon to your X2go server (setting up CUPS printers is not an issue of X2go, please consult the CUPS howtos available on the internet).

Installing X2go Printing

:!: Before you begin!

Please make sure that you have added the X2go repository to your package management system. The required steps are described here: Debian, Ubuntu (depending on the distro that you have chosen for your X2go server).
X2go Printing is intended for
  • use on low bandwith networks – like internet connections or GSM connections
  • use of printers that are directly connected to X2go (thin-)clients

X2go Printing falls into two components:

  • cups-x2go – a CUPS backend that spools X2go print jobs
  • x2goprint – the X2go server-side printing component that accepts cups-x2go print jobs and processes them towards connected X2go clients

X2go server-side printing component (i.e. the x2goprint command) has become a standard component of the x2goserver package (since May 2011). Before that time it used to be an extra package.

For being able to use X2go printing, you'll need a running CUPS server. You can use your network's existing CUPS server or you can install a CUPS server on the same machine as the X2go server tools are running on.

The minimal X2go server + CUPS setup is: install x2goserver, cups, cups-x2go on the same machine. Printing should work out of the box. For local X2go printing (local means here: all processes take place on the same machine) no further system setup is needed.

Before Sep 2011 configuring sudo was needed for local X2go printing, since then setting up sudo is only needed if CUPS with cups-x2go and the X2go server package are installed on different machines.

By installing the X2go CUPS engine (package: cups-x2go) you add a »Virtual X2go Printer« backend to your CUPS server:

$ aptitude install cups-x2go

After the installation, you are able to add a new printer in CUPS, possibly named: »x2goprinter« (name is arbitrary). As printing device (i.e. backend) you should select the “Virtual X2go Printer” (vendor: »generic«, model: »Generic CUPS-X2GO Printer«).

You may configure further options by editing the file “/etc/cups/cups-x2go.conf” (the below code block shows the default set of options):

##
##  cups-x2go.conf -- CUPS Backend Configuration
##

## Server with x2go system
#x2goserver = local

## dsa key for user x2goprint
#printdsa = /root/.x2go/ssh/.x2goprint/id_dsa

## command to generate pdf files
#ps2pdf = /usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="%s.pdf" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f "%s"

## loglevel for cups-x2go, possible values: emerg, alert, crit, err, warn, notice, info, debug
#loglevel = notice

Using X2go Printing on a Centralized CUPS Server

If you would like to run your X2go server and the CUPS service on different machines (such a scenario is very common if you run more than one X2go servers on your network), you'll have to do things:

  1. generate a pair of SSH keys to faciliate communication between those two machines
  2. add a line to the /etc/sudoers file on every X2go server that shall be able to accept print jobs from the central CUPS server

Please make sure that you are logged in as user root on the system running the CUPS service and add the following folders:

$ mkdir -p /root/.ssh/

Now you can generate the keys (on each X2go server that shall have access to the CUPS service):

$ ssh-keygen -N "" -t dsa -f /root/.ssh/id_dsa-x2goprint

The public part of the key (/root/.ssh/id_dsa-x2goprint.pub) needs to be added to the x2goprint user's authorized_keys file on each of your X2go servers. You can use the ssh-copy-id command for that:

root@cupsserver:~$ ssh-copy-id /root.ssh/id_dsa-x2goprint x2goprint@x2goserver1
root@cupsserver:~$ ssh-copy-id /root.ssh/id_dsa-x2goprint x2goprint@x2goserver2
etc.

Every X2go server that uses X2go printing needs to be known by the CUPS server. Regarding your name resolution type, you'll need to add the host names for example to the local /etc/hosts file (your even better: use your local DNS server!!!). Please test if you are able to build up SSH connections from your CUPS server to your X2go servers by entering the following command:

root@cupsserver:~$ ssh -i  /root/.ssh/id_dsa-x2goprint x2goprint@x2goserver1
root@cupsserver:~$ ssh -i  /root/.ssh/id_dsa-x2goprint x2goprint@x2goserver2
etc.

At last, you have to add the following line to your /etc/sudoers file. Normally the command visudo is highly recommended for editing the sudoers file, as it performs sanity checks on the sudoers file and reports if you made a mistake while editing the file.

x2goprint ALL=(ALL) NOPASSWD: /usr/bin/x2goprint
wiki/advanced/multi-node/x2goserver-printing.1320753537.txt.gz · Last modified: 2013/03/08 13:31 (external edit)