xRDP – How to Install on Ubuntu Remix 16.10

Hello World, 

Today again, we are speaking about xRDP and a new Ubuntu Flavors that will become official with the release of Ubuntu 17.04. If you haven’t heard, there is indeed a new Ubuntu flavors called Ubuntu Remix that demoing the Budgie Desktop.  Budgie Desktop is a completely new desktop interface developed and supported by the Solus Project Team.  

We do not have really a lot of experience with Budgie Desktop but it seems that this desktop is attracting a lot of attention. Because this new Ubuntu edition will be part of the big family and, because we have decided to publish as much information as possible on xRDP and Ubuntu flavors, It’s time to see if the Budgie Desktop can be used while performing remote desktop connections… 

Let’s try this…

Step by Step Process 

Assumptions

For this post, we have make some assumptions.

  • Ubuntu Remix 16.10 (Final Release version) is used
  • Installation is performed on fresh new install
  • No Alternate Desktop interface is needed. We will connect directly to the budgie Desktop
  • 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
  • Your system is connected to Internet (so you can download necessary packages)

Step 1 – Install the xRDP package 

This is becoming really a routine for our readers.  To have the xrdp package installed, you simply open a Terminal Console and you issue the following command 

sudo apt-get -y install xrdp 

Click on Picture for Better Resolution

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

 

To check which xrdp version has been installed, issue the following command

xrdp -v

If you see version 0.9.0 (as on the screenshot), we can proceed to the next step

Click on Picture for Better Resolution

Step 2 – Configuring xRDP to use your desktop environment

In our previous post related to Linux Mint, there was no need to modify the /etc/xrdp/startwm.sh file to specify which desktop would be used during the remote session.  In Ubuntu Remix 16.10, it seems that there is a need to modify the /etc/xrdp/startwm.sh file so xRDP software knows that Budgie Desktop needs to be used. To do so, perform the following actions

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 a line so the system knows that budgie-desktop will be used

Click on Picture for Better Resolution

 

Step 3 – Configuring xRDP Keyboard 

By default, the xRDP login screen should be using the actual keyboard layout you are using.  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 4 – Test your configuration

If everything went fine, you should fire up your Remote Desktop client, insert the name or ip address of the remote linux machine you want to connect to and you should see the xRDP Login page presented to you (see screenshot below). Ensure that the Sesman-xorgxrdp option is selected 

Click on Picture for Better Resolution

Provide your credentials, hit ok and after a few seconds, you should have access to your Budgie Desktop environment and start working remotely on your system. 

Click on Picture for Better Resolution

 

Update Info

some people notified us that the xrdp configuration was not persitent between the reboots.  We have spend two days trying to reproduce the issue and we did not succeeded.    If you have the similar issue, please post a comment so we can gather more info about this issue and see what could be generating this situation. 

In the meantime, we have made a quick and dirty video that shows that xrdp is persistent between reboots when installed on Ubuntu remix 16.04…

Final Notes 

Voila ! So far, we have seen how to install and configure xRDP package on Linux Mint Distribution 18.1 and the newly family member Ubuntu Remix 16.10 (which will be official when Ubuntu 17.04 will be out). Since xRDP version 0.9.0 a lot of things have been improved and standardized.  This means that the installation process is becoming really easy too.  

Using this package version, we can use our favorite desktop interface (through the new xrdp driver which is used as back end infrastructure element), we can reconnect to the same session if we go disconnected and the small issues like the logout button not working properly seems image of the past.  xRDP can become the must have application on your Linux Distro..

In the next xRDP post, we might want to have a look at the Kubuntu flavor as some of our readers have asked about it

Till next time

See ya 

 

 

 

 

24 thoughts on “xRDP – How to Install on Ubuntu Remix 16.10

  1. Hi,

    Thank you so much for this tut!. Just the thing I needed.
    It works. However one small problem. It doesnt persist after reboot.
    Error: /var/run/xrdp.pid is missing or it’s the /var/run/xrdp/xrdp-sesman.pid
    How do I make this persistent?

    Thank you.

  2. @monkyBoy,

    IT should be persistent… We didn’t encountered this issue
    If you had a connection initially, that means the file should be there…
    have you checked that the file exists in the specified location and have you checked that permissions are set correctly…

    Can you try to remove/re-install the xrdp package and see if it’s getting better

    hope this help
    Till next time
    See ya

  3. Hi,

    Thx for the reply
    The only thing that works is reinstall after reboot.
    From what i read isnt /run not supposed to not keep files after reboot?

    Thx

  4. @Monkyboy,

    The change should be persistent between reboots…So, if you install xrdp on Ubuntu remix, you should be able to reboot and still have access to it
    If something has changed in Remix, this might impact the xrdp solution. but then you would need to investigate and see why it complains about missing pid or files

    Thank for the feedback and the visit
    Till next time
    See ya

  5. @monkyboy & Griffon

    The PID file not being readable yet does not seem to be the error that causes xrdp to fail on reboot.


    Feb 17 16:27:00 budgie-desktop systemd[1]: Starting xrdp (X Remote Desktop Protocol) protocol server...
    Feb 17 16:27:00 budgie-desktop systemd[1]: xrdp.service: PID file /run/xrdp/xrdp.pid not readable (yet?) after start: No such file or directory
    Feb 17 16:27:01 budgie-desktop systemd[1]: Started xrdp (X Remote Desktop Protocol) protocol server.
    Feb 17 16:27:17 budgie-desktop systemd[1]: Starting xrdp (X Remote Desktop Protocol) session manager...
    Feb 17 16:27:18 budgie-desktop systemd[1]: Started xrdp (X Remote Desktop Protocol) session manager.

    ...snip...

    Feb 17 15:57:33 budgie-desktop systemd[1]: Failed to start xrdp (X Remote Desktop Protocol) protocol server.
    Feb 17 15:57:33 budgie-desktop systemd[1]: Dependency failed for xrdp (X Remote Desktop Protocol) session manager.
    Feb 17 15:57:33 budgie-desktop systemd[1]: xrdp-sesman.service: Job xrdp-sesman.service/start failed with result 'dependency'.
    Feb 17 15:57:33 budgie-desktop systemd[1]: xrdp.service: Unit entered failed state.
    Feb 17 15:57:33 budgie-desktop systemd[1]: xrdp.service: Failed with result 'timeout'.

    I am unfamiliar with the way systemd works but it appears that xrdp and xrdp-sessman fails to start on a reboot due to its dependencies not being available yet (it looks like systemd is trying to start the xrdp services during network and hostname configuration).

    The following works after the system has fully booted.

    sudo systemctl start xrdp.service
    sudo systemctl start xrdp-sesman.service

    I have tried starting manually by using /etc/rc.local

    #mv /etc/rc.local.orig /etc/rc.local
    /bin/systemctl start xrdp.service
    /bin/systemctl start xrdp-sesman.service
    exit 0

    It appears that /etc/rc.local is not used in this flavor of Ubuntu (dunno why).

    I will test some more and look into ways to make the xrdp services start after the system has fully booted.

    Cheers.

  6. @DeadPan110,

    If we have time we will try to have a look into this issue…. again, we never experienced this issue and we were able to connect even after reboots…
    Really strange…

    Keep in touch 🙂

    Till next time
    See ya

  7. @Griffon
    Same here:
    Feb 18 09:30:26 delta systemd[1]: xrdp.service: PID file /run/xrdp/xrdp.pid not readable (yet?) after start: No such file or directory>/code>
    After reboot location /var/run/xrdp does not exist anymore. /var/run is a link to /run which is created at boot time and options are in /usr/lib/tmpfiles.d/ where is no trace of xrdp
    Cheers

  8. @Deadpan110
    Thank you confirming this. I am having the same issue. I am resolving this by reinstalling xrdp every time after reboot.

  9. @Kiefer,

    Thank you for the info and the feedback… We will need to perform additional testing and see if we can also reproduce the error…
    During our test (and we have rebooted the system) we had no issues…but maybe the remix version we are using is not up to date and this could have introduced some changes….

    Hope to come back soon with some ideas but we really need some time..be patient

    Till next time
    See ya

  10. We have the same issue here. Tried everything and anything to fix. Only thing that works is reinstall or restart after interactive login, no startup scripts fix it.

  11. @James,

    Thank you for reporting back to us the issue for Ubuntu Remix 16.10. We will try to investigate a little bit further and try to see if there is something we can do to fix this annoyance
    Keep in touch
    Till next time
    See ya

  12. @James,@MonkyBoy,deadpan110,

    We have tried to reproduce your issue and then troubleshooting….the problem so far is that we cannot reproduce it. We have installed Ubuntu budgie remix distribution version 16.04 – 17.04 and we have persistent xrdp between reboots…. We have uploaded a video that shows reboot of ubuntu remix and we can access the system via xrdp…

    You have to explain us your setup so we can try to investigate further. which version of ubuntu are you using (distribution + release number), which xrdp version are you using, have you followed the instructions ? can you try to install ubuntu remix as a vm and try again and come back with results,comments,issues…

    Your error message complains about missing files in /var/run/…. Can you create them manually (empty files) ensure that xrdp group (i think) has access to them and restart your system and see what’s happening…

    at this stage, we have no more clues because it works for us

    Till next time
    See ya

  13. Hello,

    First of all thank you for the continued effort to get this working. It’s much appreciated.
    I have installed it exactly as instructed above. The only thing I did not do is the keyboard part because mine is fine as is. Also it was a fresh install.
    @Griffon
    How do I do the below pls ?:
    Your error message complains about missing files in /var/run/…. Can you create them manually (empty files) ensure that xrdp group (i think) has access to them and restart your system and see what’s happening…

    ===
    xrdp: A Remote Desktop Protocol server.
    Copyright (C) Jay Sorg 2004-2014
    See http://www.xrdp.org for more information.
    Version 0.9.0
    ===
    Version 16.10
    Mem: 8G
    Proc: Intel® Xeon(R) CPU E5-2620 v4 @ 2.10GHz × 4
    Graphic: Gallium 0.4 on llvmpipe (LLVM 3.8, 256 bits)
    BaseSys:Ubuntu 16.10 64-bit
    Virt: QEmu
    ===

  14. @MonkyBoy

    We are still investigating…. We have deleted the /var/run/xrdp/xrdp.pid and xrdp-sesman.pid files and we were still able to perform xrdp
    After restarting the machine, the xrdp service was still available and the files were recreated…..
    The problem might be in the xrdp unit file… CAn you check if you have them in the following location /lib/systemd/system…check for xrdp.service and xrdp.sesman
    possibly post your config to see if there is a difference…

    I see also that you are using Qemu as emulator…Could you try to perform a test on another virt platform (virtualbox) to see if the error is still showing up

    Hoping that this could help
    Till next time
    See ya

  15. Hi again,

    I pasted my config and they are in /lib/systemd/system
    I need qemu because I can directly passthrough my hardware. If it has to do with the hypervisor i just give up and settle for reinstalling it every time. I dont want to waste more of yur time.
    Cheers

    =======xrdp.service===
    [Unit]
    Description=xrdp (X Remote Desktop Protocol) protocol server
    Documentation=man:xrdp(8) man:xrdp.ini(5)
    After=network.target

    [Service]
    Type=forking
    PIDFile=/run/xrdp/xrdp.pid
    EnvironmentFile=-/etc/sysconfig/xrdp
    EnvironmentFile=-/etc/default/xrdp
    User=xrdp
    Group=xrdp
    PermissionsStartOnly=true
    ExecStartPre=/bin/sh /usr/share/xrdp/socksetup
    ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS
    ExecStop=/usr/sbin/xrdp $XRDP_OPTIONS –kill
    ExecStopPost=/bin/rm -rf /var/run/xrdp/sockdir

    [Install]
    WantedBy=multi-user.target

    =======xrdp.service===
    [Unit]
    Description=xrdp (X Remote Desktop Protocol) session manager
    Documentation=man:xrdp-sesman(8) man:sesman.ini(5)
    Requires=xrdp.service
    After=network.target xrdp.service

    [Service]
    Type=forking
    PIDFile=/run/xrdp/xrdp-sesman.pid
    EnvironmentFile=-/etc/sysconfig/xrdp
    EnvironmentFile=-/etc/default/xrdp
    ExecStart=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS
    ExecStop=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS –kill

    [Install]
    WantedBy=multi-user.target

  16. @MonkyBoy,

    Thanks for the info….files seems correct. Final thing to check would be…Reboot your machine, then from command prompt type
    sudo systemctl start xrdp
    sudo systemctl startus xrdp
    Finally type
    sudo journalctl -u xrdp > logfile.txt

    check or send me the file so we might find errors occurring at the start of the service

    Till next time
    See ya

  17. Hiya

    I could not perform startus: Unknown operation startus.
    Here is the logfile.

    ====
    — Logs begin at ma 2017-02-27 01:30:39 CET, end at ma 2017-02-27 01:33:37 CET. —
    feb 27 01:30:40 Monkeyballs systemd[1]: Starting xrdp (X Remote Desktop Protocol) protocol server…
    feb 27 01:30:40 Monkeyballs systemd[1]: xrdp.service: PID file /run/xrdp/xrdp.pid not readable (yet?) after start: No such file or directory
    feb 27 01:32:10 Monkeyballs systemd[1]: xrdp.service: Start operation timed out. Terminating.
    feb 27 01:32:10 Monkeyballs xrdp[1053]: (1053)(140490904148800)[INFO ] An established connection closed to endpoint: NULL:NULL – socket: 10
    feb 27 01:32:10 Monkeyballs systemd[1]: Failed to start xrdp (X Remote Desktop Protocol) protocol server.
    feb 27 01:32:10 Monkeyballs systemd[1]: xrdp.service: Unit entered failed state.
    feb 27 01:32:10 Monkeyballs systemd[1]: xrdp.service: Failed with result ‘timeout’.
    feb 27 01:32:19 Monkeyballs systemd[1]: Starting xrdp (X Remote Desktop Protocol) protocol server…
    feb 27 01:32:19 Monkeyballs systemd[1]: xrdp.service: PID file /run/xrdp/xrdp.pid not readable (yet?) after start: No such file or directory
    feb 27 01:32:20 Monkeyballs systemd[1]: Started xrdp (X Remote Desktop Protocol) protocol server.
    ====

    Cheers

  18. @monkyboy,

    If I read your output provided here, I can see that the service xrdp is started at the end of the process. As I mentioned previously, even if the the xrdp.pid file are not present, the service xrdp seems to work

    The other command that you have to type is sudo systemctl status xrdp (in the previous command that was a typo)
    So reboot your machine, try to connect 2 times through xrdp session and then execute the sudo systemctl status xrdp
    Provide us the output of the command,
    if xrdp service is started, you should see a green line, telling you that the service is running or active…

    waiting for the info…
    Till next time
    See ya

  19. Okay we are getting somewhere

    port 3350 was in the wrong state.
    i change the port in sasman.ini to 5900
    it works now but xrdp still wont start at reboot
    i need a sudo systemctl restart xrdp to make it work

    cheers!

  20. Hi we have the same problem here on Kali2 in AWS. Always needs manual restart to get port 3500 up and running (3389 starts just fine). We’re getting

    systemd[1]: xrdp.service: PID file /run/xrdp/xrdp.pid not readable (yet?) after start: No such file or directory

    If we restart, works just fine.

  21. @Monkyboy,

    Moving forward….Ok, now you telling me that it kind of work but that you need to manually restart xrdp after each reboot
    Can you again try the following
    1. Reboot the machine
    2. Try to connect via xrdp 2 Times
    3. if fails, login into the console, and provide output of the command sudo systemctl status xrdp
    is the service active and running or dead…If dead, do you see the error or hints that can explain why not starting….?

    Till next time
    See ya

  22. @James,

    Thank you for the info. However,we do not think that the error you seeing is causing the issue. We have tested with these files being present and we have been able to perform xrdp connections…If you have time, can you provide some logs and status of the xrdp service after a reboot, to try to identify what could be the problem .

    Till next time
    See ya

  23. Sesman-xorgxrdp option is not available for me it shows other options but not that one.
    I’m running 17.04

  24. @Bas,

    Do you see xorg in your list ? if you do, use this option… actually, with the xrdp 0.9.x, the first option in the dropdown list should be used if you have performed a standard xrdp installation

    hope this help
    Till next time
    See ya

Leave a Reply