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

XRDP_U1604

 

Important Note :

If you want to use xRDP in conjunction with the Unity Desktop interface, please check the following post : XRDP – How To Remote Connect to Unity Desktop on Ubuntu 16.04

 

Hello World,

In our previous post, we have quickly provided a step by step instructions on how to perform a fresh installation of Ubuntu 16.04. If you are working with Ubuntu since a long time, you know that no major changes have been introduced in the setup process and wizard.  It’s quite straightforward.

xrdp is a great solution when you need to have coexistence between Windows machines and Linux machine.  xrdp is basically a piece of software that allows you to remote desktop into your Ubuntu machine from a Windows computer.  On the Windows machine, you do not need to install any tools, you simply use the standard and builtin tool Remote Desktop Connection.

In the past, we have described how to install xrdp on the previous releases of Ubuntu( 15.10,15.04,14.10,14.04,..).  The process described to install xrdp on Ubuntu 16.04 is exactly the same as the one described for machines running Ubuntu 15.10. So, instead of going really deep into details, we will provide hereafter the necessary steps needs to be performed in order to have xrdp installed on your system.

So, let’s go

Standard XRDP installation on Ubuntu 16.04

Assumptions

For this post, we have make some assumptions.

  • Ubuntu 16.04 (Final Release version) is used
  • The Mate-desktop will be installed on the machine (as alternative desktop environment)
  • We will configure our system to match on localized version (i.e. we are using a Belgian french keyboard)
  • Since Ubuntu 15.04, upstart has been replaced by systemd component. The systemd component is used in our scenario
  • 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

Installation Process 

Step 1 – Install XRDP Package from Ubuntu Repository

A standard installation for us means that we will be using the xrdp package available within the Ubuntu repository. To install the xrdp software from Ubuntu repository, you will need to issue the following command in a terminal.

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)

Click on picture for better resolution

Step 2 – Install an alternative Desktop 

xrdp and Unity desktop (or Gnome 3) are not working well together.  If you do not install another desktop environment, when you will try to connect to your Ubuntu machine, you will see only a gray screen.  The workaround to this situation is to install an alternate desktop that can work with xrdp software solution.

Our preferred desktop alternative is Mate-Desktop.  This post will show you how to install the Mate-Desktop and have it working with the xrdp software solution.

To install the Mate-desktop, issue the following command from the Terminal Session

sudo apt-get update

sudo apt-get install mate-core mate-desktop-environment mate-notification-daemon

Note :

Desktop interface such as xfce, LXDE,LXQT, KDE  are all potential candidates.  Check the following links for more information and installation and configuration procedures

 

Step 3 – Configuring xRDP to use your desktop environment

At this stage, we need to configure our system in order to tell xrdp that an alternate desktop needs to be used.  In our case, we have to tell xrdp that we want to use Mate-Desktop as alternate desktop. With the previous version of Ubuntu, you would need to create the ~/.xsession file.  In Ubuntu 16.04, it seems that this approach is not working anymore.  We need to configure the system differently when working with Ubuntu 16.04

Starting the alternate desktop environment 

Important Note : 

In our scenario, we have installed mate-desktop, If you have installed another Desktop alternative, you will have to adapt the configuration of the startwm.sh file to reflect your settings.

If you use the  ~/.xsession file approach, you will experience the same symptoms as before i.e. grey screen. We will need to configure the system in a different way.  To have xRDP working in Ubuntu 16.04, you will need to  update the /etc/xrdp/startwm.sh file. To configure this, issue the following command in your Terminal console

sudo sed -i.bak '/fi/a #xrdp multiple users configuration \n mate-session \n' /etc/xrdp/startwm.sh

Click on picture for better resolution

Note :

Remember that the command above is to be used when you have installed the Mate-Desktop.  If you have installed a different desktop environment, you will need to adapt the command accordingly. Please check the following links

Step 4 – Configuring xRDP Keyboard 

By default, the xRDP login screen will use an en-us keyboard layout. You remote session will also be using the en-us keyboard layout.  If you are using a different keyboard layout than the english one, you need to perform the following actions in order to update the configuration of the xrdp software.

In my case, I’m using a Belgian French keyboard, so I had to tell xrdp to use the belgian french keyboard as well.  To do that, you need to perform the following actions :

Step 1 : You go to the /etc/xrdp directory

Step 2 : you issue the command setxkbmap -layout <%your layout%> to define which keyboard map/layout to use

Click on Picutre for better Resolution 

Step 3 : create a copy of the km-0409.ini file into the same directory. It seems that this is the default file used by xrdp to define the keyboard layout. You will need to use sudo in order to be able to write into the directory

Step 4 : Check that you have a backup of your file by typing the dir or ls command

Step 5 : update the file by issuing the following command sudo xrdp-genkeymap km-0409.ini

Click on Picutre for better Resolution 

Step 5 – Reconnect to the Same Session

Since Ubuntu 14.10, a new xrdp package has been made available in the Ubuntu repository. This package fixes a long time issue related to the fact that users could not reconnect to the same session.  If you are using the package xrdp 0.6.1-1, you do not need to perform any customization, you will reconnect automatically to the same session.

Final Notes

As we can see, the installation process has not changed much and after performing all the necessary configuration steps, you should be able to connect remotely to your Ubuntu machine using the Remote Desktop Connection tool.

Some people are still facing some issues while using xrdp.  If you have any issues, connecting or using xrdp, please leave a comment and will contact you back in order centralize and collect as much information possible about the issue and publish the workaround founded (if any) for the mentioned problem.

That was an easy post  🙂

Till next time

See ya

279 thoughts on “XRDP – How to install XRDP on Ubuntu 16.04 – Easy Way

  1. Just as addition, if you need to RDP to Cinnamon desktop, you need to use “cinnamon-session” in “startwm.sh” file:

    sudo sed -i.bak ‘/fi/a #xrdp multiple users configuration \n cinnamon-session \n’ /etc/xrdp/startwm.sh

    I am using it on Ubuntu 16.04 LTS with Cinnamon Desktop and it works fine.

  2. Thanks for a very good tuto : it worked very fine… till I tried to use a VMWare virtual Windows 2008 server : inside the VM, the keyboard became US again ! Some key combination works for keying french keywords, but then mouse clicks won’t work ! I’m quite disappointed. Is it possible to get some help ?

    Thanks by advance.

  3. @Yves,

    Ok we will need to have a look into it….but we have been working with Hyper-v, VirtualBox and VMware and we were always be able to have the keyboard working….

    We will have a look

    Till next time
    See ya

  4. @Fabio,

    Muchas Gracias for the positive comments and the feedback provided by you
    We are always happy when one of our post is found useful and solve problems

    Till net time
    See ya

  5. @Min,

    Thank you for the visit and positive feedback… We hope that information shared over this blog is useful to other

    Till next time
    See ya

  6. Great guide. Thanks.

    Followed to the letter, but still having problems with my keyboard. Most character keys e.g. ” and @ work find (as expected on UK keyboard) but some others e.g. cursur-up don’t do anything, or have swapped around (e.g. Print and Delete).

    Any tips about correcting this?

  7. @Peter,

    have you tried the steps described in this post http://c-nergy.be/blog/?p=3858. My understanding is that only special keys are giving you a headache… At the end of the post, there is ini file that should be working for UK layout keyboard….

    Please give it a try but we cannot guarantee that this will fix all your issues…

    Hope this help
    Till next time
    See ya

  8. @Natxo,

    We never had this kind of issue… Can you tell us which version of xrdp you are running (xrdp -v) is it 0.6.x or 0.9.x ?
    If you are using xrdp 0.9, this might be the cause of the issue.. We have seen that with xrdp 0.9 if you are using the same account to login locally and via xrdp can cause this kind of situation. the only workaround we can offer (so far) is to create a secondary account. Login with primary account locally and use the secondary account to connect via the xrdp session… Before doing that, reboot your system to cleanup all xrdp sessions ?

    We would need to test and investigate on this issue

    Till next time
    See ya

  9. Hi, I followed the steps, it works but there is a big problem: Many of the pre-installed programs such as Firefox, gedit and … not work in remote session. When I click on Firefox icon, ‘Starting Firefox web…’ appears in the taskbar and then disappears and nothing happened.
    Actually, I have encountered the problem before, when I configured xrdp with ‘xfce’. I have switched to ‘mate’ hoping the problem resolved.
    Could you help me, please?

  10. Hi again!
    I try to run gedit and Firefox via terminal but the following errors was appeared:

    $ /usr/bin/gedit
    Segmentation fault (core dumped)

    $ /usr/bin/firefox
    ExceptionHandler::GenerateDump cloned child 2354
    ExceptionHandler::SendContinueSignalToChild sent continue signal to child
    ExceptionHandler::WaitForContinueSignal waiting for continue signal…
    Segmentation fault (core dumped)

    Thanks.

  11. @Sjsy,

    We have seen that time to time but never identified the root cause… We usually have reinstalled the xrdp software and that fixed the issue in a way or another….
    Re-installing the OS also tend to fix the issue…. IF time permit, we will try to investigate and try to reproduce the error…

    Thank for letting us know
    Till next time
    See ya

  12. Hi Griffin, I tried Mate Desktop on 16.04 and failed to make it work. How can uninstall all the setup and do a fresh one?

  13. @Anuardha,

    If you have used the apt-get install commands…to remove them, simply use the apt-get remove

    Till next time
    See ya

  14. @Brett,

    Can you browse to the /etc/xrdp location and ensure that the file startwm.sh exists..
    If the file does not exists or if the xrdp folder does not exists, I would expect that there is a problem with your installation of xrdp….

    Hope this help
    Till next time
    See ya

  15. Hi,

    Thanks a lot for this topic !

    Followed with Lubuntu 16.04.2 up to date to today in a VirtualBox 5.1.18 VM.
    It works very well even the sound and video it is not remotefx 2012/2016 but it works.

    The only issue I experienced was I lost the control of my mouse (one time…).

    Do not forget to install vnc4server (default config) and pulseaudio/pavucontrol (set to All Output Devices).
    For the moment I just tested using sesman-Xvnc (profile) but I will go ahead to see the other options.

    I guess it could be a way to provide sound to Hyper-V linux VMs.
    I will test it…

    Congratulations to Griffon’s IT Library people.
    I love what you’re doing on that site !

  16. awesome guide, I actually did it the same way. One interesting is though, that after I closed the RDP session, the system server goes to 100% CPU utilization with the process xvnc, is there anyway to close the xvnc process once a user logs out?

  17. @Picolin,

    Thank you for the comments and positive feedback. About your question, we never paid attention about that….
    You could try to use the following code (create a shortcut) to logout
    ps -ef h | grep Xvnc | grep `whoami` | tr -s ” ” | cut -d ” ” -f2 | xargs kill -9
    this might be allievate the impact on the CPU..

    Hope this help
    Till next time
    See ya

  18. @Léo,

    Thank you for the comments and positive feedback. If you ever find some useful tips and tricks and you wanna share as we are keen on learning new stuff everyday.
    Till next time
    See ya

  19. Hi!
    I use xrdp and have a problem about setting remote session environment variables. For example the PATH in local or SSH session is:
    $ echo $PATH
    /usr/local/MATLAB/R2016b/bin:/usr/local/MATLAB/R2016b/bin/glnxa64:/usr/local/cuda-8.0/bin:/home/user/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/sbin:/snap/bin

    but in xrdp session the PATH is:
    $ echo $PATH
    /bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin

    I did the steps mentioned in the following website, but it did not work for me.

    http://hichenwang.blogspot.de/2014/08/setup-environment-variables-for-xrdp-in.html

    My startwm.sh file is as following
    #!/bin/sh

    if [ -r /etc/default/locale ]; then
    . /etc/default/locale
    export LANG LANGUAGE
    fi
    #srdp …
    startxfce4

    . /etc/environment
    . /etc/environment.xrdp
    . /etc/X11/Xsession

    where the contents of environment.xrdp file is:
    export JAVA_HOME=”/opt/jdk/jdk1.8.0_121″
    export CUDA_CACHE_MAXSIZE=4200000000

    My question: How I should set the environment variables for xrdp?
    Any help would be appreciated.

  20. Hi,
    great post, thank you! Are you planning on putting something together for XRDP on Ubuntu17.04? I upgraded and of course xrdp 9.0.1 seems to behave differently and doesn’t let me connect to my machine any longer. Really appreciate your work!

  21. @Jim,

    Yes man, we are planning to write up something about Ubuntu 17.04 but we were travelling for a small project…. Just need time to do this…. Probably within the next couple of days/ week…

    Till next time
    See ya

  22. @sjsy,

    which version of xrdp are you using ? have you checked the sesman.ini file…. You should have a section called [SessionVariables]
    Try to specify your session variable over there and see if this fix your issue…
    Please provide feedback if working or not …

    Hope this help
    Till next time
    See ya

  23. Hi!
    xrdp version:
    xrdp is already the newest version (0.6.1-2).

    There is no [SessionVariables] part in sesman.ini :
    $ cat /etc/xrdp/sesman.ini
    [Globals]
    ListenAddress=127.0.0.1
    ListenPort=3350
    EnableUserWindowManager=1
    UserWindowManager=startwm.sh
    DefaultWindowManager=startwm.sh

    [Security]
    AllowRootLogin=1
    MaxLoginRetry=4
    TerminalServerUsers=tsusers
    TerminalServerAdmins=tsadmins

    [Sessions]
    X11DisplayOffset=10
    MaxSessions=10
    KillDisconnected=0
    IdleTimeLimit=0
    DisconnectedTimeLimit=0

    [Logging]
    LogFile=/var/log/xrdp-sesman.log
    LogLevel=DEBUG
    EnableSyslog=0
    SyslogLevel=DEBUG

    [X11rdp]
    param1=-bs
    param2=-ac
    param3=-nolisten
    param4=tcp

    [Xvnc]
    param1=-bs
    param2=-ac
    param3=-nolisten
    param4=tcp
    param5=-localhost
    param6=-dpi
    param7=96

    Should I create the section manually? How?
    Thanks.

  24. @sjsy,

    No, you do not need to create this section. This section would exist in sesman.in only if you are using the latest supported version of xrdp which is 0.9.x (from the xrdp web site)
    If you are using the xrdp 0.6.1-2 version, you should then indeed use the /etc/environment file or environment.xrdp file….

    have you restarted the machine so you are sure that a new session (and not reused session) is effectively used…

    Hope this help
    till next time
    See ya

  25. Hi again!
    I have another problem too:
    Many times when I reconnect to the server remotely, a new session is created so I cannot work with the programs I have opened later.

    Is it related to 0.6.x version of xrdp?
    To resolve the two problems (environment variables and not connecting to the same session), is it OK to install 0.9.x version? If so, can you tell me how?

    Ubuntu version: 16.04 64bit
    Thanks a lot.

  26. Hi,
    I tried to install 0.9.x on the system according to its Readme.md, but it did not work. So I install 0.6.x using apt. It overwrited some config file (xrdp.ini, sesman.ini, …). After completing installation, the xrdp service did not start 🙁

    I tried to start it manually but…:

    $ sudo service xrdp status
    ● xrdp.service – xrdp daemon
    Loaded: loaded (/lib/systemd/system/xrdp.service; disabled; vendor preset: en
    Active: inactive (dead)
    $ sudo service xrdp start
    A dependency job for xrdp.service failed. See ‘journalctl -xe’ for details.
    $ journalctl -xe
    — Unit xrdp-sesman.service has begun starting up.
    April 19 10:21:17 MyServer systemd[1]: xrdp-sesman.service: PID file /var/run/
    April 19 10:22:47 MyServer systemd[1]: xrdp-sesman.service: Start operation ti
    April 19 10:22:48 MyServer systemd[1]: Failed to start xrdp session manager.
    — Subject: Unit xrdp-sesman.service has failed
    — Defined-By: systemd
    — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

    — Unit xrdp-sesman.service has failed.

    — The result is failed.
    April 19 10:22:48 MyServer systemd[1]: Dependency failed for xrdp daemon.
    — Subject: Unit xrdp.service has failed
    — Defined-By: systemd
    — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

    — Unit xrdp.service has failed.

    — The result is dependency.
    April 19 10:22:48 MyServer systemd[1]: xrdp.service: Job xrdp.service/start fa
    April 19 10:22:48 MyServer systemd[1]: xrdp-sesman.service: Unit entered faile
    April 19 10:22:48 MyServer systemd[1]: xrdp-sesman.service: Failed with result
    April 19 10:22:48 MyServer sudo[1983]: pam_unix(sudo:session): session closed
    lines 1338-1360/1360 (END)
    — Unit xrdp-sesman.service has begun starting up.
    April 19 10:21:17 MyServer systemd[1]: xrdp-sesman.service: PID file /var/run/xrdp-sesman.pid not readable (yet?) after start: No such file or directory
    April 19 10:22:47 MyServer systemd[1]: xrdp-sesman.service: Start operation timed out. Terminating.
    April 19 10:22:48 MyServer systemd[1]: Failed to start xrdp session manager.
    — Subject: Unit xrdp-sesman.service has failed
    — Defined-By: systemd
    — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

    — Unit xrdp-sesman.service has failed.

    — The result is failed.
    April 19 10:22:48 MyServer systemd[1]: Dependency failed for xrdp daemon.
    — Subject: Unit xrdp.service has failed
    — Defined-By: systemd
    — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

    — Unit xrdp.service has failed.

    — The result is dependency.
    April 19 10:22:48 MyServer systemd[1]: xrdp.service: Job xrdp.service/start failed with result ‘dependency’.
    April 19 10:22:48 MyServer systemd[1]: xrdp-sesman.service: Unit entered failed state.
    April 19 10:22:48 MyServer systemd[1]: xrdp-sesman.service: Failed with result ‘timeout’.
    April 19 10:22:48 MyServer sudo[1983]: pam_unix(sudo:session): session closed for user root
    ~
    lines 1338-1360/1360 (END)

    I reinstalled it, rebooted the system but it did not work 🙁
    Can you help me to start at least 0.6.x version please?
    Thanks so much.

  27. Hi again!
    The 0.6.x version eventually started but there is a new problem:
    I removed all xrdp related file in the system and reinstalled xrdp again and it did start. 🙂

    But the new problem 🙁
    When I want to connect to the server remotely it says:
    “Because of a security error, the client could not connect to the remote computer. Verify that you are logged on to the network, and then try connecting again.”

    I cannot understand the error.
    Can you please help me to resolve it?
    Thanks.

  28. @sjsy,

    Hello there, sorry for the delay in the answers but I see that you are trying too many things at the same time……so step back and relax first 🙂
    I will try to answer all your quesstion (in any orders so read it to the end…)

    If you want to install the latest version of xrdp (0.9.x ) on Ubuntu 16.04, you could have a look at the following post (http://c-nergy.be/blog/?p=8969). There is a script provided that could help you in performing the custom installation …

    If you are using Ubuntu 16.04, you can install the xrdp package from Ubuntu repository. (version 0.6.1-2) which provide the functionality to reconnect to the same session. So the behaviour you are describing is quite strange….

    Which desktop environment are you using when working with xrdp sessions ? Mate-Desktop, xfce,… ?

    For the message, because of a security error,…, I do not have an idea right now… I would guess that something is wrong with the Certificates used during the xrdp connection process.. If you can check log files, this could help us to find a hint that would allow us to look into the right direction….

    Finally, If possible, try the different solutions using a virtual machine (because you can do snapshots and revert back) and provide us some feedback …

    Hope this help
    Till next time
    See ya

  29. Hi and thanks for replay,
    I used xfce4 in the server.

    By the way, I run the script version 1.5 (mentioned in the link), on Ubuntu 16.04 installed on a virtual machine, but installation failed. I put the output of the script here. (sorry for lengthy text)
    $ sudo ./install_xrdp_v9
    [sudo] password for user:
    Moving to the ~/Download folders…
    ———————————–
    Ready to start the download of xrdp package
    ——————————————-
    –2017-04-19 17:41:29– https://github.com/neutrinolabs/xrdp/archive/master.zip
    Resolving github.com (github.com)… 192.30.253.112, 192.30.253.113
    Connecting to github.com (github.com)|192.30.253.112|:443… connected.
    HTTP request sent, awaiting response… 302 Found
    Location: https://codeload.github.com/neutrinolabs/xrdp/zip/master [following]
    –2017-04-19 17:41:30– https://codeload.github.com/neutrinolabs/xrdp/zip/master
    Resolving codeload.github.com (codeload.github.com)… 192.30.253.120, 192.30.253.121
    Connecting to codeload.github.com (codeload.github.com)|192.30.253.120|:443… connected.
    HTTP request sent, awaiting response… 200 OK
    Length: 2122607 (2.0M) [application/zip]
    Saving to: ‘master.zip.3’

    master.zip.3 100%[===================>] 2.02M 467KB/s in 5.0s

    2017-04-19 17:41:36 (412 KB/s) – ‘master.zip.3’ saved [2122607/2122607]

    Extracting content of xrdp package…
    ———————————–
    Archive: master.zip

    content removed for readability reasons

    ———————————————————————-
    Libraries have been installed in:
    /usr/local/lib/xrdp

    If you ever happen to want to link against installed libraries
    in a given directory, LIBDIR, you must either use libtool, and
    specify the full pathname of the library, or use the ‘-LLIBDIR’
    flag during linking and do at least one of the following:
    – add LIBDIR to the ‘LD_LIBRARY_PATH’ environment variable
    during execution
    – add LIBDIR to the ‘LD_RUN_PATH’ environment variable
    during linking
    – use the ‘-Wl,-rpath -Wl,LIBDIR’ linker flag
    – have your system administrator add LIBDIR to ‘/etc/ld.so.conf’

    See any operating system documentation about shared libraries for
    more information, such as the ld(1) and ld.so(8) manual pages.
    ———————————————————————-
    make[2]: Leaving directory ‘/home/user/Downloads/xrdp-master/mc’
    make[1]: Leaving directory ‘/home/user/Downloads/xrdp-master/mc’
    Making install in libxrdp
    make[1]: Entering directory ‘/home/user/Downloads/xrdp-master/libxrdp’
    make[2]: Entering directory ‘/home/user/Downloads/xrdp-master/libxrdp’
    make[2]: Nothing to be done for ‘install-exec-am’.
    /bin/mkdir -p ‘/usr/local/lib/xrdp’
    /bin/bash ../libtool –mode=install /usr/bin/install -c libxrdp.la ‘/usr/local/lib/xrdp’
    libtool: warning: relinking ‘libxrdp.la’
    libtool: install: (cd /home/user/Downloads/xrdp-master/libxrdp; /bin/bash “/home/user/Downloads/xrdp-master/libtool” –silent –tag CC –mode=relink gcc -g -O2 -Wall -Wwrite-strings -o libxrdp.la -rpath /usr/local/lib/xrdp libxrdp.lo xrdp_bitmap32_compress.lo xrdp_bitmap_compress.lo xrdp_caps.lo xrdp_channel.lo xrdp_fastpath.lo xrdp_iso.lo xrdp_jpeg_compress.lo xrdp_mcs.lo xrdp_mppc_enc.lo xrdp_orders.lo xrdp_orders_rail.lo xrdp_rdp.lo xrdp_sec.lo ../common/libcommon.la )
    libtool: install: /usr/bin/install -c .libs/libxrdp.so.0.0.0T /usr/local/lib/xrdp/libxrdp.so.0.0.0
    libtool: install: (cd /usr/local/lib/xrdp && { ln -s -f libxrdp.so.0.0.0 libxrdp.so.0 || { rm -f libxrdp.so.0 && ln -s libxrdp.so.0.0.0 libxrdp.so.0; }; })
    libtool: install: (cd /usr/local/lib/xrdp && { ln -s -f libxrdp.so.0.0.0 libxrdp.so || { rm -f libxrdp.so && ln -s libxrdp.so.0.0.0 libxrdp.so; }; })
    libtool: install: /usr/bin/install -c .libs/libxrdp.lai /usr/local/lib/xrdp/libxrdp.la
    libtool: install: /usr/bin/install -c .libs/libxrdp.a /usr/local/lib/xrdp/libxrdp.a
    libtool: install: chmod 644 /usr/local/lib/xrdp/libxrdp.a
    libtool: install: ranlib /usr/local/lib/xrdp/libxrdp.a
    libtool: finish: PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin” ldconfig -n /usr/local/lib/xrdp
    ———————————————————————-
    Libraries have been installed in:
    /usr/local/lib/xrdp

    If you ever happen to want to link against installed libraries
    in a given directory, LIBDIR, you must either use libtool, and
    specify the full pathname of the library, or use the ‘-LLIBDIR’
    flag during linking and do at least one of the following:
    – add LIBDIR to the ‘LD_LIBRARY_PATH’ environment variable
    during execution
    – add LIBDIR to the ‘LD_RUN_PATH’ environment variable
    during linking
    – use the ‘-Wl,-rpath -Wl,LIBDIR’ linker flag
    – have your system administrator add LIBDIR to ‘/etc/ld.so.conf’

    See any operating system documentation about shared libraries for
    more information, such as the ld(1) and ld.so(8) manual pages.
    ———————————————————————-
    make[2]: Leaving directory ‘/home/user/Downloads/xrdp-master/libxrdp’
    make[1]: Leaving directory ‘/home/user/Downloads/xrdp-master/libxrdp’
    Making install in libpainter
    make[1]: Entering directory ‘/home/user/Downloads/xrdp-master/libpainter’
    make[1]: *** No rule to make target ‘install’. Stop.
    make[1]: Leaving directory ‘/home/user/Downloads/xrdp-master/libpainter’
    Makefile:481: recipe for target ‘install-recursive’ failed
    make: *** [install-recursive] Error 1
    —————————
    Post Setup Configuration…
    —————————
    Set Default xVnc-Sesman
    ———————–
    Symbolic links for xrdp
    ———————–
    ———————–
    Modify xrdp.service
    ———————–
    sed: can’t read /lib/systemd/system/xrdp.service: No such file or directory
    sed: can’t read /lib/systemd/system/xrdp.service: No such file or directory
    ———————–
    Modify xrdp-sesman.service
    ———————–
    sed: can’t read /lib/systemd/system/xrdp-sesman.service: No such file or directory
    sed: can’t read /lib/systemd/system/xrdp-sesman.service: No such file or directory
    xrdp.service is not a native service, redirecting to systemd-sysv-install
    Executing /lib/systemd/systemd-sysv-install enable xrdp
    your current keyboard layout is.. us
    sudo: xrdp-genkeymap: command not found
    Restart the Computer

  30. @sjsy,

    ok, we will have to check some stuff first… We can have a look during the weekend, if you are not in a rush, we will come back to you
    are you using a virtual machine to perform the install and testing or are you using a real physical machine ?
    please confirm, Ubuntu 16.04.2 (update 2) with all updates (so the unity version not xubuntu or any others flavors) + xfce installed as alternative desktop

    Till next time
    See ya

  31. Hi,
    The mentioned problem (“Because of a security error…”) took place on a real physical machine. So I tried to install xrdp version 0.9.2 on a virtual machine just for test.

    Physical machine specification:
    $ lsb_release -a
    LSB Version: core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
    Distributor ID: Ubuntu
    Description: Ubuntu 16.04.2 LTS
    Release: 16.04
    Codename: xenial
    Alternative desktop: xfce

    On the virtual machine, Ubuntu 16.04 was installed. So I setup up a new virtual machine and install a fresh Ubuntu 16.04.2. Then ran the script on it. It did not work and the output is as follow.

    $ sudo ./installing_xrdp_v092
    [sudo] password for user:
    Moving to the ~/Download folders…
    ———————————–
    Ready to start the download of xrdp package
    ——————————————-
    Extracting content of xrdp package…
    ———————————–
    <--Remove for legibility -->

    sed: can’t read /lib/systemd/system/xrdp-sesman.service: No such file or directory
    sed: can’t read /lib/systemd/system/xrdp-sesman.service: No such file or directory
    xrdp.service is not a native service, redirecting to systemd-sysv-install
    Executing /lib/systemd/systemd-sysv-install enable xrdp
    your current keyboard layout is.. us
    sudo: xrdp-genkeymap: command not found
    Restart the Computer
    —————————-
    $
    Thanks a lot.

  32. @sjsy,

    With the new version of the xrdp package, the script needs to be updated….. and then the installation would work accordingly… We are working on updating it but as we are really busy lately…it might take 1 or 2 weeks to publish the new version…

    So if you really need to have your setup up and running quickly, we would advice you to perform the xrdp installation – the easy way (no custom install).
    To load env. variable in your xrdp session, we would then recommend that you specify them directly in the /etc/xrdp/startwm.sh file. Do not include /etc/environement…. but add them directly in the file and give it a try

    Hope this help
    Till next time

    till next time
    See ya

  33. Great tutorial. I can’t thank you enough for the infos and the layout of the presentation. Helped me a lot to build a server and save my old computer…
    Thanks, John.

  34. @John,

    Thank you for the visit and the positive feedback…we will keep trying providing great tutorials…. 🙂
    Till next time see ya

  35. @Rich,

    Glad to see that we can help
    Thanks for the positive feedback and for visiting us….
    Till next time
    See ya

  36. @Stefan,

    You should specify in the .xsession file or the startwm.sh file the environment desktop you would like to use….
    Instead of unity, you should put something like gnome or gnome-session
    Hope this help
    Till next time
    See ya

  37. Hi,
    I must connect from Ubuntu 14.04 (or 16.04) LTS to a virtual Windows 10 machine and I must redirect various USB token without installing it on Ubuntu.
    If I do Remote Desktop from W10 phisical machine to virtual W10 no problem, I think due to RemoteFX.
    I can use some hardware USB to lan redirector.
    I have tried with success the redirection of one of my token, using also Remmina or rdesktop, but after an Ubuntu installation of the token’s software.
    But I’m searching an opensource and universal software solution, well already tested.
    xrdp can help me?
    Can it give me a fully remoteFX remote desktop client?
    Many thanks.
    Andrea Treggia – Italia

  38. @Andrea,

    Ciao Andrea.. I Do not think that this has something to do with RemoteFX capability….
    If you want a Linux rdp that support remoteFx, you can try freerdp which kind of support remotefx….
    Your problem is related to the fact that no drive redirection capabilities is available when your perform a standard xrdp installation on Ubuntu 16.04…
    Either you perform a custom installation (see something like this http://c-nergy.be/blog/?p=9225)
    or upgrade to Ubuntu 16.10 or later

    hope this help
    Till next time
    See ya

  39. Hi Griffon, thanks for you comment.
    RemoteFX is a protocol with USB redirection (see for example https://blogs.technet.microsoft.com/enterprisemobility/2012/09/11/remotefx-usb-redirection-in-windows-server-2012-and-windows-8/)
    Also, in a post of 6 August 2015 (http://manu.agat.net/dotclear/index.php/post/2015/07/23/Efficient-Remote-Desktop-on-linux) I read: “RemoteFX covers three part: vGPU, USB redirection, and a codec to stream videos (RDP 7.1). RemoteFX Codec is the feature available now in xrdp”.
    I have redirect a local USB token from a Windows 10 PC (client) to a Windows 7 vm (server) without any problem.

    It seems that xrdp can’t redirect USB at present: it is right?
    If I recompile xrdp, do you think that I can redirect USB token from client to server?

    Here (https://virtualhere.com) you can find a software USB redirect (1 token for free) that is used also in QNAP NAS: I must try it as soon as possible.

    And there is a project (https://thinstation.github.io/thinstation/) that may redirect USB from thin client … another that I must try.

    Ciao
    Andrea Treggia

  40. Dear Griffon,

    I tried several tutorials before finding this one. It seems like this one is better, but I am afraid I have corrupted my setup as it is not working as expected.
    I have installed and have lxde set up with the lxdm running. Do I need to revert to lightdm?
    the xrdp appears to run, but when I rdp in to the box it just gives me a blank screen.

    I tried deleting all of the xrdp files uninstalling and reinstalling.
    I believe I got all of the steps from the tutorial using mate as the desktop and echoing it to the ~/.xsession file as indicated. the box is a 16.04 remote server in the aws cloud.

    What do I need to do to get this working correctly?
    What diagnostic information would help you determine the issue?

    thank you in advance.

  41. @Kevin,

    we never worked with lxdm…So, if you need to have xrdp and want to use this guid, you should better go back to lightdm…
    if you looking for specific lxde instructions, you can have a look here http://c-nergy.be/blog/?p=10365 (if using ubuntu 16.10) or here if using 14.04 up to 16.04 (http://c-nergy.be/blog/?p=5357)
    To get more info for debugging purposes, check the following locations :

    ~/.xsession-errors file
    /var/log/xrdp*

    here you can already collect info about the problems you are having…

    Hope this help
    till next time
    See ya

Leave a Reply