XRDP – How to Install XRDP on Ubuntu 16.10 – The easy way !

Hello World

In our previous post, we have provided a quick overview of the small changes that Ubuntu 16.10 have been introduced and the way it might possibly impact the usage of the xRDP package.  We have seen that the VNC Server capabilities does not seem to work as expected and that a new xrdp package version is available in the repository.  

To have xRDP solution working on Ubuntu Distribution, we have two installation options : 

  • using the common approach where an alternate desktop will be installed (in our case, it would be Mate-Desktop)
  • using new approach and try to connect to Unity Desktop directly within the remote session

This post will describe the most common approach that has been used within the last years in order to have xRDP installed and working on Ubuntu systems.  The common approach is to install an alternate desktop.  In our next post, we will (try) describe how to perform the xRDP installation in order to use the Unity Desktop interface natively…

If you are ready, let’s see if the installation and usage process has changed a lot or not for Ubuntu 16.10....

Standard XRDP installation on Ubuntu 16.10


For this post, we have make some assumptions.

  • Ubuntu 16.10 (Final Release version) is used
  • Installation is performed on fresh new install
  • The Mate-desktop will be installed on the machine (as alternative desktop environment)
  • We will configure our system to match on localized version (i.e. we are using a Belgian french keyboard)
  • No additional configuration is needed to reconnect to the same session if you are using the latest version of the xrdp package found in the Ubuntu Repository

Installation Process 

Step 1 – Install XRDP Package from Ubuntu Repository

A standard installation for us means that we will be using the xrdp package available within the Ubuntu repository. To install the xrdp software from Ubuntu repository, you will need to issue the following command in a terminal.

sudo apt-get install xrdp -y 

Because of the sudo command, you will be prompted for a password. After entering your password, your xrdp installation will start. Wait for completion 


Click on Picture for Better Resolution

Based on our previous post, by running the command, we can check the version of the xrdp package

xrdp -v

We can see that indeed the xRDP package version available in Ubuntu 16.10 is the version 0.9.0 which replace the version 0.6.x


Click on Picture for Better Resolution

In the past, when installing the xrdp package (version 0.6-x), the vnc4server software was installed as well.  With this new package, if you check for any vncserver running, we can see that none of them are present or installed on the system.


Click on Picture for Better Resolution

Step 2 – Install an alternative Desktop 

At this stage of the installation, you can try to perform a remote connection to your Ubuntu machine.  Two things might happen : either you are disconnected after a few seconds or you will see a grey or black screen displayed. The workaround to this problem is to install an alternate Desktop that will be used during the remote session. 

Note : 

In this post, we have demonstrated that with Ubuntu 16.04, it is possible to perform a remote session against the Unity Desktop directly.   In a coming post, we will see if this is still an option….

Our preferred desktop alternative is Mate-Desktop.  This post will show you how to install the Mate-Desktop and have it working with the xrdp software solution. To install the Mate-desktop, issue the following command from the Terminal Session

sudo apt-get update

sudo apt-get install mate-core mate-desktop-environment mate-notification-daemon


Note :

Desktop interface such as XFCE, LXDE,LXQT, KDE, Gnome Classic  are all potential candidates. Installation of such candidates have been describes in our previous posts. 


Step 3 – Configuring xRDP to use your desktop environment

At this stage, we need to configure our system in order to tell xrdp that an alternate desktop needs to be used.  In our case, we have to tell xrdp that we want to use Mate-Desktop as alternate desktop. In order to configure this settings for all users on the system, we will need to modify the following file /etc/xrdp/startwm.sh

Issue the following command in your terminal 

sudo gedit /etc/xrdp/startwm.sh

The file opens and look like this


Click on Picture for Better Resolution


You will need to comment the last two lines and add at the bottom the command mate-session 


Click on Picture for Better Resolution

Save the file 


Step 4 – Configuring xRDP Keyboard 

Another thing that seems to be changed is the keyboard layout used in the xRDP login screen.  In the past, the keyboard layout was set by default to en-us layout.  With the package 0.9.0, the login screen seems to detect the keyboard layout installed on the system.  

However, inside the remote session, the English layout keyboard is still defined as default and not changed automatically. To try to set the proper keyboard layout within your remote session, you can execute the following commands

# Set keyboard layout in xrdp sessions 
cd /etc/xrdp 
test=$(setxkbmap -query | awk -F":" '/layout/ {print $2}') 
echo "your current keyboard layout is.." $test
setxkbmap -layout $test 
sudo cp /etc/xrdp/km-0409.ini /etc/xrdp/km-0409.ini.bak 
sudo xrdp-genkeymap km-0409.ini

Step 5 – Reconnect to the Same Session

Since Ubuntu 14.10, the xrdp package available in the repository fixes a long time issue related to the fact that users could not reconnect to the same session.  If you are using the package xrdp 0.6.1-1 or later, you do not need to perform any customization, you will reconnect automatically to the same session.

Test your connection 

At this stage, you should be ready to test your connection.  Get the ip address or the hostname of your ubuntu machine and fire up your mstsc.exe client on a windows machine. 


Click on Picture for Better Resolution

In the xRDP Login page, provide your credentials and accept the default settings presented to your for the session choice.  You should see the option sesman-xorg-xrdp


Click on Picture for Better Resolution

Within your remote session, you might see this error popup. Press Close and proceed.  


Click on Picture for Better Resolution

At this stage, if everything is fine, you should see your Mate-desktop through the remote session 


Click on Picture for Better Resolution

This version of xrdp is supposed to support drive redirection and clipboard function.  If you open your home folder, you should see something like this 


Click on Picture for Better Resolution

You do not see any drive redirection by default.  You have to display the hidden files and folders in nautilus (press ctrl + H).  After displaying the hidden files, you can see that there is a new folder called .thinclient_drives.  If you click on it, you will see the drive redirected to your remote session 


Click on Picture for Better Resolution

We have played a little bit with it and we have to say that the performance are not good and the feature does not seem to be really stable. We will further investigate on this topic later on….


Final Notes

This is it for this post ! All in all the old process to have xrdp installed and working on Ubuntu is still valid. If you install an alternate desktop with xRDP software package, you will be able to perform remote sessioins to your Ubuntu machine using RDP protocol. 

In Ubuntu 16.10, the package version of xrdp has been upgraded to the version 0.9.0 which brings some changes but also bring some improvements.  First improvement is that you do not need to rely anymore on vnc server package. connection is handled by the xorg-rdp new driver made available by the team behind xrdp.  The other improvement is that the drive redirection and clipboard functionalities are available out of the box.  However, these features does not seems to be working really well. copying small files can take ages.   

In the next post, we will try to come up with a process that could allow a user to connect directly to the Unity Desktop avoiding the installation of alternate desktop


Till next time

See ya

13 thoughts on “XRDP – How to Install XRDP on Ubuntu 16.10 – The easy way !

  1. @Franz,

    Thank you for the visit and the positive feedback
    It’s always nice to see that our work can be useful at the end 🙂
    Till next time
    See ya

  2. Thanks for the article. I was able to get this to work on Win 10 + Ubuntu 16.10 Hyper-V VM setup. Unfortunately, after I rebooted my Linux VM I was no longer able to remotely login to it. I can get to the xRDP Login page and provide the credentials but it stays hung on the login screen. Any ideas?

  3. @AJ,

    We did not encounter this issue…I’m assuming that you are using the sesma-xorgxrdp option in the xrdp login screen
    are they any errors in the log files (~/.xsession-errors) that can help troubleshoot the issue
    have you tried to restart the xrdp service ?

    Till next time
    See ya

  4. @Griffon @AJ
    I ‘ve encountered exactly the same problem , and I checked ~/.xsession-errors file , it’s empty.
    and I done restart the the xrdp service and still no luck .
    Please advice.

  5. @Ticols Ford,

    Happy to see that by browsing our blog, you have find the solution..in the article “XRDP – How to install XRDP on Ubuntu 16.04 – Easy Way”

    Till next time
    See ya

  6. Definitely broken with xfce desktop, I specified ‘xfce4-session’ instead of the ‘mate-session’ as per your instruction. This had been working since forever, right up until 16.10 and the new XRDP version. Now I always ended up with just a light blue window and a black mouse pointer.

  7. @Hai Vu,

    xfce desktop should be working as well on Ubuntu 16.10. We will try to post some additional posts/information about that
    What do you see in your xsession-errors file ? did you create a .xsession file or did you update the startwm.sh file ? How does it look like ?

    Till next time
    See ya

  8. @Griffon,
    The xsession-errors file contains a bunch of errors, though these are generated before I attempted to connect to the XRDP session, remotely. I assume they were generated at system startup. There is a lot of stuff in this file, here’s the last bits in it:

    (xfsettingsd:15968): xfsettingsd-CRITICAL **: No RANDR extension found in display :1.0. Display settings won’t be applied.
    Xlib: extension “XInputExtension” missing on display “:1.0”.

    (xfsettingsd:15968): xfsettingsd-CRITICAL **: XI is not present.

    (xfsettingsd:15968): xfsettingsd-CRITICAL **: Failed to initialize the Xkb extension.

    (xfsettingsd:15968): xfsettingsd-CRITICAL **: Failed to initialize the Accessibility extension.

    (xfsettingsd:15968): GLib-CRITICAL **: g_hash_table_destroy: assertion ‘hash_table != NULL’ failed

    (xfsettingsd:15968): GLib-GObject-CRITICAL **: object XklEngine 0x81659100 finalized while still in-construction

    (xfsettingsd:15968): GLib-GObject-CRITICAL **: Custom constructor for class XklEngine returned NULL (which is invalid). Please use GInitable instead.
    Failure: Module initialization failed
    Xlib: extension “RANDR” missing on display “:1.0”.
    Xlib: extension “RANDR” missing on display “:1.0”.

    (nm-applet:15997): Gdk-CRITICAL **: gdk_window_thaw_toplevel_updates: assertion ‘window->update_and_descendants_freeze_count > 0’ failed
    Xlib: extension “XInputExtension” missing on display “:1.0”.
    Xlib: extension “XInputExtension” missing on display “:1.0”.
    Xlib: extension “XInputExtension” missing on display “:1.0”.

    (evolution-alarm-notify:16000): evolution-alarm-notify-WARNING **: alarm.c:253: Requested removal of nonexistent alarm!

    (evolution-alarm-notify:16000): evolution-alarm-notify-WARNING **: alarm.c:253: Requested removal of nonexistent alarm!
    Client is not authorized to connect to Serverthunar-volman: Cannot open display: .
    Client is not authorized to connect to Serverthunar-volman: Cannot open display: .
    Client is not authorized to connect to Serverthunar-volman: Cannot open display: .
    Client is not authorized to connect to Serverthunar-volman: Cannot open display: .
    Client is not authorized to connect to Serverthunar-volman: Cannot open display: .

    (xfdesktop:15966): libxfce4ui-WARNING **: ICE I/O Error

    (xfdesktop:15966): libxfce4ui-WARNING **: Disconnected from session manager.
    xfwm4: Fatal IO error 4 (Interrupted system call) on X server :1.0.
    xfdesktop: Fatal IO error 25 (Inappropriate ioctl for device) on X server :1.0.

  9. @Griffon
    I kept a journal of everything I do, and here is the bit on XRDP on Ubuntu, which used to work until the advent of 16.10:

    XRDP will fail to start on system reboot (at least up to 9.04, I think this may have been fixed in 9.10), leaving behind an artifact in /var/run/xrdp which must be cleaned up before xrdp can be restarted.
    XRDP will not work with Unity, so you will need to install XFCE in your latest Ubuntu distro.
    In pre-16.04, you will need to add the file ~/.xsession with a single line that says: “xfce4-session” for XRDP to work properly with XFCE. However, starting with 16.04, this was broken, you will now need to ALSO add the line with “xfce4-session” just before the one with “. /etc/X11/Xsession”, in the file /etc/xrdp/startwm.sh. Here’s mine:


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

    . /etc/environment
    . /etc/profile
    . /etc/X11/Xsession

  10. @Hai Vu,

    I do not understand the trouble you are having. We have performed a fresh install of Ubuntu 16.10, installed xfce4 as alternate desktop (even if you could simply use Unity Desktop in this version !), updated the /etc/xrdp/startwm.sh accordingly and perform the remote desktop connection. This was that simple and this is working really nicely

    What have you done on your system ?
    is this a fresh install or upgrade installation
    which version of xrdp is installed (xrdp -v -> result should be either 0.6.x or 0.9.0)

    if 0.9.0 is installed in the XRDP Login box, you have to choose the option Xorg for the session manager
    if you have 0.6.x installed, maybe remove it and remove the vncserver you were using and perform the install again using the ubuntu xrdp package from Ubuntu repository which should be 0.9.0

    Finally, in the /etc/xrdp/startwm.sh (if xrdp version 0.9.0 is installed), you will need to comment at the end of the file 2 lines and add your xfce4-session info
    the file should look like

    #test -x (……)
    #exec /bin/sh (…)

    Hope this help
    Till next time
    See ya

  11. Seems like I am not able to set a higher resolution than 1600×1200. Otherwise the screen stays blank.
    Any idea how to solve this?

  12. @Stern,

    Do not have an idea about that…the biggest screen resolution I can use is 1440×900 and I do not have the problem….
    Check that your rdp client settings are set correctly in term of color depth (try the smallest color and give it a try)…
    For the rest, do not really know…We would need to test and check if there is indeed an issue….

    Hope this help
    Till next time
    See ya

Leave a Reply