[Thinlinc-technical] Export DISPLAY into Thinlinc session

Bernd Dammann beda at dtu.dk
Thu Dec 3 08:20:20 CET 2015


On 02/12/15 15:53 , "Thinlinc-technical on behalf of Mattias Molin"
<thinlinc-technical-bounces at lists.cendio.se on behalf of
mattias.molin at ericsson.com> wrote:

>Hi all!
>
>I have searched through the documentation, all topics in the mailing
>list + searched the net for clues but I am not successful in finding
>what I want. I would appreciate some help to get me going in the right
>direction solving my problem.
>
>*** In short:
>
>I am having problems exporting DISPLAY from another machine into a start
>Thinlink session (using the official ThinLinc client).
>
>*** Problem description:
>
>In our solution we will run multiple servers hosting various kinds of
>software. These applications should be started locally but should be
>displayed within a ThinLinc Client session. In particular we will later
>use the HTML5 as the ThinLinc client but the HTML-client is not being
>used at the moment (until this problem is solved). For simplicity and to
>get some progress in solving the basic issues I am currently using
>xclock and xterm as example applications. These applications are not
>supposed to be used in the final solution - only for troubleshooting.
>
>*** Host overview:
>
>Guest1, with IP .91: This machine holds the binaries/applications. In
>this case currently xterm and xclock. This is where applications are
>started.
>Guest2, with IP .92: This machine has Cendio installed and acts as
>Master/Agent. This is where applications should display. Xclock or xterm
>are NOT installed in this host.
>
>Both Guest1 and B are currently running in VirtualBox with CentOS 6.5
>(limited) + Gnome desktop (hence all X deps exist) installed.
>
>*** Basic test (that works):
>
>I am logged into both hosts (Guest1 and Guest2) in a more "normal"
>manner - i.e. using the VirtualBox GUI.
>
>* Guest2 (192.168.0.92):
>
>[vagrant at guest2 ~ ]$ xhost +
>access control disabled, clients can connect from any host
>[vagrant at guest2 ~ ]$ env | grep DISPLAY
>DISPLAY=:0.0
>
>* Guest1 (192.168.0.91):
>
>[vagrant at guest1 ~ ]$ export DISPLAY="192.168.0.92:0"
>[vagrant at guest1 ~ ]$ xclock
>
>This basic test works fine. Xclock is started on Guest1 and shows up on
>Guest2 as expected.
>
>*** Extended test (that fails):
>
>I am logged into Guest1 using the VirtualBox GUI while connected to
>Guest2 via the ThinLinc Client.
>
>* Guest2 (192.168.0.92):
>
>[vagrant at guest2 ~ ]$ xhost +
>access control disabled, clients can connect from any host
>[vagrant at guest2 ~ ]$ env | grep DISPLAY
>DISPLAY=:1.0
>
>* Guest1 (192.168.0.91):
>
>[vagrant at guest1 ~ ]$ export DISPLAY="192.168.0.92:1"
>[vagrant at guest1 ~ ]$ xclock
>Error: Can't open display: 192.168.0.92:1
>[vagrant at guest1 ~ ]$ export DISPLAY="192.168.0.92:1.0"
>[vagrant at guest1 ~ ]$ xclock
>Error: Can't open display: 192.168.0.92:1.0
>
>This operation fails. I am sure I am missing the point somewhere or I
>need to do something with the Cendio server config. I just do not have a
>clue what to do to make this work. Any ideas? Any help or ideas are
>appreciated!
>

We have been using a setup like this for many, many years.  In fact, all
our applications run on dedicated nodes in a cluster, only the Xvnc and
the WindowManager are running on the ThinLinc nodes (vsmagent).  Here is
what you need to do:

0) this assumes, that your users have a shared homedir across all nodes!

1) in the vsmagent.hconf:

# The location of the Xauthority file, either homedir or sessiondir
xauthority_location=homedir



2) create a file called /opt/thinlinc/etc/xstartup.d/01-set-display.sh
with the following content:

#!/bin/bash
#
# action: make the DISPLAY include the hostname
#
HOSTNAME=`/bin/hostname`

if [ ${DISPLAY:0:1} == ":" ]; then
  DISPLAY=${HOSTNAME}${DISPLAY}
  export DISPLAY
fi


This will assure, that the DISPLAY contains the hostname of the vsmagent
host, and not just the display number.

3a) now it should work … ;-)

3b) our users access the application nodes via a transparent mechanism,
that starts the application on a dedicated node, with the display set to
the vsmagent.  This can be achieved in different ways, e.g.

vsmagent-host $ ssh -f client-node xterm -display $DISPLAY

In fact, we use a scheduler/resource-manager for that, where the submitted
job script contains the DISPLAY.

Let me know, if you need more details.

Regards,
Bernd
 
--
# Bernd Dammann           <beda at dtu.dk>  | "Why stop now,
# DTU Compute                            |       just when I am hating it?"
# Technical University of Denmark        |
# Richard Petersens Plads, Building 324  | phone: (+45) 45 25 33 71
# DK-2800 Kongens Lyngby, Denmark        | http://www.compute.dtu.dk/~beda/
   print unpack("u", "<22!K;F5W('1H870@>6]U)VQL(&1O('1H870A\"@``" );






More information about the Thinlinc-technical mailing list