XRDP – How to install XRDP on Ubuntu 17.04 – Easy Way

UnityXrdpLogo

Hello World, 

As you probably know, Canonical is discontinuing Unity Desktop interface (see this post) and as announced recently it seems that Ubuntu 17.10 would ship with Gnome desktop already.  This means that’s probably the last time we will be covering xrdp in conjunction with Unity Desktop. 

Since Ubuntu 16.10, a new version of the xrdp package (o.9.x) has been shipped with this release.  This is a logical step forward as the team behind xrdp has also release officially the long awaited xrdp package version 0.9.x. This version brings many improvements but also some challenges.   Improvements are related to drives redirection, clipboard, builtin xrdp server backend component.  In term of challenges, the xrdp behavior seems to have changed a little bit as well in Ubuntu and the way it interact with Unity Desktop.

In this post, we will have a look on how to perform a standard installation of xrdp on Ubuntu 17.04.  Let’s do this…. 

Standard XRDP installation on Ubuntu 17.04

Assumptions

For this post, we have make some assumptions.

  • No alternative Desktop will be used. Unity Desktop will be the default desktop accessible via the xrdp session
  • We are using the standard xrdp package available within the Ubuntu repository for Ubuntu 17.04
  • Ubuntu 17.04 (Final Release version) is used

U1704_xrdp_1

Click on picture for better resolution

Installation Process 

Step 1 – Install XRDP Package 

The xrdp installation process – the easy way simply consist of installing the available xrdp package within the Ubuntu repository. So, from the a terminal console, we will simply need to issue the standard apt-get install command as provided below. 

sudo apt-get install xrdp

Because of the sudo command, you will be prompted for a password. After entering your password, you will be asked to confirm your action by pressing Y (see screenshot below)

U1704_xrdp_2

Click on picture for better resolution

 

That’s it !  Yes, you read it correctly, you do not need to perform any other installation software like vnc or alternate desktop interface in order to use the xrdp software solution in conjuction with Unity Desktop interface.

 

However, there is a catch ! Keep reading….

Workarounds,Improvements & Limitations 

Improvement #1 – Keyboard layout configuration 

If you start your remote desktop client and connect remotely to your machine, you should be presented with the standard (not really sexy) green background and the login screen from xrdp software

U1704_xrdp_3

Click on picture for better resolution

With previous version of xrdp (0.6.x), the default keyboard layout was set to en-Us. In Ubuntu 17.04, your current keyboard layout is detected automatically.  So, there is no need to configure keyboard layouts here. We are using a Belgian keyboard and we didn’t had to configure the keyboard layout through the xrdp-genkeymap command. 

Limitation #1 – one connection only to session (either console or xrdp remote session)

This is kind of an annoying constraint.  If you are logged into your ubuntu machine directly (no remote session) and you try to connect through xrdp software, you will get access to the xrdp login screen, possibly see a black screen and then you will be disconnected.  This behavior seems due to the fact that xrdp is trying to connect to the existing session available at the console.

If you logoff from the Ubuntu local console and try again, you will be able to connect via xrdp and you will be presented with a black screen…. However, your xrdp connection will stay active…. 

U1704_xrdp_5

Click on picture for better resolution

Limitation #2 – Manually start the Unity Desktop interface

 To access the Unity Desktop, you will need to right click on the black screen and select the option open terminal. 

U1704_xrdp_6

Click on picture for better resolution

 In the Terminal console that opens (place your mouse on the console) and type the following command 

exec unity

U1704_xrdp_7

Click on picture for better resolution

Note :  In the Terminal console, at the stage, the keyboard layout is en-US….

After a few seconds, you might see your screen blinking a little bit and the Unity Desktop interface will be displayed in front of you…. 

Note : We have found a workaround to automate the Unity Desktop loading process….See later in this post….

Improvement #2 – Keyboard layout configuration within xrdp session  

We have already mentioned the fact that the xrdp login screen automatically detects the proper keyboard layout.  Another improvement is within the xrdp session.  Again, the keyboard layout is detected automatically and you can see the language bar in the indicator.  You can also change the keyboard layout within the xrdp session (through setxkbmap or gui) which was not an option in previous xrdp releases…

U1704_xrdp_8

Click on picture for better resolution

Limitation  #3 – Some functions not available within XRDP Session 

If you try to change the background from xrdp session or if you open the system settings applets, you will see that you are rather limited within the xrdp session.  I would expect that this is by design and would make sense that a certain number of options would be blocked from remote session… 

U1704_xrdp_9

Click on picture for better resolution

Improvement #3 – Drives Redirection and Clipboard support

xrdp 0.9.x makes it really easy to have the drives redirection and clipboard feature available out of the box.  These features were the most requested one and they are now available.  In Ubuntu 16.10, this was already the case. However, it was not obvious to find and locate the redirected drives.  In Ubuntu 17.04, Canonical has made them visible and accessible which really improve user experience.  Now, it nautilus, you can see a shortcut to the redirected drives… 

U1704_xrdp_10

Click on picture for better resolution

If you are using the Windows remote desktop client, in order to access the redirected drives within the xrdp remote session, you need to ensure that the remote desktop client is configured accordingly. As shown in the screenshot below, you have to ensure that the only option selected in the local resources tab are the Clipboard option and the drive option. 

xrdp_redir_4

Click on picture for better resolution

xrdp_redir_5

Click on picture for better resolution

When these settings have been set accordingly, you should see the thin client folder populated with redirected drives coming from your Windows machine.

U1704_xrdp_11

Click on picture for better resolution

 

Improvement #4 – Performance and applications launching

The performance of xrdp remote session are a little bit better when working on internal network (LAN). There is still sometimes some serious lags or delays when launching applications. However, as seen in the following screenshot, the most used applications can be used and are workable through the remote desktop sessions

U1704_xrdp_12

Click on picture for better resolution

Improvement #5 – Indicator panel and logout working

In Ubuntu 17.04, the indicator panel are loaded automatically and we can use the logout button from the remote session.  This feature was lacking or problematic with previous versions/implementation… 

workaround #1 – Automatically load the Unity Desktop in xRDP session 

In the previous installation guides about xrdp and Ubuntu (Unity), in order to load automatically Unity Desktop, we would be using the .xsession file or the /etc/xrdp/startwm.sh script.  We have tried this approach but out of 10 tries only 1 one successful. Moreover, it seems that when the .xsession file is used, the remote session starts but is disconnected immediately.

So, we wanted to come with a quick workaround…and we have simply created a bash script file that would check if we are connected directly on the console or through the xrdp session.  If the session is through xrdp session, the script will execute the exec unity command

In this screenshot, you can see the script that has been created (file-name.sh). We have made sure that the file is executable by adjusting the permissions on the file and ticking the option “allow executing file as program”  (as shown in the screenshot) 

U1704_xrdp_13

Click on picture for better resolution

 Then, when locally connected to your ubuntu, launch the Dash and look for startup Applications. Click on it.  

U1704_xrdp_14

Click on picture for better resolution

In the startup application windows, press the Add Button and the add program dialog box is displayed.  Provide the requested information and press Add

U1704_xrdp_15

Click on picture for better resolution

In the Startup application list, you should see your recently added startup program

U1704_xrdp_16

Click on picture for better resolution

The next time you login into your system, the Unity Desktop should load automatically and you will have access to your Unity interface through xRDP session .

Note : The script or method to have unity loaded automatically is described in this post

Final Notes

As you can see, it’s possible to have xrdp working against unity interface while using the latest version of the xrdp package (0.9.x). The new xrdp backend server components provides a real improvement over the previous implementation.  In Ubuntu 17.04, we are still able to use the xrdp software solution and automatically launch the unity desktop so the users can enjoy a identical experience desktop wise.  

In the past, a user could be logged in locally on the Ubuntu machine and in the xrdp remote session.  This is not anymore the case (sort of).  To be able to perform a remote session, a user must not be logged locally on the Ubuntu machine.  The only drawback we see so far with the current xrdp implementation in Ubuntu 17.04

Note:

We had some success with Ubuntu 16.04 (LTS) with xRDP and have both session available (local and remote) but we still do not have a standard procedure. as soon as we have found something, we will let you know…. 

Finally after all these efforts in making xrdp and Unity play kind of  nicely…and now Ubuntu is dropping Unity Desktop Interface…..I hope that you have enjoyed these posts about Unity and xRDP because these might be probably the last one you will see…. 

We need to move forward and look into the Gnome Desktop and xRDP…. This will be another challenge for sure…. 

Till next time 

See ya 

 

 

 

 

21 thoughts on “XRDP – How to install XRDP on Ubuntu 17.04 – Easy Way

  1. @Bruce,
    as soon as we have time, we will share the script….We are still looking if there is no other cleaner way to perform the same actions
    Till next time
    See ya

  2. Guys, thanks u for the article! I still ask again, maybe u will share your script? The method described simply magically, but I would like to take a look at the working script and try it out in the work. Thanks u in advance! …and wait for da script. 😉

  3. @Anton,

    The script ,actually, an working extract of the script is on it way…
    Thank for the visit and the feedback…

    Till next time
    See ya

  4. Hello everyone.
    You know how to configure the use of smartcards/etoken in multisession.
    I need to connect windows computers to an xrdp server.
    Thank you

  5. @Alberto Avidad,

    We never worked with Smartcards with XRDP..so we cannot help….if somebody has some info to share…it would be welcomed….

    Till next time
    See ya

  6. @Brian,

    You should have read the post more carefully…. There is a link that redirect you to the script that could be used to start automatically the Unity Desktop interface.
    This post (see http://c-nergy.be/blog/?p=10528) provides you the necessary instruction to startup the unity through xrdp

    Hope this help
    till next time
    See ya

  7. I’ve installed xrdp v0.9.1 on ubuntu 17.04 and on ubuntu 16.04 and on both an rdp connection using my guacamole or freerdp or rdesktop all fail.

    If I “only” uninstall xrdp v0.9.1 and install an earlier version then all three (guacamole, freerdp & rdesktop) begin to work again.

    If I uninstall the older xrdp & reinstall v0.9.1 … rdp connections fail again ?

    Looking at logs doesn’t tell me much but I did file an issue with the Neutrinolabs github to ask them about it & included my logs.

  8. Fresh install of 17.04 and xrdp, yet RDP in Windows 10 can not find or connect to it

  9. @Ryan,
    which flavour of Ubuntu are you using ? the one that ship with Unity Desktop or you are already using the Ubuntu Gnome edition ?
    You do not provide any info about your issue ? Can you see the xrdp login screen ? are you login from the same network ? have you checked the log files to see what could be the problem ?

    Till next time
    See ya

  10. Hello everyone,
    I’ve installed xrdp 0.9.1-7build1 on Ubuntu 17.04, following your easy and very well written tutorial.
    However I’m experiencing an issue: I’m not able to shutdown nor reboot the system through the Unity menu (top-right in the unity bar) when connected through xrdp. On the contrary, opening a terminal and typing “sudo poweroff” works as expected.
    In the past, I’ve used xrdp with alternative Desktop managers (e.g. mate or xfce) on different Ubuntu versions and the shutdown and reboot menu work as expected.
    Is it a known issue or I’m doing something wrong? Is there a way to fix or I have to move to an alternative desktop manager? This issue is quite annoying for me…

    Thank you,
    gioboske

  11. @Gioboske,

    This is a kind of recurring issue. In some version it’s zorking…in some other it’s not. In Ubuntu 17.04, It seems to work however the behavior is really inconsistent..
    At the moment, the best option is either to use the command line or to create a shortcut to logoff from the remote session

    Hope this help
    till next time
    See ya

  12. @VanDonley,

    Thank you for the feedback and info. We are aware of the issue but had no time to publish info about that. We have indeed noticed that each Ubuntu flavors might have different X Server configuration (which is new since Ubuntu 16.04.2)

    We will soon publish a post over UBuntu GNome that explain exactly this problem… (http://c-nergy.be/blog/?p=10887)

    Again, Thank for the feedback and helping us in sharing info around

    Till next time
    See ya

  13. It’s working for me on Ubuntu server 17.04

    But it’s SO SLOW…

    If I click on something, it’s 10 seconds before something happens.

  14. Would VNC be faster for connecting remotely to a server which is hosted in data center?

  15. @UbuntuUser,

    VNC can sometime be faster that xRDP especially with Ubuntu 17.04…. You have to try both scenario and assess which one would best fit your situation….

    Hope this help
    Till next time
    See ya

  16. @UbuntuUser,

    xRDP can be sometime slow especially on Ubuntu 17.04 with Unity. You might want to test with other desktop environment or try to use vnc solution

    Hope this help
    Till next time
    See ya

Leave a Reply