xRDP – How to Install on Ubuntu 17.10 -Manual Installation

Hello World, 

It has been some time since our last post. As we are reaching the end of the year, we have to work a lot in order to meet deadlines and close currently running projects.  Based on the comments received lately, this post (or series of posts) will be once again tackle the xRDP installation process on Ubuntu 17.10 latest release.   Part I will describe how to perform a standard installation of xRDP on Ubuntu 17.10. In this previous post, the installation process has been already explained.  However, based on the feedback and comments received lately, xRDP software solution is behaving a little bit differently between the Ubuntu 17.10 Beta 2 version and the Ubuntu 17.10 Final Release.

In this post, we will perform a manual installation of xRDP and move steps by steps. So, let’s move on and see what’s happening here ! 

xRDP installation on Ubuntu 17.10

Assumptions

For this post, we have make some assumptions.

  • The Ubuntu  17.10 final release will be used
  • At time of writing, all available updates were installed on the Ubuntu machine
  • No alternative Desktop will be used. Default Gnome 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.10
  • Ubuntu machine has been installed as virtual machine using Virtualbox software 
  • Default session used is Wayland (it’s supported in Virtualbox)

The following screenshot shows the current version of Ubuntu we are using and shows that we are indeed running a Wayland session…The screenshot also shows you that no xRDP software is installed yet. 

xrpd_manual_1

Click on picture for better resolution

Installing xRDP software 

As mentioned earlier, the installation process is quite straight forward nowadays. Indeed, you simply need to install the xRDP package available from the Official Ubuntu Repository.  We will simply use the standard apt-get install command to install the xrdp software on our system.  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 -y xrdp

You might be prompted for a password. Provide it. You might be asked for confirmation to proceed with the installation.  Please confirm and wait for completion

xrpd_manual_2

Click on picture for better resolution

At this stage, the xRDP software is installed and the xrdp service are created and started automatically. As you can see on the screenshot, the xRDP version used by Ubuntu is 0.9.1. which provides drives redirection and clipboard support.

xrpd_manual_3

Click on picture for better resolution

However, before you can perform your first remote session, you need to perform some additional configuration changes on your system in order to make xRDP works.  

Configuring Ubuntu to support xRDP 

Step 1 – Configure Access Console

If you do not perform any configuration changes on your system, the xRDP solution will not work. If you try to perform a remote session, you will access the xRDP login page and you will be able to pass your credentials. However, after that, you will simply see the ugly green xrdp background which will end up after a while with a popup message stating that an error occurred.   To be able to perform a remote session, we have to relax the security applied on Ubuntu 17.10 and allow console access not only to root but to anybody. 

The easy way to perform this change is to execute the following command in a Terminal console 

sudo sed -i 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config

xrpd_manual_4

Click on picture for better resolution

This command simply edit the file located at /etc/X11/Xwrapper.config and replace the line allowed_users=console with the line allowed_users=anybody.  

Step 2 – Configure Polkit File 

Just after login into your Ubuntu system through xRDP, you might see the following popup asking for some authentication as shown in the screenshot below 

U1710beta2_xrdp12

Click on picture for better resolution

You will need to cancel multiple time this popup before accessing your desktop interface.  To avoid this prompt, we will need to change the polkit configuration. Using admin privileges, create a file called 02-allow-colord.conf under the following directory /etc/polkit-1/localauthority.conf.d/

The file should contains the following instructions and you should not be prompted anymore with such authentication request while remoting into your system 

polkit.addRule(function(action, subject) {
 if ((action.id == "org.freedesktop.color-manager.create-device" ||
 action.id == "org.freedesktop.color-manager.create-profile" ||
 action.id == "org.freedesktop.color-manager.delete-device" ||
 action.id == "org.freedesktop.color-manager.delete-profile" ||
 action.id == "org.freedesktop.color-manager.modify-device" ||
 action.id == "org.freedesktop.color-manager.modify-profile") &&
 subject.isInGroup("{group}")) {
 return polkit.Result.YES;
 }
 });

 

Step 3 – Configure Dock in xRDP

This step will ensure that the Ubuntu Dock is visible when performing a remote connection to your Ubuntu system.  In the previous post,we discovered that with no additional configuration the Ubuntu Dock was not visible in the remote session (show screenshot below). 

xrpd_manual_5a

Click on picture for better resolution

Next logical step would be to check that the Extension is on also in the remote session. To check the the Ubuntu dock is enabled, open the  System Settings page. In the console session, you can see the extension node. In the remote Session, you will not see it….

U1710beta2_xrdp14

Click on picture for better resolution

To fix this small issue (before even performing your first remote connection), you have to install the Gnome Tweak tool on the Ubuntu machine before trying to perform the first remote session. To perform the installation, you should open a Terminal Console and type the following command 

sudo apt-get install gnome-tweak-tool -y

After installing the Tweak tool, you can go back to your remote session. The Dock would still be missing. If you open the System Settings applet, you will still see that the Extensions node is missing.  To enable the Dock, you have to use the freshly installed Tweak Tool.  Open the Tweak tool applet and this time, you should see the Extensions node. Click on it, you will see that the Ubuntu Dock and the Ubuntu Apps indicators are not enabled. 

xrpd_manual_7

Click on picture for better resolution

Simply enable them in order to get access to the Dock bar within the remote session

xrpd_manual_8

Click on picture for better resolution

Test your configuration 

To Test your configuration, you need to perform the following steps 

  • step 1 – Logout from the Ubuntu machine 
  • step 2 – Start your favorite remote desktop client and provide the ip address or hostname of your ubuntu machine 

Xrdp_DE_3

Click on Picture for Better Resolution

  • step 3 –  At this stage, you should see the xRDP login page. Provide your credentials

U1704_xrdp_3

Click on picture for better resolution

  • step 4 – At this stage, you should see your standard Ubuntu Gnome Desktop with the Dock visible…. 

xrpd_manual_12

Click on picture for better resolution

 

Things to Keep in Mind….

A single user can access console and remote session 

This is the most annoying one.  In the past, the same user could be locally logged on on the system and still perform a remote connection to the same machine. Nowadays, this does not seems to be the case anymore. If the user is connected through remote desktop session, and if the same user tries to connect to the console, the login process will loop.  If the user is logged into the console, the remote session will only show a black screen.  So this point is still not fixed….. 

xrpd_manual_6

Click on picture for better resolution

Update Theme

A final minor issue people might want to fix is the default Ubuntu theme to be used.  Within the remote desktop session, the Ubuntu theme is not applied by default or it’s kind of mangled as seen in the screenshot below

U1710beta2_xrdp18

Click on picture for better resolution

As you can see, in the Gnome Tweak > Appearance, under the Themes section, the applications field is empty.  Changing this value to Ambiance will set the standard look to your remote session.

U1710beta2_xrdp19

Click on picture for better resolution

Logout Capabilities

So far, we have not encountered issues with logging off and login on back into the remote session with this specific Ubuntu version while fully patched.  Before a recent patch, we have noticed that when a user was logging off from the remote session and trying to get back in, only a black screen would be visible.  The only option to restore the capability is to perform a reboot a the machine. Again, we have not encountered this issue with the recent updates installed on the system.

Final Notes 

This conclude the part I of this series related to xRDP installation.  As demonstrated, the xRDP solution still works when running Ubuntu 17.10 with the new gnome desktop environment and the new Ubuntu dock.  Ubuntu Gnome 17.10 is using Wayland as default Display server.  Wayland display server does not support officially remote session. So, how xRDP can still work ? xRDP is working because it use the xorgxrdp backend component which is still using X11 environment.  So the session within your remote connection is basically a simple X11 session. This post has shown also that the installation process has not changed dramatically.  The only changes (that have been only described in our previous posts) are the change in the Xwrapper.config file and the installation of the Tweak tool needed to make the Ubuntu Dock visible in the remote session .

In the next post, we will see if we can automate a little bit the installation so we can speed up this process….

Till next time 

See ya

3 thoughts on “xRDP – How to Install on Ubuntu 17.10 -Manual Installation

  1. Thanks for the great post and for your continued work on XRDP on Ubuntu.

    I have Ubuntu 17.10 up and running and everything worked find after following your description, however after patching Ubuntu (with apt-get), my keyboard mapping now does not work through XRDP. I have a Norwegian Keyboard in a English version of Ubuntu. It worked fine after the first install, but not after the update.

    Any idea how I can fix this ?

    Many thanks
    Ian

  2. @Ian,

    Actually, you should be able to update your keyboard layout within the remote Desktop session by using the Keyboard layout applet… You should see either a toggle that would allow you to switch from one language to another or you simply add the keyboard layout that you need to use and you should be able to have it within your remote session

    Hope this help
    Till next time

  3. The weird thing was, that the keyboard layout applet was showing the correct keyboard, but the wrong characters were being displayed when using applications.

    After a reboot, it seems to have resolved itself, so I am hopeful it was just a passing issue.

    Thanks
    Ian

Leave a Reply