XRDP – Custom Install on Ubuntu 16.04.2 to Access Unity Desktop

Note :   A NEW VERSION OF THIS POST IS AVAILABLE AT THIS LOCATION : http://c-nergy.be/blog/?p=10752  HOWEVER,THIS POST REMAINS VALID AS WELL AND HAS BEEN UPDATED RECENTLY

 

Hello World, 

Today’s post is about xRDP, Unity and Ubunt 16.04.  

Why Ubuntu 16.04 ? For multiple reasons…

Because it a long term support (LTS) release which means that Canonical will provide support till 2020 or 2021.  Even do Canonical is dropping Unity Desktop interface in favor of Gnome Desktop in the next releases, a lot of people might still be working with Ubuntu 16.04 and Unity.   

Because one of our previous posts describing how to install xrdp through a custom script (install-xrdp.sh version 1.7) needs to be updated in order to reflect the recent changes affecting the xrdp package available on the web (xrdp version 0.9.x).  Some of our readers have been using this custom script and noticed that it was not working anymore…so we needed to update this one and make it work again…. 

This is exactly what will do…right now…. 

The Custom Installation Script (version 1.8)

Overview

By default, Ubuntu 16.04 ship with version 0.6.xx of the xrdp package.  It possible to install the Ubuntu provided xrdp package and perform a remote desktop connection into Unity Desktop (see this post). The instruction on this post should still be valid.  However, performing the standard installation of xrdp 0.6.xx implies that features like Drives Redirection or Clipboard capability are not available through this instruction process.  

As you can imagine, we also published a post explaining how to perform the custom installation of xrdp on Ubuntu 16.04 and have Drive redirection and Clipboard features enabled.  The ease the installation and configuration, a custom installation script has been created and published.  At that time the script was at version 1.7.  Because of the major changes affecting the xrdp package 0.9.xx, the script version 1.7. should not be used anymore and you should instead use the latest version of the script (i.e. version 1.8) which will be provided through this post…. 

Assumptions

Before running this script, be aware of the following assumptions

  • We have tested the script on Ubuntu 16.04 Update 2
  • No additional desktop interface has been installed. Unity Desktop will be the default interface in the remote sessions
  • We have performed the test on a Virtual Machine running on Hyper-V Server
  • This script should be run only on Ubuntu 16.04.2 (so far) as we have not tested it on higher version. 

Prerequisites

We assume that you have internet connection on the Ubuntu machine.  The internet connection is needed to download the latest version xrdp package.  If you are not connected to internet, you can still manually download the xrdp package and modify the install-xrdp.sh script accordingly

The script version 1.8

Important Note :

If you copy/paste the script, you might encounter some issues because font formatting might be not maintained during the copy/paste operation. Please ensure that format is  accurate before launching the script. A downloadable version of the script is available at the bottom of the post

Version 1.8 does not introduces major changes.  it simply take into account the fact that in order to compile xrdp from source, you need to follow a specific order.  First compile xrdp and then compile xorgxrdp. The incremental version is due to the fact that we have added into the script the possibility to populate automatically the .xsession file and have Unity Desktop with Indicator panel loaded when performing the remote Desktop connection. We have also created the polkit file in order to avoid annoying popups when connected to the XRDP session. Finally,  Drives redirection and Clipboard feature should be available as well after the script has completed….. 

Disclaimer : As usual, use this at your own risk !! 

################################################################
# Script_Name : install-xrdp-1.8.sh
# Description : Perform an automated custom installation of xrdp
# on ubuntu 16.04.2
# Date : April 2017
# written by : Griffon
# Web Site :http://www.c-nergy.be - http://www.c-nergy.be/blog
# Version : 1.8
#
# Disclaimer : Script provided AS IS. Use it at your own risk....
#
##################################################################

##################################################################
#Step 1 - Install prereqs for compilation
##################################################################

echo "Installing prereqs for compiling xrdp..."
echo "----------------------------------------"
sudo apt-get -y install libx11-dev libxfixes-dev libssl-dev libpam0g-dev libtool libjpeg-dev 
flex bison gettext autoconf libxml-parser-perl libfuse-dev xsltproc libxrandr-dev python-libxml2 
nasm xserver-xorg-dev fuse git 

##################################################################
#Step 2 - Obtain xrdp packages 
################################################################## 

#-Go to your Download folder
echo "Moving to the ~/Download folders..."
echo "-----------------------------------"
cd ~/Downloads

#Download the xrdp latest files
echo "Ready to start the download of xrdp package"
echo "-------------------------------------------"
git clone https://github.com/neutrinolabs/xrdp.git

##################################################################
#Step 3 - compiling xrdp packages
################################################################## 

echo "Installing and compiling xrdp..."
echo "--------------------------------"
cd ~/Downloads/xrdp
sudo ./bootstrap
# We can enable more options -- Check Documentation
sudo ./configure --enable-fuse --enable-jpeg
sudo make
sudo make install

##################################################################
#Step 4 - compiling xorgxrdp packages
################################################################## 

cd ~/Downloads
git clone https://github.com/neutrinolabs/xorgxrdp.git

cd ~/Downloads/xorgxrdp 
sudo ./bootstrap 
sudo ./configure 
sudo make
sudo make install

##################################################################
#Step 5 - Updates service Unit Files
################################################################## 

## Needed in order to have systemd working properly with xrdp
echo "-----------------------"
echo "Modify xrdp.service "
echo "-----------------------"
#Comment the EnvironmentFile - Ubuntu does not have sysconfig folder
#sudo sed -i.bak 's/EnvironmentFile/#EnvironmentFile/g' /lib/systemd/system/xrdp.service
#Replace /sbin/xrdp with /sbin/local/xrdp as this is the correct location
#sudo sed -i.bak 's/sbin\/xrdp/local\/sbin\/xrdp/g' /lib/systemd/system/xrdp.service

echo "-----------------------"
echo "Modify xrdp-sesman.service "
echo "-----------------------"

#Comment the EnvironmentFile - Ubuntu does not have sysconfig folder
#sudo sed -i.bak 's/EnvironmentFile/#EnvironmentFile/g' /lib/systemd/system/xrdp-sesman.service
#Replace /sbin/xrdp with /sbin/local/xrdp as this is the correct location
#sudo sed -i.bak 's/sbin\/xrdp/local\/sbin\/xrdp/g' /lib/systemd/system/xrdp-sesman.service

#Issue systemctl command to reflect change and enable the service
sudo systemctl daemon-reload
sudo systemctl enable xrdp.service
sudo systemctl enable xrdp-sesman.service

##################################################################
#Step 6 - Updates .xsession file 
##################################################################
## copy the following in the .xsession file
cat >~/.xsession << EOF
/usr/lib/gnome-session/gnome-session-binary --session=ubuntu &
/usr/lib/x86_64-linux-gnu/unity/unity-panel-service &
/usr/lib/unity-settings-daemon/unity-settings-daemon &

for indicator in /usr/lib/x86_64-linux-gnu/indicator-*; 
do
basename='basename \${indicator}' 
dirname='dirname \${indicator}' 
service=\${dirname}/\${basename}/\${basename}-service 
\${service} &
done
unity
EOF

## Configure Polkit to avoid popu in Xrdp Session

cat >/etc/polkit-1/localauthority.conf.d/02-allow-colord.conf <<EOF

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;
}
});
EOF

echo "Restart the Computer"
echo "----------------------------"
sudo shutdown -r now

 

How to use the script

Set Execute Right on the script

Download the install-xrdp-1.8.sh script to your system.  To have it running, the script has to be marked as executable.  To mark a script/file as executable, the following actions needs to be performed 

Right-click on the file, go to properties, then select permissions and tick the box allow executable….

xrdp_custom

Click on Picture for better resolution 

or from the command line, issue the following command

chmod +x  ~/Downloads/install-xrdp-1.8.sh  

 

Note : Adjust the path where the install-xrdp-1.8.sh script to reflect your environment

Execute the script

To execute the script, ensure that internet connection is available (so you can download the necessary packages needed for the installation) and simply open a Terminal console.  In the Terminal console, Browse to the location where the script has been stored and then issue the following command 

sudo ./install-xrdp-1.8.sh  

You might be prompted for a password. Provide the password and proceed with the installation.

Wait for completion of the script.  The machine will reboot automatically when done.

Test your xRDP Connection

When the Ubuntu machine is up and running, it’s time to perform your remote desktop connection.  So, Open your favorite remote desktop client, provide ip address or hostname of your Linux machine and connect.  If the xrdp service is listening, the xrdp login screen will be presented to you

U1704_xrdp_3

Click on picture for better resolution

 

Because we are using the package 0.9.xx, there is no need to configure keyboard layout in the xrdp login screen or during the xrdp session.  The keyboard layout should be detected automatically.  However, if you still see that the keyboard layout within the xrdp session does not match your settings, simply use the language in indicator bar to set the proper language settings..

U1704_xrdp_8

Click on picture for better resolution

Improvements detected 

In this post, installing xrdp and have it working with Ubuntu 17.04 and Unity is feasible but there are still some caveats.  The major annoyance with xrdp and Unity in Ubuntu 16.10 and 17.04 is the fact that a user can be connected only through one session.  If a user is connected to the console, the same user cannot perform a remote desktop connection.  The other way is true as well.  If the user is remotely connected, he cannot connect to the console. This would fail (infinite loop to login page).  In Ubuntu 16.10 and 17.04, the .xsession file does not seems to work anymore and we recently found out that to have the Unity destkop started automatically, we could simply execute a specific startup application script.  (see  this post). 

The install-xrdp-1.8.sh seems to remove all these constraints. After executing the script, we have been able to connect to the remote session while still logged into the console.  The Unity Desktop is launching automatically through the .xsession file and the indicator Panel bar is loaded as well.  All in all the user experience is smoother when accessing the Unity Interface through xRDP. 

Issues detected 

The noticeable issues found so far are still the performance and the logout functionality.  Over the LAN, the performance are acceptable but still not as good as you would expect when logged into the console.  The other problem is the logout option.  If a user decide to logout from the xrdp session, the user can click on the logout button (on the indicator panel) and after some time the session will be closed.  However, next time the user would try to connect, xrdp would fail. 

The best workaround we can offer is to encapsulate the following command into a script and create a shortcut on the Desktop of the user and instruct them to use this shortcut to logout from a remote session. This approach would ensure that when a user tries to reconnect, xrdp will accept the connection request

ps -ef h | grep xorgxrdp | grep `whoami` | tr -s " " | cut -d " " -f2 | xargs kill -9

 

Download the Script 

Please download the script :  install-xrdp-1.8.zip

Final Notes

In this post, we have spend again a little bit of time on Ubuntu 16.04 and xRDP while Ubuntu 17.04 is out and that 17.10 will ship with Gnome 3 as default desktop.   As Ubuntu 16.04 is an LTS release, we are expecting to have a lot of people sticking to it and still use Unity Desktop.   

Using the custom installation procedure against Ubuntu 16.04.2, latest version of xRDP software can be installed and surprisingly, it even offer a better or smoother experience compared to the standard installation on Ubuntu 17.04…  Unity Desktop is launched automatically, indicator panel is there and the same user can be connected locally and remotely to the same machine….   This is a real workable solution…. 

We still need to investigate xRDP against Ubuntu Gnome as this will become the default Desktop environment….but this will be for a later stage…..

I hope you will enjoy the small improvements….

Till next time

See ya

 

 

 

30 thoughts on “XRDP – Custom Install on Ubuntu 16.04.2 to Access Unity Desktop

  1. Hello and thanks for these posts.

    The downloadable script is not, ehm, a script. It is an exception stack trace 🙂

    Regards!

  2. Help!!! ))

    checking for XRDP… no
    configure: error: Package requirements (xrdp >= 0.9.0) were not met:
    No package ‘xrdp’ found

    while ./configure

  3. Hello DavidC,

    Thank you for letting us know that the download file was not the correct one… We have updated the post and the new download file should be the good one…

    Thank you for the feedback and detectig issues on this blog. if there is still an issue; do not hesitate and let us know…
    Till next time
    See ya

  4. @Grif,

    This can happen if the xrdp package is not yet installed… so you first need to install the xrdp package (download and compile) and then install (compile the xorgxrdp). we have noticed that sometimes the script fails to make the connection to the github…we have changed slightly the script so now it should be ok
    Sorry for the inconvenience
    Please try again (downloading the script at the end of the post) and provide feedback… Thank you for your help in improving this blog…

    Till next time
    See ya

  5. Hi,
    Thanks for this post.
    I install xrdp according to this post. It works. But there are two problems with it:
    First:
    I cannot open my home folder. When I try to open my home folder, an error window appears and says:

    > Failed to open directory ‘user’.
    > Error when getting information for file ‘/home/user/thinclient_drives’: Transport endpoint is not connected.

    I opened /home/user in terminal. There is a ‘thinclient_drives’ folder that its permission is as “d?????????”.
    The folder is not a normal folder and it seems it was created by xrdp.

    Second:
    After some time the connection is terminated with the following error:
    An internal error has occurred.

    Ubuntu 16.04.2
    xfce

    Please help me.
    Best.

  6. Hi
    According to a comment on the Internet, I change ‘thinclient_drives’ to ‘.thinclient_drives’ in the config file, and the problem was resolved.
    Thanks.

  7. Hi, after following this guide on 16.04 LTS, I noticed that compiz was killing my CPU. I saw that in Additional Drivers it is using the x.org nouveau driver and pushing all graphics to CPU. I installed the appropriate nvidia driver for my card (proprietary,tested binary nvidia-340), rebooted, and now when I RDP from my windows box, i get the login screen.. but when i press log in, the form goes away and it stays that light blue screen. Is it possible to have the xRDP session render using the GPU? Should I try an alternative desktop (you mentioned Mate-Desktop in another post) Thanks!

  8. @Rick,

    You can try indeed the Mate-desktop which should be less xorg demanding….we never checked if xrdp could take advantage of GPU…might be a coming post 🙂

    till next time
    See ya

  9. Hi,
    Yesterday I updated the system, then xrdp connection not work again!
    The xrdp login screen appears, but after logging in, a connection log window appears after several seconds and says:

    > connection to sesman ip 127.0.0.1 port 3350
    > sesmon connection ok
    > sending login info to session manager, please wait…
    > login successful for display 10
    > started connecting
    > connection problem, giving up
    > some problem

    The log is as below:

    sjsy@myServer:~$ journalctl -xe
    June 04 14:45:08 myServer xrdp[4736]: (4736)(140419935696640)[DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait…
    June 04 14:45:08 myServer xrdp[4736]: (4736)(140419935696640)[DEBUG] return value from xrdp_mm_connect 0
    June 04 14:45:08 myServer xrdp-sesman[4624]: (4624)(140542851483392)[INFO ] ++ created session (access granted): username sjsy, ip 10.15.21.83:10303 – so
    June 04 14:45:08 myServer xrdp-sesman[4624]: (4624)(140542851483392)[INFO ] starting Xorg session…
    June 04 14:45:08 myServer xrdp-sesman[4624]: (4624)(140542851483392)[DEBUG] Closed socket 9 (AF_INET 0.0.0.0:5910)
    June 04 14:45:08 myServer xrdp-sesman[4624]: (4624)(140542851483392)[DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6010)
    June 04 14:45:08 myServer xrdp-sesman[4624]: (4624)(140542851483392)[DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6210)
    June 04 14:45:08 myServer xrdp-sesman[4624]: pam_unix(xrdp-sesman:session): session opened for user sjsy by (uid=0)
    June 04 14:45:08 myServer systemd-logind[837]: New session c3 of user sjsy.
    — Subject: A new session c3 has been created for user sjsy
    — Defined-By: systemd
    — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    — Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat

    — A new session with the ID c3 has been created for the user sjsy.

    — The leading process of the session is 4624.
    June 04 14:45:08 myServer systemd[1]: Started Session c3 of user sjsy.
    — Subject: Unit session-c3.scope has finished start-up
    — Defined-By: systemd
    — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

    — Unit session-c3.scope has finished starting up.

    — The start-up result is done.
    June 04 14:45:08 myServer xrdp[4736]: (4736)(140419935696640)[INFO ] xrdp_wm_log_msg: login successful for display 10
    June 04 14:45:08 myServer xrdp-sesman[4624]: (4624)(140542851483392)[DEBUG] Closed socket 8 (AF_INET 127.0.0.1:3350)
    June 04 14:45:08 myServer xrdp-sesman[4738]: (4738)(140542851483392)[DEBUG] Closed socket 7 (AF_INET 127.0.0.1:3350)
    June 04 14:45:08 myServer xrdp[4736]: (4736)(140419935696640)[DEBUG] xrdp_wm_log_msg: started connecting
    June 04 14:45:08 myServer xrdp-sesman[4738]: (4738)(140542851483392)[DEBUG] Closed socket 8 (AF_INET 127.0.0.1:3350)
    June 04 14:45:08 myServer xrdp-sesman[4740]: (4740)(140542851483392)[INFO ] Xorg :10 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfi
    June 04 14:45:12 myServer xrdp[4736]: (4736)(140419935696640)[DEBUG] Closed socket 19 (AF_UNIX)
    June 04 14:45:15 myServer xrdp[4736]: (4736)(140419935696640)[DEBUG] Closed socket 19 (AF_UNIX)
    June 04 14:45:18 myServer xrdp-sesman[4738]: (4738)(140542851483392)[ERROR] X server for display 10 startup timeout
    June 04 14:45:18 myServer xrdp-sesman[4738]: (4738)(140542851483392)[CORE ] waiting for window manager (pid 4739) to exit
    June 04 14:45:18 myServer xrdp-sesman[4739]: (4739)(140542851483392)[ERROR] X server for display 10 startup timeout
    June 04 14:45:18 myServer xrdp-sesman[4739]: (4739)(140542851483392)[ERROR] another Xserver might already be active on display 10 – see log
    June 04 14:45:18 myServer xrdp-sesman[4739]: (4739)(140542851483392)[DEBUG] aborting connection…
    June 04 14:45:18 myServer xrdp-sesman[4738]: (4738)(140542851483392)[CORE ] window manager (pid 4739) did exit, cleaning up session
    June 04 14:45:18 myServer xrdp-sesman[4624]: pam_unix(xrdp-sesman:session): session closed for user sjsy
    June 04 14:45:18 myServer xrdp-sesman[4624]: (4624)(140542851483392)[INFO ] ++ terminated session: username sjsy, display :10.0, session_pid 4738, ip 10
    June 04 14:45:19 myServer xrdp[4736]: (4736)(140419935696640)[DEBUG] Closed socket 19 (AF_UNIX)
    June 04 14:45:22 myServer xrdp[4736]: (4736)(140419935696640)[DEBUG] Closed socket 19 (AF_UNIX)
    lines 1072-1114/1114 (END)

    *******************

    /var/log/xrdp-sesman.log:
    [20170604-14:45:18] [INFO ] ++ terminated session: username sjsy, display :10.0, session_pid 4738, ip 10.15.21.83:10303 – socket: 12
    [20170604-15:14:48] [INFO ] A connection received from 127.0.0.1 port 46832
    [20170604-15:14:48] [INFO ] ++ created session (access granted): username sjsy, ip 10.15.21.83:10303 – socket: 12
    [20170604-15:14:48] [INFO ] starting Xorg session…
    [20170604-15:14:48] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:5910)
    [20170604-15:14:48] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6010)
    [20170604-15:14:48] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6210)
    [20170604-15:14:48] [DEBUG] Closed socket 8 (AF_INET 127.0.0.1:3350)
    [20170604-15:14:48] [DEBUG] Closed socket 7 (AF_INET 127.0.0.1:3350)
    [20170604-15:14:48] [DEBUG] Closed socket 8 (AF_INET 127.0.0.1:3350)
    [20170604-15:14:48] [INFO ] Xorg :10 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log
    [20170604-15:14:58] [ERROR] X server for display 10 startup timeout
    [20170604-15:14:58] [CORE ] waiting for window manager (pid 4859) to exit
    [20170604-15:14:58] [ERROR] X server for display 10 startup timeout
    [20170604-15:14:58] [ERROR] another Xserver might already be active on display 10 – see log
    [20170604-15:14:58] [DEBUG] aborting connection…
    [20170604-15:14:58] [CORE ] window manager (pid 4859) did exit, cleaning up session
    [20170604-15:14:58] [INFO ] ++ terminated session: username sjsy, display :10.0, session_pid 4858, ip 10.15.21.83:10303 – socket: 12
    (END)

    I reinstalled it but the problem did not resolved.
    Can you please help me?
    Best,
    sjsy

  10. @sjsy,

    No clue so far… are you selecting the proper sesman session in the xrdp login box.. are you selecting the xorg option ?
    We have retested this procedure again and it still working for us…..
    So, no idea so far….

    Till next time
    See ya

  11. Hello Griffon,

    Thank you for these great posts, they have been very helpful.
    However, after many hours of attempting to get xrdp to work, I finally got it to work with mate desktop, but had issues with the keyboard. tried lxde but still had issues with the keyboard.
    I use the us english dvorak keyboard.

    I tried this script, but now when I try to log in to the remote server, I get a blank black screen.

    I noticed that in the previous version it was caused by vncserver not running, so I excuted it but no difference.

    What might I be missing?

  12. I ran the install script on Ununtu 16.04.02 LTS and XRDP fails to run due to: “error opening log file [The log is not properly started]. quitting.”

    Running sudo service xrdp start results in this: “A dependency job for xrdp.service failed. See ‘journalctl -xe’ for details.”

    Running sudo journalctl -xe results in this:
    Jun 20 10:27:10 mycomputer systemd[1]: xrdp-sesman.servic
    Jun 20 10:27:10 mycomputer systemd[1]: Failed to start xr
    — 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.
    Jun 20 10:27:10 mycomputer systemd[1]: Dependency failed
    — 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.
    Jun 20 10:27:10 mycomputer systemd[1]: xrdp.service: Job
    Jun 20 10:27:10 mycomputer systemd[1]: xrdp-sesman.servic
    Jun 20 10:27:10 mycomputer systemd[1]: xrdp-sesman.servic
    Jun 20 10:27:10 mycomputer sudo[3214]: pam_unix(sudo:sess
    Jun 20 10:28:01 mycomputer sudo[3265]: user : TTY=pts
    Jun 20 10:28:01 mycomputer sudo[3265]: pam_unix(sudo:sess
    lines 2425-2447/2447 (END)
    Jun 20 10:27:10 mycomputer systemd[1]: xrdp-sesman.servic
    Jun 20 10:27:10 mycomputer systemd[1]: Failed to start xr
    — 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.
    Jun 20 10:27:10 mycomputer systemd[1]: Dependency failed
    — 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.
    Jun 20 10:27:10 mycomputer systemd[1]: xrdp.service: Job
    Jun 20 10:27:10 mycomputer systemd[1]: xrdp-sesman.servic
    Jun 20 10:27:10 mycomputer systemd[1]: xrdp-sesman.servic
    Jun 20 10:27:10 mycomputer sudo[3214]: pam_unix(sudo:sess
    Jun 20 10:28:01 mycomputer sudo[3265]: user : TTY=pts
    Jun 20 10:28:01 mycomputer sudo[3265]: pam_unix(sudo:sess
    ~
    lines 2425-2447/2447 (END)

    Jun 20 10:27:10 mycomputer systemd[1]: xrdp-sesman.service: Control process exited, code=exited status=203
    Jun 20 10:27:10 mycomputer 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.
    Jun 20 10:27:10 mycomputer 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.
    Jun 20 10:27:10 mycomputer systemd[1]: xrdp.service: Job xrdp.service/start failed with result ‘dependency’.
    Jun 20 10:27:10 mycomputer systemd[1]: xrdp-sesman.service: Unit entered failed state.
    Jun 20 10:27:10 mycomputer systemd[1]: xrdp-sesman.service: Failed with result ‘exit-code’.
    Jun 20 10:27:10 mycomputer sudo[3214]: pam_unix(sudo:session): session closed for user root
    Jun 20 10:28:01 mycomputer sudo[3265]: user : TTY=pts/2 ; PWD=/home/user ; USER=root ; COMMAND=/bin/journalctl -xe
    Jun 20 10:28:01 mycomputer sudo[3265]: pam_unix(sudo:session): session opened for user root by (uid=0)

    Has anyone else run into this? Any help would be appreciated, thanks!

  13. /var/log/xrdp.log was missing for some reason. Sorry about all the spam for such a simple issue!

  14. I found more issues. In my /lib/systemmd/system/xrdp.service file and in the xrdp-sesman.service file I found the following lines:

    ExecStart=/usr/local/local/sbin/xrdp $XRDP_OPTIONS
    ExecStop=/usr/local/local/sbin/xrdp $XRDP_OPTIONS –kill

    I removed the duplicate /local directory and now xrdp service runs. Now when I try to log in via RDP from windows I get the same error as sjsy above:

    > connection to sesman ip 127.0.0.1 port 3350
    > sesmon connection ok
    > sending login info to session manager, please wait…
    > login successful for display 10
    > started connecting
    > connection problem, giving up
    > some problem

  15. @sjsy:

    The problem seems to be the Xorg startup. At the end of /home//.xorgxrdp.10.log you can find:

    .
    .
    Fatal server error:
    [ 10381.609] (EE) xf86OpenConsole: Cannot open /dev/tty0 (No such file or directory)
    [ 10381.609] (EE)
    [ 10381.609] (EE)
    .
    .

    Greetings

    Michael

  16. I figured out, that the xorgxrdp-Package was not configured and installed correctly.
    I repeated the required steps from the script manually and changed sesman.ini:

    [Xorg]
    param=Xorg
    param=-config
    #param=xrdp/xorg.conf
    param=/xrdpdev/xorg.conf
    param=-noreset
    param=-nolisten
    param=tcp
    param=-logfile
    param=.xorgxrdp.%s.log

  17. I’ve been trying to get the above script to work and may have found a couple statements missing or in error.
    I kept having xrdp-sesman service not start then I noticed in the script there was not command to enable it:

    Because of that xrdp itself failed to start because xrdp-sesman is a dependency.

    adding the following corrected it xrdp then started as it should:
    $ sudo systemctl enable xrdp-sesman.service

    also in the script it states for ubuntu:

    #Replace /sbin/xrdp with /sbin/local/xrdp as this is the correct location
    that should be:
    #Replace /sbin/xrdp with /usr/local/sbin/xrdp … at least thats where its located on my ubuntu 16.04.2 system.

    I did not download the script but cut & pasted from above so if the downloaded script is different pardon me.

    Brian

  18. @Brian,

    Thank you very much for the info and the feedback…we will update the post and take into account your comments and findings… There is indeed a typo in the post provided about the location of the xrdp files….
    we will try to act on it today but I have to see that I’m having a hard time publishing info and updates lately….we are reaching a deadline for a project and my time now is really really limited..
    Again thank again to help us providing your support…

    Till next time
    See ya

  19. @Michael S.

    Thank you for the feedback. we are reviewing this post in order to check if we didn’t overlooked something or simply uploaded the wrong script…
    Till next time
    See ya

  20. @Tom,

    We are looking at this issue. We are updating the post in order to take into account the recent comments..
    Be patient as we are really really busy lately…
    Till next time
    See ya

  21. @Igor,

    thank you very much for the feedback and positive comments… We are trying to provide good content and we are taking into account comments and remarks in order to improve these posts

    Till next time
    See ya

  22. for more information I have this log in /var/log/xrdp-sesman.log

    [20171116-16:52:03] [ERROR] X server for display 10 startup timeout
    [20171116-16:52:03] [ERROR] another Xserver is already active on display 10
    [20171116-16:52:03] [DEBUG] aborting connection…
    [20171116-16:52:03] [INFO ] ++ terminated session: username jrichard, display :10.0, session_pid 31954, ip 10.201.10.186:58176 – socket: 7
    [20171116-16:55:02] [INFO ] shutting down sesman 1
    [20171116-16:55:02] [CORE ] starting sesman with pid 10172
    [20171116-16:55:02] [INFO ] listening…
    [20171116-16:56:13] [INFO ] shutting down sesman 1
    [20171116-16:56:13] [CORE ] starting sesman with pid 10481
    [20171116-16:56:13] [INFO ] listening…
    [20171116-16:56:33] [INFO ] scp thread on sck 7 started successfully
    [20171116-16:56:34] [INFO ] ++ created session (access granted): username jrichard, ip 10.201.10.186:58672 – socket: 7
    [20171116-16:56:34] [INFO ] starting Xvnc session…
    [20171116-16:56:34] [INFO ] starting xrdp-sessvc – xpid=10557 – wmpid=10556
    [20171116-16:58:18] [INFO ] ++ terminated session: username jrichard, display :10.0, session_pid 10555, ip 10.201.10.186:58672 – socket: 7
    [20171116-17:01:32] [INFO ] scp thread on sck 7 started successfully
    [20171116-17:01:32] [INFO ] ++ created session (access granted): username jrichard, ip 10.201.10.186:59166 – socket: 7

  23. @Julien,

    first, Can you explain your problem in more details
    Secondly, I noticed that you are referring to an old post (Ubuntu 16.0.4.2)..some updates have been integrated since then which kind of break the process as described in the post you are ferring to. You should have a look at the following post http://c-nergy.be/blog/?p=10993. In this post, we explained possible issues you might encounter with Ubuntu 16.04 updates

    Give it a try and provide us feedback
    Till next time
    See ya

Leave a Reply