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 (i.e. the x2goprint command) has become a standard component of the x2goserver package (since May 2011).

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.

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"

FIXME! The x2goprint command (unfortuntely still) expects an entry in /etc/sudoers. You have to add the follwing line to your sudo system by issuing the visudo command (as root). Add this line to your sudo configuration:

x2goprint ALL=(ALL) NOPASSWD: /usr/bin/x2goprint

Using X2go Printing on a Centralized CUPS Server

If you would like to run your X2go server and the CUPS service on different machines, you'll need to generate a pair of SSH keys to faciliate communication between those two machines. Such a use case is very common if you run more than one X2go servers on your network.

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/.x2go/ssh/.x2goprint/

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/.x2go/ssh/.x2goprint/id_dsa

The public part of the key (/root/.x2go/ssh/.x2goprint/id_dsa.pub) needs to be added to the x2goprint user's authorized_keys file on each of your X2go servers. You can do this with your favourite editor. Please make sure, that you've chosen the right user and system:

x2goprint@x2goserver1:~$ cat id_dsa.pub >> ~/.ssh/authorized_keys
x2goprint@x2goserver2:~$ cat id_dsa.pub >> ~/.ssh/authorized_keys
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 reach the X2go servers by entering the following command:

$ ssh -i  /root/.x2go/ssh/.x2goprint/id_dsa x2goprint@x2goserver1
$ ssh -i  /root/.x2go/ssh/.x2goprint/id_dsa x2goprint@x2goserver2
etc.
wiki/advanced/multi-node/x2goserver-printing.1307452215.txt.gz · Last modified: 2013/03/08 13:31 (external edit)