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 

 

 

 

 

5 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

Leave a Reply