This post shows how to setup a workstation for various Linux distributions.

This uses the lxc scripts described in this blog post: http://www.pokorra.de/2015/02/setting-up-a-server-hosting-several-containers-with-some-useful-lxc-scripts/

Inside a container, you can install an LXDE or XFCE desktop and X2Go server. If you route traffic to port 22 of the container, you can connect with the x2goclient to your workstation.

For Ubuntu 14.04:

apt-get install lxde-core
apt-get install software-properties-common
apt-add-repository ppa:x2go/stable
apt-get update
apt-get install x2goserver

For Fedora 20:

yum install @lxde-desktop google-droid-*-fonts
yum install x2goserver

For CentOS 7:

yum -y groupinstall "Xfce"
rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
yum install x2goserver
Tags: ,
Posted in Software Development | Comments Closed

My testing environment is a workstation running on a JiffyBox, using X2Go

Here are the steps that I use to setup my machine with OpenSUSE 12.3:

zypper install -t pattern kde4 kde4_basis findutils-locate

Install X2Go as described here:

zypper addrepo http://download.opensuse.org/repositories/X11:RemoteDesktop:x2go/openSUSE_12.3/X11:RemoteDesktop:x2go.repo
zypper refresh
zypper install x2goserver

Then I run these commands so that the login works with a password:

/etc/init.d/x2gocleansessions start
sed -i "s/PasswordAuthentication .*/PasswordAuthentication yes/g" /etc/ssh/sshd_config
/etc/init.d/sshd start
useradd myusername -m
passwd myusername

To install the latest MonoDevelop, follow these instructions:

zypper addrepo http://download.opensuse.org/repositories/home:tpokorra:mono/openSUSE_12.3/home:tpokorra:mono.repo
zypper refresh
zypper install monodevelop-opt

Now I had the problem that MonoDevelop did not start.

I tried everything:

. /opt/mono/env.sh
cd /opt/monodevelop/lib/monodevelop/bin
strace MONO_LOG_LEVEL=debug mono -O=-aot  MonoDevelop.exe

but no error message that I would understand.

Then I tried running monodoc, and this finally gave an error that I could understand:

The program 'browser' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadValue (integer parameter out of range for operation)'.
  (Details: serial 131 error_code 2 request_code 25 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

This lead me to this bug report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=386955 which mentions X2Go. At the end of that bug, it says that a specific version of Cairo does not support old XRenderers anymore. It has been fixed in version http://www.cairographics.org/news/cairo-1.12.10/

To build and install that version of Cairo, I followed these steps:

wget http://www.cairographics.org/releases/cairo-1.12.16.tar.xz
tar xf cairo-1.12.16.tar.xz
cd cairo-1.12.16
zypper install gcc libpng-devel libpixman-1-0-devel make libX11-devel libXrender-devel libXext-devel libXt-devel fontconfig-devel
./configure --prefix=/usr --enable-xlib
make
make install

Now MonoDevelop and monodoc start fine on OpenSUSE over a remote connection via X2Go.

Tags: , ,
Posted in Software Development | Comments Closed

I am providing now a server for development of OpenPetra, with X2Go desktop remoting.
See more details at https://sourceforge.net/apps/mediawiki/openpetraorg/index.php?title=Hosted_development_workstation

To save costs, I am running the server on a jiffybox, which costs less when you freeze it.

So I am providing a php script that allows starting the machine, and to refresh it. After the last start or refresh, the machine will be stopped and frozen.

Now it would be good to remind the users once in an hour to do visit the refresh link.
I am using zenity to display the message.
This script will get all users logged in over X2Go, and display the message on their desktops:

1
2
3
4
5
6
7
8
message="Server will shutdown soon, please refresh if you still need it by visiting http://jb.solidcharity.com"
wall $message
for display in `ps xaf | grep x2goagent | grep -v grep | awk '{ print ( $(NF) ) }'`
do
  user=`ps xaf | grep x2goagent | grep -v grep | grep "$display$" | awk ' { print ( $(NF-5) ) }' | awk ' { print ( $3 ) }' FS='/'`
  echo "$user $display"
  su - $user -c "zenity --info --display=$display --text='$message'&"
done

(for better layout, see https://gist.github.com/tpokorra/5984248#file-zenity-sh)

The crontab looks like this, to run it every hour:
0 */1 * * * /root/zenity.sh

The php script looks like this:

see https://gist.github.com/tpokorra/5984248#file-_jiffybox-php
The script is installed on a separate machine, that is always running.
The users can call jiffybox.php/?operation=refresh to start or refresh the machine.
The cronjob for stopping the machine looks like this:
*/15 * * * * cd ~/subs/jb; php jiffybox.php


Tags: , ,
Posted in Software Development | Comments Closed

For OpenPetra, we want to provide a preconfigured Linux machine, so that interested developers can have a quick start, and don’t need to spend so much time on installing a development environment.

I looked at FreeNX, NeatX, OpenNX, and X2Go.
NeatX does not seem to be continued.

FreeNX with OpenNX works, but I had problems with the sound.
To install FreeNX on Ubuntu Oneiric, follow the instructions at Ubuntu Forums. This avoids the problem with esound and libesd0 packages.


Finally, I have to say that X2Go works best for me. Sound is played, and access from Windows and Linux works fine to my Linux Remote Desktop.


To install the X2Go server on Ubuntu Oneiric:

 apt-add-repository ppa:x2go/stable
 add universe to /etc/apt/sources.list
 apt-get update
 apt-get install x2goserver

You get the client from http://code.x2go.org/releases/binary-win32/x2goclient/


One thing I had problems with: there was a blank or black screen, after logging in.
To debug this: I searched the log files, but could not find any clues. Then I remembered this: use the terminal as login shell, which works. There you can start your desktop manager, in my case /usr/bin/startlxde.
The error that came up was: missing libNX_Xext.so.6
I then found on the mailing list a discussion: http://www.mail-archive.com/x2go-dev@lists.berlios.de/msg03254.html
So I added the line 

 LD_LIBRARY_PATH=/usr/lib/nx/X11



at the top of /usr/bin/startlxde, and everything works now.


I also installed libjpeg-turbo, which should make the remote desktop even faster:

wget 'http://sourceforge.net/projects/libjpeg-turbo/files/1.2.0/libjpeg-turbo_1.2.0_i386.deb/download' -O libjpeg-turbo_1.2.0_i386.deb
dpkg -i ...
rm /usr/lib/i386-linux-gnu/libjpeg.so.62
ln -s /opt/libjpeg-turbo/lib/libjpeg.so.62.0.0 /usr/lib/i386-linux-gnu/libjpeg.so.62



One useful key combination is ctrl alt t, which allows you to terminate or to suspend the current session.
It seems ctrl alt k does not work with X2Go, which would allow the task switching with Alt Tab to be inside the Linux workstation.
The shortcuts available from NoMachine are listed here: http://www.nomachine.com/ar/view.php?ar_id=AR03C00172


By the way, I got X2Go work fine on virtual machines running on VMWare ESXi, and also on OpenVZ.