XRDP – How to install it on Ubuntu 17.10 (Beta 2)

Hello world, 

Ubuntu 17.10 is about to be released and it will bring a bunch of new features and new technologies that we will need to master quite quickly.  Ubuntu 17.10 will ship by default with Wayland Display server which introduces an interesting question about xRDP compatibility.  Can xRDP still be used in Ubuntu 17.10 or do we need to find other options to perform remote sessions to Ubuntu systems.  Apparently, Wayland does not really support remote sessions solutions out of the box.  Nowadays, remote administration of system is critical and so widely used that there is a need to have a solution to be implemented within Wayland protocol or there must be a way to fallback to X11 session type.  

In this post, we will try to see what steps are needed to have xrdp installed on Ubuntu 17.10 systems and see if this is still a viable solution… 

Let’s go ! 

xRDP installation on Ubuntu Gnome 17.10

Assumptions

For this post, we have make some assumptions.

  • The Ubuntu  17.10 Beta 2 will be used
  • No alternative Desktop will be used. 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…

U1710beta2_xrdp4

Click on picture for better resolution

As you can see, the Ubuntu 17.10 Beta 2 has made some progress in terms of look n feel and layout.  As you probably know, Canonical has customized the GDM login page in order to display the purple Ubuntu color and their logo. 

U1710beta2_xrdp1

Click on picture for better resolution

The Ubuntu 17.10 Beta 2 also provide the dock bar. This feature was a crucial element in order to ensure a smooth transition from Unity.  We didn’t publish any xrdp post before because we were waiting for this feature and see how it would work on Ubuntu locally but also when accessing a system remotely….

U1710beta2_xrdp2

Click on picture for better resolution

Installation Process 

If you are a regular ready of this blog, the installation is really straight forward.  The installation process will be used the xRDP package from the 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

U1710beta2_xrdp5

Click on picture for better resolution

In the perfect world, you should be able to start your remote desktop client and perform a remote connection… But we are not in a perfect world, so there are some additional configuration actiosn to be performed. 

Post Setup Configuration Steps

Step 1 – Configure Access Console

If you do not perform any configuration changes on your system, when you try for the first time to establish a remote desktop connection to Ubuntu through xRDP software, you should ending up accessing the xRDP login page 

U1710beta2_xrdp6

Click on picture for better resolution

After providing your credentials, you will only see a green background and no desktop will be shown and ultimately a error message might be popping up..

U1710beta2_xrdp7

Click on picture for better resolution

As described in this post, a configuration change needs to happen on the  system in order to allow remote session to occur.   We have to navigate to the following location  /etc/X11 

U1710beta2_xrdp8

Click on picture for better resolution

In this folder, there is a file called Xwrapper.config.  If you edit this file (with admin privilege – i.e. sudo), you can see that the last line indicates that only console access is granted through this file

U1710beta2_xrdp8

Click on picture for better resolution

The file needs to be updated.  You have to replace the line allowed_users=console by allowed_users=anybody as shown in the screenshot below 

U1710beta2_xrdp9

Click on picture for better resolution

Make the changes, reboot your system to ensure that the changes is applied accordingly and try to connect again.  

Note : The first time you connect to xrdp, you will be disconnected. You will need to connect a second time in order to access your remote session.

If everything is ok, you should be able to perform your remote desktop session 

U1710beta2_xrdp10

Click on picture for better resolution

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

After passing the polkit warning message, you should be able to access the desktop interface.  As shown in the screenshot, we have indeed access to the Desktop but the Dock is not visible or not present. 

U1710beta2_xrdp13

Click on picture for better resolution

Checking settings in the console and within the remote desktop session, a clear difference appears. In the console session, we can clearly see that Dock option in the settings window.  However, in the remote session, there is no Dock options available. 

U1710beta2_xrdp14

Click on picture for better resolution

To fix this issue, you will first need to install the gnome tweak tool (which seems not be installed by default) 

U1710beta2_xrdp15

Click on picture for better resolution

When installed, open the Gnome Tweak application, go to extensions node and check the status of Ubuntu Dock.  As you can see, the dock is not enabled. This is why there is no Dock visible the first time you perform the remote connection 

U1710beta2_xrdp16

Click on picture for better resolution

So, to view the Dock, simply enable these extensions and you should be good to go 

U1710beta2_xrdp17

Click on picture for better resolution

Step 4 – 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

Other Considerations 

GDM Login page color inconsistent  

Some other small considerations are related to look n feel of the gdm login page within the remote session.  When login locally on the system, the gdm page is the customized page created by Canonical (purple background).  If accessing the system while system is locked, the gdm login page background fall back to the standard grey background 

U1710beta2_xrdp21

Click on picture for better resolution

 

Session type  

Ubuntu 17.10 is using Wayland as Default Display Server, it was a surprise that xRDP is indeed still working. After some basic checks,  xRDP can still work because the implementation is falling back to the X11 session type (as seen on the screenshot)

U1710beta2_xrdp20

Click on picture for better resolution

 

A single user can access console and remote session 

Since the console session is running under Wayland and the remote session is running under x11, we assume that the same user can now indeed connect simultaneously to console and remote session. So, with this Ubuntu release, a user logged into the console should be able to access the remote session as well.  This is not the case. We have tested this… 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…..  

 

Final Notes

Voila ! This is the current status of xRDP in conjunction with Ubuntu 17.10.  So far, xRDP can still be used against Ubuntu systems because it fall back to x11 session type  which are still available in Ubuntu.  In this post, we have seen that installing xRDP is quite straight forward but there is a need to perform a lot of small tweaks to make it worked smoothly.  The future seems to be Wayland and we are excited to see what new features or software will be developed to provide remote session capabilities to Linux systems

Hope you enjoyed this post 

Till next time 

See ya

22 thoughts on “XRDP – How to install it on Ubuntu 17.10 (Beta 2)

  1. Hi, thanks for this tutorial. Unfortunately, even with the change in /etc/X11/Xwrapper.config (there’s a typo in your tutorial btw, should be allowed_users=anybody) I still get the green background after logging in, and I’m disconnected after some seconds…

    Any idea what could be the problem?

    Christian

  2. @Christian;

    Thank for the info about the typo… this has been updated….
    To help with this issue; we would need more info…. Have you checked the log files for xrdp ?
    The disconnect issue can be anything…so we need more info in order to troubleshoot. Check all logs for xrdp and xorg as well

    Till next time
    See ya

  3. We are having trouble using xrdp with two or more concurrent users, is this even possible ? It seems to show a locked screen with a grayed out password and the screen is unresponsive not sure why .. do i have to find the port number for the existing connection ?

  4. Hi, thanks for this tutorial. It seems that I have the same issues as @Christian. After restarting ubuntu and trying to connect from Windows, the blue screen does disappear but I am disconnected after a short delay. I have Ubuntu 17.04 installed and it is a desktop setup, not VM, if it matters. Journal is listed below. Any idea what could be the problem? (cleand ubuntu ip from the log, hope it doesn’t matter)
    Thanks

    Nov 07 13:26:59 michaels-lx systemd[1]: Starting xrdp daemon…
    Nov 07 13:27:00 michaels-lx systemd[1]: xrdp.service: PID file /run/xrdp/xrdp.pid not readable (yet?) after start: No such file or directory
    Nov 07 13:27:01 michaels-lx systemd[1]: Started xrdp daemon.
    Nov 07 13:27:02 michaels-lx xrdp[942]: (942)(139996347718464)[INFO ] starting xrdp with pid 942
    Nov 07 13:27:02 michaels-lx xrdp[942]: (942)(139996347718464)[INFO ] listening to port 3389 on 0.0.0.0
    Nov 07 13:30:48 michaels-lx xrdp[942]: (942)(139996347718464)[INFO ] A connection received from: ::ffff: port 60141
    Nov 07 13:30:48 michaels-lx xrdp[942]: (942)(139996347718464)[DEBUG] Closed socket 12 (AF_INET6 ::ffff: port 3389)
    Nov 07 13:30:48 michaels-lx xrdp[3276]: (3276)(139996347718464)[DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
    Nov 07 13:30:48 michaels-lx xrdp[3276]: (3276)(139996347718464)[INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
    Nov 07 13:30:48 michaels-lx xrdp[3276]: (3276)(139996347718464)[INFO ] Using default X.509 key file: /etc/xrdp/key.pem
    Nov 07 13:30:48 michaels-lx xrdp[3276]: (3276)(139996347718464)[DEBUG] Security layer: requested 11, selected 0
    Nov 07 13:30:49 michaels-lx xrdp[3276]: (3276)(139996347718464)[DEBUG] Closed socket 12 (AF_INET6 ::ffff: port 3389)
    Nov 07 13:30:49 michaels-lx xrdp[942]: (942)(139996347718464)[INFO ] A connection received from: ::ffff: port 60142
    Nov 07 13:30:49 michaels-lx xrdp[3276]: (3276)(139996347718464)[ERROR] Listening socket is in wrong state, terminating listener
    Nov 07 13:30:49 michaels-lx xrdp[942]: (942)(139996347718464)[DEBUG] Closed socket 12 (AF_INET6 ::ffff: port 3389)
    Nov 07 13:30:49 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
    Nov 07 13:30:49 michaels-lx xrdp[3277]: (3277)(139996347718464)[INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
    Nov 07 13:30:49 michaels-lx xrdp[3277]: (3277)(139996347718464)[INFO ] Using default X.509 key file: /etc/xrdp/key.pem
    Nov 07 13:30:49 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] Security layer: requested 0, selected 0
    Nov 07 13:30:49 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] xrdp_00000ccd_wm_login_mode_event_00000001
    Nov 07 13:30:49 michaels-lx xrdp[3277]: (3277)(139996347718464)[INFO ] Loading keymap file /etc/xrdp/km-00000409.ini
    Nov 07 13:30:49 michaels-lx xrdp[3277]: (3277)(139996347718464)[WARN ] local keymap file for 0x00000409 found and doesn’t match built in keymap, using local keymap file
    Nov 07 13:30:59 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
    Nov 07 13:31:00 michaels-lx xrdp[3277]: (3277)(139996347718464)[INFO ] xrdp_wm_log_msg: sesman connect ok
    Nov 07 13:31:00 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait…
    Nov 07 13:31:00 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] return value from xrdp_mm_connect 0
    Nov 07 13:31:00 michaels-lx xrdp[3277]: (3277)(139996347718464)[INFO ] xrdp_wm_log_msg: login successful for display 10
    Nov 07 13:31:00 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] xrdp_wm_log_msg: started connecting
    Nov 07 13:31:01 michaels-lx xrdp[3277]: (3277)(139996347718464)[INFO ] lib_mod_log_peer: xrdp_pid=3277 connected to X11rdp_pid=3287 X11rdp_uid=110131247 X11rdp_gid=10001 client_ip=::ffff: client_port
    Nov 07 13:31:01 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] xrdp_wm_log_msg: connected ok
    Nov 07 13:31:01 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
    Nov 07 13:31:01 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] Closed socket 16 (AF_INET6 ::1 port 58332)
    Nov 07 13:31:01 michaels-lx xrdp[3277]: (3277)(139996347718464)[INFO ] The following channel is allowed: rdpdr (0)
    Nov 07 13:31:01 michaels-lx xrdp[3277]: (3277)(139996347718464)[INFO ] The following channel is allowed: rdpsnd (1)
    Nov 07 13:31:01 michaels-lx xrdp[3277]: (3277)(139996347718464)[INFO ] The following channel is allowed: cliprdr (2)
    Nov 07 13:31:01 michaels-lx xrdp[3277]: (3277)(139996347718464)[INFO ] The following channel is allowed: drdynvc (3)
    Nov 07 13:31:01 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] The allow channel list now initialized for this session
    Nov 07 13:31:03 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] Closed socket 18 (AF_UNIX)
    Nov 07 13:31:03 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] Closed socket 12 (AF_INET6 ::ffff: port 3389)
    Nov 07 13:31:03 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] xrdp_mm_module_cleanup
    Nov 07 13:31:03 michaels-lx xrdp[3277]: (3277)(139996347718464)[DEBUG] Closed socket 17 (AF_UNIX)
    Nov 07 13:31:03 michaels-lx xrdp[3277]: (3277)(139996347718464)[ERROR] Listening socket is in wrong state, terminating listener
    Nov 07 13:34:16 michaels-lx xrdp[942]: (942)(139996347718464)[INFO ] A connection received from: ::ffff: port 60166
    Nov 07 13:34:16 michaels-lx xrdp[942]: (942)(139996347718464)[DEBUG] Closed socket 12 (AF_INET6 ::ffff: port 3389)
    Nov 07 13:34:16 michaels-lx xrdp[3638]: (3638)(139996347718464)[DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
    Nov 07 13:34:16 michaels-lx xrdp[3638]: (3638)(139996347718464)[INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
    Nov 07 13:34:16 michaels-lx xrdp[3638]: (3638)(139996347718464)[INFO ] Using default X.509 key file: /etc/xrdp/key.pem
    Nov 07 13:34:17 michaels-lx xrdp[3638]: (3638)(139996347718464)[DEBUG] Security layer: requested 11, selected 0
    Nov 07 13:34:17 michaels-lx xrdp[3638]: (3638)(139996347718464)[DEBUG] Closed socket 12 (AF_INET6 ::ffff: port 3389)
    Nov 07 13:34:17 michaels-lx xrdp[942]: (942)(139996347718464)[INFO ] A connection received from: ::ffff: port 60167
    Nov 07 13:34:17 michaels-lx xrdp[3638]: (3638)(139996347718464)[ERROR] Listening socket is in wrong state, terminating listener
    Nov 07 13:34:17 michaels-lx xrdp[942]: (942)(139996347718464)[DEBUG] Closed socket 12 (AF_INET6 ::ffff:172.18.13.18 port 3389)
    Nov 07 13:34:17 michaels-lx xrdp[3642]: (3642)(139996347718464)[DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
    Nov 07 13:34:17 michaels-lx xrdp[3642]: (3642)(139996347718464)[INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem

  5. Hello, I’m extremely new to linux. Just installed for the first time. You kind of flew over a few steps as an experienced linux user.

    1.) “If you edit this file (with admin privilege – i.e. sudo), you can see that the last line indicates that only console access is granted through this file” I don’t know how to open a file that is only accessible to the root user. I tried googling, but people made it very confusing and wanted to install other things, just to open a root file. I’m sure there’s a way to do it from command prompt. Would be useful if those screenshots were included with these steps.

    2.) “Using admin privileges, create a file called 02-allow-colord.conf under the following directory /etc/polkit-1/localauthority.conf.d/” Just like #1 If I don’t even know how to read a file that requires root access, how can I know how to create a file with admin privileges. I’d like to know the commands to do this too.

    3.) “To fix this issue, you will first need to install the gnome tweak tool (which seems not be installed by default) ” How do we install gnome tweak tool?

    Your tutorials are great and I really appreciate them. Sorry for the annoying questions. I’ve worked in Windows forever. I’m just now trying to step out and learn linux, but is very confusing for a beginner.

  6. There were a few steps left out for those of us new to Linux. I’ve included those steps here for anyone needing additional help as I did.

    1. ) How to edit a file that has administrative privileges (i.e. Xwrapper.config)

    sudo nano /etc/X11/Xwrapper.config
    After modifying file in nano, press Ctrl + O to save changes. Then press Ctrl + X to exit.

    2.) How to create a file with administrative privileges (i.e. 02-allow-colord.conf )

    Navigate to the following directory
    cd /etc/polkit-1/localauthority.conf.d/

    Use touch to create file
    sudo touch 02-allow-colord.conf

    3.) Install gnome tweak tool

    sudo apt install gnome-tweak-tool

    Once installed tool is listed under utilities applications called Tweak.

  7. I got everything working perfectly. This is great! I only have one problem now. Since we created the “02-allow-colord.conf” file I get an error upon restart/login “System program problem detected” I checked the crash logs in /var/crash/ and the only crash item reporting is _usr_lib_policykit-1_polkitd.0.crash. I assume this is because we created the new file in that directory and modified it. Anyway to prevent these crashes? Other than the annoying crash message every time. Everything seems to work.

  8. @Calfaro;

    xRDP should allow multiple connections. This was possible in the past. Remember that the a unique user can perform only a single connection. UserA will be able to connect only to a single session. If you have UserA and UserB and userC, they should be able to connect to their own session. xRDP can be configured to limit number of concurrent connections….

    As Ubuntu has been moved to Gnome Desktop and Wayland display manager, some changes might occurs but we have not extensively test xRDP with the latest release
    Hope this help
    Till next time

  9. @Jangwon,

    Thank you for the visit and the feedback… It always rewarding to see that our work has some value out there 🙂
    Till next time
    See ya

  10. @Michael,

    Which version of Ubuntu 17.04 are you using ? Ubuntu 17.04 Unity or Ubuntu 17.04 Gnome ? Have you modified accordingly the Xwrapper.config file to allow multiple connections to your Ubuntu Box ? Can you run xrdp in debug mode to see if you can get more info (check http://c-nergy.be/blog/?p=10887 )

    Hope this help
    Till next time

  11. @Stephen;

    We are trying to find right balance for the user audience we have. As we have been writing about a long time about xRDP, we are expecting that some basic knowledge of Linux exists when following our instructions. Indeed, there are still people that are not familiar with Linux basics which is good as this demonstrate the interest of more people in Linux. For all the comments you have done, I would suggest you to google and you should find immediate response to your questions..

    Hope you understand the situation
    Till next time
    See ya

  12. @Stephen,

    To validate your assumption, delete the file created and see if the crash is still happening.
    The file created should not trigger the crash. The file is a configuration file that relax a little bit Ubuntu security
    Hope this help

    Till next time
    See ya

  13. I need to connect to the same session simultaneously from three different terminals; do I need to try the xrdp walkthroughs for 14.04 ?
    I see your site shows many differences in both installation process but also in functional results depending on which desktop, xRDP, flavour, and release. I’m flexible but I’m trying to figure out the combination that will actually work.

  14. @Thorr18,
    xRDP could be an option for your remote desktop session. The solution would depend mostly on the version of Ubuntu you are running and the flavour.
    We have achieved good results with the latest Ubuntu version 17.10 introducing the new Ubuntu Gnome Desktop….
    About accessing the same session, as long as you are not logged directly on the Ubuntu machine, you will be able to reconnect to your xrdp session from different computers.
    If you need to access the local session of your Ubuntu machine, you need to logoff from the remote session first. IF you are try to connect with the same account on Ubuntu locally and remotely, you will be able to access only one session (either local or remote depends which one is active)

    Hope this answer your question
    Till next time
    See ya

  15. Is there a way to boot up directly into the remote session (I have a headless computer, so I don’t need local). I would like it to boot up, and start running a few applications on its own. But I would like to be able to connect via rdp to it without logging out first.

  16. @David,
    I’m not sure to understand what you are trying to achieve here…..
    xRDP should be working on a headless setup (I never tried myself) but I’m assuming that you can install it and configure your system to using xRDP. When installation is completed, reboot your system, and try to access the system via rdp protocol, you will need to login first and then you can have access to your desktop

    Hope this answer your question
    Till next time
    See ya

  17. Thanks! I was just confused thinking you had to be logged out before you could connect to RDP. I have it figured out now.

  18. I used one of your older tutorials to get xrdp running on 16.04 with mate. Which steps would I have to roll back from that tutorial to get xrdp running on the new default gnome desktop? Any changes necessary for the lightdm to gdm change? I have no preference for mate and only installed it because unity would not work well with xrdp at the time. Thanks.

  19. @Garret,

    maybe you should first read this post (http://c-nergy.be/blog/?p=10938). Actually, it’s possible to connect to Unity through xRDP if you perform a custom installation on Ubuntu 16.04. starting from Ubuntu 16.10, xrdp package has been upgraded and you can connect to unity desktop.

    In theory, you should not need to rollback anything on your current system. You simply need to add the Gnome Desktop as a desktop option and configure xRDP to use Gnome when performing the remote session
    You can see a demo of all the different Desktop environment that can be used with xRDP software see http://c-nergy.be/blog/?p=10028

    In the post http://c-nergy.be/blog/?p=10028, there is also a link that explain how we did in order to have access to all these different desktop
    Please before trying anything, make sure you have a full backup of your system because a lot of changes occurs since ubuntu 16.04 and some stuff might not work as expected….
    Hope this help

    till next time
    See ya

Leave a Reply