ÚNASE A NUESTRA COMUNIDAD
PRUEBE NUESTRO SOFTWARE

Article in progress

There are a number of options provided by xrdp that are useful in most virtualized desktop environments, here we will describe how we setup them.

Configure basic Linux

First of all, we need to get the basic system up & running. This consists basically in your flavor of Linux installed according to your needs.

This, of course, includes selecting what window manager you will provide, what applications you will need, the security of the system (what users will have permissions to reboot computer for example), etc...

In this point, we recommend you to include in your "golden" linux machine some light window manager, such as xfce4, openbox, etc. Why?, well, your system will be provided to lots of users, some new and more "beautiful" windows managers. But those generally require many more resources than simples ones. They also tend to make more complex updates of the screen, increasing also the bandwidth consumed (in our experience, several times).

So here goes our firsts advices:

  • Upgrade your system before begining. (We had problems for example upgrading Ubuntu 12.04 right now), so, before start, make sure your system upgrades correctly to a curren version for your distribution.
  • Keep your system as light as possible
  • Keep in mind what it will be used for
  • Include & test your applications BEFORE going further (making the template and deploying it). Test before also XRDP connection, keyboard layout, etc.

Install XRDP

Once your system is up & running, we must install xrdp package. This will provide us with an X Windows running through an rdp session.

We will have here two options:

  • Install xrdp package(0.6.0 at the time of writing this article on Ubuntu 14.04 LTS)
  • Follow this process (will install X11rdp server, setup xrdp, etc..): X11Rdp

Note: XRDP does not come, for example, with support for Spanish keyboard. The file for supporting it is km-040a.ini , later we will return to this point.

Select your preferred window manager

xrdp-xfce.png
XRDP session with XFCE as Window Manager

After installing xrdp, we will need to setup the window manager that will be used by xrdp sessions.

For example, to install gnome-fallback (for unbutu 12.x), we will do:

sudo apt-get install gnome-session-fallback

We have two options here:

XRDP With same session for all users

For example, default unity window manager doesn't work for us (on ubuntu 14 even gnome fallback does not work correctly), we will select xfce in this tutorial, that is fast & light.

First of all, we must ensure that we have xfce installed, if not, do it now before proceding further.

sudo apt-get install xfce

Now, we will create firt a backup of /etc/xrdp/startwm.sh for security pourposes:

sudo cp /etc/xrdp/startwm.sh /etc/xrdp/startwm.sh.backup

Next step is setup startwm.sh to start our windowmanager:

1
2
3
4
5
6
7
8
#!/bin/sh

if [ -r /etc/default/locale ]; then
  . /etc/default/locale
  export LANG LANGUAGE
fi

/usr/bin/xfce4-session

Note: Maybe startwm.sh is a symlink in your platform, if so, move this symlink to a backup and create a new startwm.sh. If doing this, keep in mind execution permissions of the script.

The important part is that we forced xrdp to launch start xfce instead of any other window manager. This will be fixed for all users, no matter what session manager is configured, that is exactly what we are looking for in order to use this machine as a template for UDS.

For alternatives windows managers, you can change startxfce4 with one of the following, depending on the window manager you will want to start (remember to install first the window manager)

  • gnome-session (with posibble session=...)
  • openbox-session
  • xfce4-session
  • ....

If you found that session is not closing (rdp keeps open) after logout, this could be because your are not using the correct command to start the window manager. Xrdp expects that startwm.sh keeps running until session is closed, so be carefull with this and test your whole xrdp server before accepting it as UDS template for a virtual desktop.

XRDP with session at user's home directory (.xsession)

This method is straight forward if your platforn uses "Xsession" as startwm.sh. this can be in handy for you. This method is also less "error prone".

Simply create a file called .xsession in the home folder of the user that is going to login using xrdp, and include in it the session manager you will like, like this:

/home/user/.xsession:

xfce4-session

or

/home/user/.xsession

openbox-session

Keyboard support

At this point, if you need spanish keyboard support, is where the file km-040a.ini comes in handy. Simply copy it to /etc/xrdp and you will have spanish keyboard support.

Note here: If you want to FORCE spanish keyboard even if client requests english keyboard, yo must overwrite the file /etc/xrdp/km-0409.ini with the km-040a.ini file.

Install UDS Agent (currently available in .DEB for debian based distributions)

Install UDS XRDP Agent (Currently in development)

Advanced topics

Setting a single module with XRDP

To do this, first of all, make a backup of /etc/xrdp/xrdp.ini, and use the following code (as base, yo can get it here: xrdp.ini ):

[globals]
bitmap_cache=yes
bitmap_compression=yes
port=3389
crypt_level=low
channel_code=1
max_bpp=24

[xrdp1]
name=UDS
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
delay_ms=2000

Force the username to a fixed one

Simple change the line username=ask for username=[my forced username] in previous example

Issuses found with xrdp

First issue we will find is that every time we reconnect to remote session, xrdp gives us just a "clean session", and this is not desirable.

There seems to be a problem sometime withc vnc server and first connection attempt. To fix it, edit the xdrp config file and add a line to the xvnc-sesman sessiont as this:

delay_ms=2000

Always remember, maybe some windows managers will not work correctly for you, xfce is a good solution, and we strongly recommends it right now to avoid issues.

On ubuntu 14.04, we are not getting the session corretctly closed on logout. If we restart xrdp after boot from a console, the session starts to close correctly, but not before. We are working on this to try to find some fix. Follow this alternative method instead on this version: X11Rdp

Powered by django-wiki, an open source application under the GPLv3 license. Let knowledge be the cure.

Ultima modificación: 28 de Junio de 2016 a las 09:55