desktop-virtualization-community-VDI-UDS-EnterpriseJOIN OUR


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 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/ for security pourposes:

sudo cp /etc/xrdp/ /etc/xrdp/

Next step is setup to start our windowmanager:


if [ -r /etc/default/locale ]; then
  . /etc/default/locale


Note: Maybe is a symlink in your platform, if so, move this symlink to a backup and create a new 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 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 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:






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 ):



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:


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.

This article was last modified: June 28, 2016, 9:55 a.m.