XRDP- HowTo Custom install on Ubuntu 16.04.x with Unity Interface (install-xrdp-1.9.2.sh)

Hello World, 

Ubuntu 18.04 is on its way and we are already looking and preparing some posts about xRDP and this exciting to come LTS Ubuntu Release.   However, Ubuntu 16.04 is also an LTS release and some people might be still using it for the coming years as well.  The problem with Ubuntu 16.04 is that the xrdp package that ship by default is an outdated package (version 0.6.1) compared to the version available on the xRDP web site (version 0.9.5).     This outdated package provides limited Remote desktop capabilities as it’s not providing Drive Redirection nor Clipboard support.  

To overcome this situation, one approach consist of perform an custom installation from sources binaries.    To provide easy installation and automation on Ubuntu systems, a little script has been developed that can be used to perform a custom installation of xRDP.  The script exists for some time now and has been updated with the different Ubuntu versions or features that would be made available with time.  

Because Ubuntu 16.04 is an LTS release, we have decided to update the install-xrdp.sh script and check that this is still working with the recently Unity Update made available by Canonical. Minor changes have been made. It’s more about cleanup of the code and removal of unnecessary code. 

So, let’s move on ! 

The Custom Installation Script – Version 1.9.2

Overview

The version 1.9.2 script has been updated and tested on the latest Ubuntu 16.04 version (16.04.4).  The updates are mainly cosmetic. 

  • We have updated the code used to detect the Ubuntu version (version 1.9.1 had an invalid code but has been fixed since then…:-) ).
  • We have updated the code to check if Unity Desktop is in used or not
  • We have updated the polkit section.  A specific group (i.e. users) has been used
  • This script configure the system to allow  multipe users by default (no need to create for each user a .xsession file)
  • Cleanup a little bit the code and add some additional checks as needed
  • We have changed the section where the fontutil.h file was created because of a small bug in Ubuntu 16.04.3. Apparently, the bug has been fixed (*)

(*) When Ubuntu 16.04.3 was released initially, a bug was identified which was preventing the installation of a custom xRDP package.  These bugs have been fixed and there is not need anymore to recreate the fontutil.h file on the system.   You can find more information about these changes in behavior and bugs in the following posts 

As this bug has been fixed, there is no need to create the file through the script but the script still check if needed or not to recreate the file 

Assumptions

Before running this script, be aware of the following assumptions

  • We have tested the script on Ubuntu 16.04 Update 3 and Update 4. 
  • The script should be working on Ubuntu 16.04 (whatever the Update version) 
  • 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 and Virtual box 
  • This script configure the .xsession file for  multipe users.

 

u16044_1

Click on Picture for Better Resolution

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.9.2

A downloadable version of the script is available at bottom of the post….. 

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

#----------------------------------------------------------------# 
# Step 0 - Try to Detect Ubuntu Version and Unity.... 
#----------------------------------------------------------------#
clear
#Checking Ubuntu Version
echo
/bin/echo -e "\e[1;32m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m" 
/bin/echo -e "\e[1;32m Dectecting Ubuntu Version and Desktop in use...\e[0m"
/bin/echo -e "\e[1;32m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m"

version=$(lsb_release -d | awk -F":" '/Description/ {print $2}')

if [[ $version=*"Ubuntu 16.04"* ]]; then 
echo
/bin/echo -e "\e[1;33m Ubuntu Version :$version\e[0m"
else 
/bin/echo -e "\e[1;31m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m" 
/bin/echo -e "\e[1;31mYour system is not running Ubuntu 16.04 Edition.\e[0m" 
/bin/echo -e "\e[1;31mThe script has been tested only on Ubuntu 16.04.x...\e[0m" 
/bin/echo -e "\e[1;31mThe script is exiting...\e[0m" 
/bin/echo -e "\e[1;31m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m" 
echo
exit 
fi

#Checking if Unity Desktop in Use

if [ "$XDG_CURRENT_DESKTOP"="Unity" ] 
then 
/bin/echo -e "\e[1;33m Desktop interface Detected....: $XDG_CURRENT_DESKTOP\e[0m" 
echo 
else 
/bin/echo -e "\e[1;31m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m" 
/bin/echo -e "\e[1;31mYour system is not running Unity Desktop Interface.\e[0m" 
/bin/echo -e "\e[1;31mThe script has been written to enable Unity Desktop in remote session...\e[0m" 
/bin/echo -e "\e[1;31mThe script is exiting...\e[0m"
/bin/echo -e "\e[1;31m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m"
exit 
fi

#---------------------------------------------------#
# Step 1 - Download XRDP Binaries... 
#---------------------------------------------------#

/bin/echo -e "\e[1;32m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m" 
/bin/echo -e "\e[1;32m Downloading xRDP binaries and tools...\e[0m"
/bin/echo -e "\e[1;32m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m" 
echo
/bin/echo -e "\e[1;33m Installing Git....Proceeding \e[0m"
echo 
sudo apt-get -y install git
echo
cd ~/Downloads

## -- Download the xrdp latest files
echo
/bin/echo -e "\e[1;33m Preparing download xrdp package...Proceeding\e[0m"
echo
git clone https://github.com/neutrinolabs/xrdp.git
echo
/bin/echo -e "\e[1;33m Preparing download xorgxrdp package...Proceeding\e[0m"
echo
git clone https://github.com/neutrinolabs/xorgxrdp.git


#---------------------------------------------------#
# Step 2 - Install Prereqs... 
#---------------------------------------------------#
echo
/bin/echo -e "\e[1;33m Installing Prereqs....Proceeding\e[0m" 
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 pkg-config

#---------------------------------------------------#
# Step 3 - Check if Fontutil.h file exists... 
#---------------------------------------------------#

#checking if file exists...
echo
/bin/echo -e "\e[1;33m Checking fontutil.h file....Proceeding\e[0m" 
echo

file="/usr/include/X11/fonts/fontutil.h"

if [ -f "$file" ]
then
echo 
/bin/echo -e "\e[1;37m Fontutil.h exist...Moving Next step \e[0m"
echo
else
echo
/bin/echo -e "\e[1;37m Fontutil.h will be created by script...Proceeding \e[0m"

echo
cat >/usr/include/X11/fonts/fontutil.h <<EOF
#ifndef _FONTUTIL_H_
#define _FONTUTIL_H_

#include <X11/fonts/FSproto.h>

extern int FontCouldBeTerminal(FontInfoPtr);
extern int CheckFSFormat(fsBitmapFormat, fsBitmapFormatMask, int *, int *,
 int *, int *, int *);
extern void FontComputeInfoAccelerators(FontInfoPtr);

extern void GetGlyphs ( FontPtr font, unsigned long count,
 unsigned char *chars, FontEncoding fontEncoding,
 unsigned long *glyphcount, CharInfoPtr *glyphs );
extern void QueryGlyphExtents ( FontPtr pFont, CharInfoPtr *charinfo,
 unsigned long count, ExtentInfoRec *info );
extern Bool QueryTextExtents ( FontPtr pFont, unsigned long count,
 unsigned char *chars, ExtentInfoRec *info );
extern Bool ParseGlyphCachingMode ( char *str );
extern void InitGlyphCaching ( void );
extern void SetGlyphCachingMode ( int newmode );
extern int add_range ( fsRange *newrange, int *nranges, fsRange **range,
 Bool charset_subset );

#endif /* _FONTUTIL_H_ */
EOF
 
fi

#---------------------------------------------------#
# Step 4 - compiling... 
#---------------------------------------------------#
# -- Compiling xrdp package first

echo
/bin/echo -e "\e[1;32m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m" 
/bin/echo -e "\e[1;32mXRDP Compilation about to start !... \e[0m"
/bin/echo -e "\e[1;32m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m"
echo

cd ~/Downloads/xrdp
sudo ./bootstrap
sudo ./configure --enable-fuse --enable-jpeg 
sudo make

#-- check if no error during compilation

if [ $? -eq 0 ]
then 
echo
/bin/echo -e "\e[1;37m-----------------------------------\e[0m"
/bin/echo -e "\e[1;37mMake Operation Successful ! \e[0m"
/bin/echo -e "\e[1;37m-----------------------------------\e[0m"
echo
else 
echo
/bin/echo -e "\e[1;31m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m"
/bin/echo -e "\e[1;31mError while executing make.\e[0m"
/bin/echo -e "\e[1;31mThe script is exiting...\e[0m"
/bin/echo -e "\e[1;31m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m"
echo
exit
fi
sudo make install

# -- Compiling xorgxrdp package first

echo
/bin/echo -e "\e[1;32m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m" 
/bin/echo -e "\e[1;32mxorgxrdp Compilation about to start !... \e[0m"
/bin/echo -e "\e[1;32m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m"
echo
cd ~/Downloads/xorgxrdp 
sudo ./bootstrap 
sudo ./configure 
sudo make

# check if no error during compilation 
if [ $? -eq 0 ]
then 
echo
/bin/echo -e "\e[1;37m-----------------------------------\e[0m"
/bin/echo -e "\e[1;37mMake Operation Successful ! \e[0m"
/bin/echo -e "\e[1;37m-----------------------------------\e[0m"
echo
else 
/bin/echo -e "\e[1;31m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m"
/bin/echo -e "\e[1;31mError while executing make.\e[0m"
/bin/echo -e "\e[1;31mThe script is exiting...\e[0m"
/bin/echo -e "\e[1;31m!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\e[0m"
echo
exit
fi
sudo make install

#---------------------------------------------------#
# Step 5 - create policies exceptions .... 
#---------------------------------------------------#

echo
/bin/echo -e "\e[1;33m Creating Polkit file...Proceeding\e[0m" 
echo

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(“{users}”)) {
return polkit.Result.YES;
}
});
EOF

#---------------------------------------------------#
# Step 6 - configure Xwrapper file .... 
#---------------------------------------------------#

echo
/bin/echo -e "\e[1;33m Configuring Xwrapper(optional)...Proceeding\e[0m" 
echo

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

#---------------------------------------------------#
# Step 7 - Populate the .xsession file multi-users # 
#---------------------------------------------------#

echo
/bin/echo -e "\e[1;33m Configuring startwm.sh for multi-users login...Proceeding\e[0m" 
echo

sudo sed -i.bak "/# auth /a cat >~/.xsession << EOF\n#Unity Xrdp multi-users \n/usr/lib/gnome-session/gnome-session-binary --session=ubuntu &\n/usr/lib/x86_64-linux-gnu/unity/unity-panel-service &\n/usr/lib/unity-settings-daemon/unity-settings-daemon &\nfor indicator in /usr/lib/x86_64-linux-gnu/indicator-*;\ndo\nbasename='basename \\\\\${indicator}'\ndirname='dirname \\\\\${indicator}'\nservice=\\\\\${dirname}/\\\\\${basename}/\\\\\${basename}-service\n\\\\\${service} &\ndone\nunity\nEOF" /etc/xrdp/startwm.sh

#---------------------------------------------------#
# Step 8 - create services .... 
#---------------------------------------------------# 
echo
/bin/echo -e "\e[1;33m Creating xRDP Services...Proceeding\e[0m" 
echo

sudo systemctl daemon-reload
sudo systemctl enable xrdp.service
sudo systemctl enable xrdp-sesman.service
sudo systemctl start xrdp

#---------------------------------------------------#
# Step 9 - install additional packages .... 
#---------------------------------------------------#

echo
/bin/echo -e "\e[1;33m Installing xserver-xorg-core pacakges...Proceeding\e[0m" 
echo
sudo apt-get -y install xserver-xorg-core

echo
/bin/echo -e "\e[1;33m checking Virtualization Platform...Proceeding\e[0m" 
echo

vmversion=$(sudo dmidecode -s system-product-name)
echo $vmversion
if [ "$vmversion" = "VirtualBox" ]
then 
 sudo apt-get -y install xserver-xorg-input-all
else
 echo "no additional package needed" 
fi
 
/bin/echo -e "\e[1;32m----------------------------------------------------------\e[0m"
/bin/echo -e "\e[1;32mInstallation Completed\e[0m"
/bin/echo -e "\e[1;32mPlease test your xRDP configuration....\e[0m"
/bin/echo -e "\e[1;32mCheck c-nergy.be website for latest version of the script\e[0m"
/bin/echo -e "\e[1;32mwritten by Griffon - March 2018 - Version 1.9.2\e[0m"
/bin/echo -e "\e[1;32m----------------------------------------------------------\e[0m"
echo

How to Use the Script

Set Execute Right on the script

As before, you first need to download the install-xrdp-1.9.2.sh script to your system. Then you  have to mark it as executable so the system can run this script. To do this, simply right-click on the file, go to properties, then select permissions tab and tick the box allow executable….

u16044_2

Click on Picture for better resolution 

or from the command line, issue the following command

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

Note : Adjust the path where the install-xrdp-1.9.2.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 

./install-xrdp-1.9.2.sh  

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

u16044_3

Click on Picture for better resolution 

Wait for completion of the script.  The machine will not reboot automatically when done so you can review the actions performed by the script….

u16044_4

Click on Picture for better resolution 

Test your xRDP Infrastructure

It’s time to check if XRDP is working as expected !  Open your remote desktop client, insert the name or ip address of the remote Ubuntu machine and try to connect.  If the xRDP service is started, you will see the usual xRDP Login screen with the green background.

U1704_xrdp_3

Click on picture for better resolution

Type in your user account and password and after some time, you should have access to your Unity Desktop interface through the Remote Desktop client. 

u16044_5

Click on picture for better resolution

In Ubuntu 16.04.x, you can have the same user logged into the console and to the remote session and this scenario would work.  In later version of Ubuntu, it seems that the behavior has changed…  The user will be able to reconnect to an existing session as well and the user will be able to use the clipboard and drives redirection features.. 

Issues detected 

No new real issues detected in this version so far.   

Logout options

In this version, you can click on the logout option and this should be normally work out of the box. We have tried two three times and it seems to works (even do it’s a little bit slow).  If you have issues with logout actions, as in our previous posts, you can try to use the following command line (or make a custom shortcut that users can they use to logout in one step)

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

Applications

We have checked that standard applications could be used through the remote desktop session.  Firefox starts up and we can browse internet, we have started up software center and we can install software. so far, all in all, we are able to perform some works through the remote desktop solution 

Performance 

We are not sure if it’s because we have really small virtual machines (only 2GB of RAM) but performance are not that great.  There can be long latency between the moment you have clicked a button and the action that should start after clicking.  We think that performance should be acceptable and people should be able to work if the remote machine has the necessary resources to run Unity Desktop Interface. 

Virtualization Platform 

On VirtualBox, after installing the xserver-xorg-core packages, we have noticed that it was not possible to login back into the Ubuntu machine directly (not through remote desktop session). This seems to be caused by the fact that keyboard and mouse drivers are removed during the install process (do not know how do).  So, to overcome this limitation, the script check for the virtualization platform (virtualbox or others) and add an additional xserver-xorg package so it’s still possible to login locally on the ubuntu machine.   The problem does not exist on Hyper-v…  

The script is taking care of this so the user does not need to perform any additional actions to overcome this possible limitation….

 

Download the Script 

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

 

Bonus : A Quick Demo…. 

 

34 thoughts on “XRDP- HowTo Custom install on Ubuntu 16.04.x with Unity Interface (install-xrdp-1.9.2.sh)

  1. One minor headsup – I’ve ran the script in ~ and there are a few things you might want to add:

    apt install build-essentials pkg-config

    also, the script at one point changes directory to ~/Downloads/xrdp, but the folder was downloaded to ~/xrdp. I’ve manually changed the shell script and it works fine

  2. @Kit Ng

    we have added the pkg-config in the script but we will not add the build-essentials as do not want to generate deb packages….
    We will check the script again but If i go through, we are using cd ~/Downloads before downloading the xrdp package so the correct location should be ~/Downloads

    Thank you for the feedback and the positive comments…We will double check some of the things again..
    Till next time
    See ya

  3. The Script works fine.

    On a new standard Ubuntu installation there is no ~/Downloads for root only for the users.
    So maybe you ran the script as root ?

    For me the script works when when i run it as a user with sudo but fails as root because of not existing ~/Downloads
    See ya

  4. Thank you for this script! I’ve used it twice – also the 1.9 version.
    One question: after I have executed the script, xrdp –version is still reporting 0.9.4
    xrdp –version

    xrdp: A Remote Desktop Protocol server.
    Copyright (C) Jay Sorg 2004-2014
    See http://www.xrdp.org for more information.
    Version 0.9.4

    Shouldn’t that be 0.9.5?

    Thanks!

  5. Found a minor issue when starting to compile, it couldn’t checkout the submodule due to a permission error. Some folders ended up being owned by root inside the xrdp folder.

  6. @Gabe;

    We didn’t encounter this issue… we will check this and come back with an update
    thank you for your feedback and your visit
    till next time
    See ya

  7. @Peter,

    Indeed, the version of xrdp should show 0.9.5. We will check that the script is getting the latest binaries from xrdp web site and come back with an update if needed
    Thank yo for the feedback and for visiting our blog
    till next time
    See ya

  8. @Someguy,

    have you read the instructions correctly ? the script should be started as a normal user and during the execution of the script, you will be prompted for sudo password. this should be working as demonstrated on the video
    Thank you for the feedback and the visit
    Till next time
    See ya

  9. I just tried the script on a fresh installation of Ubuntu 16.04.4 LTS, and it works without a problem. And the clipboard function works as well. Thanks so much for this!

  10. @Goran,
    Thank you for your feedback and visiting our blog… We happy to see that the work and effort we put on the script can be useful and that’s working for you…
    Till next time
    See ya

  11. After running this script, my system has refused to accept input from the local keyboard and mouse. Any immediate thoughts on how to fix this?

  12. @Jim,

    You have to re-install the following package sudo apt-get -y install xserver-xorg-input-all
    to re-install it, you have either to use SSH or xrdp if enabled and working or you have to boot your server in repair mode and perform the installation of the package…
    This is a known issue….and has been described in the issue detected Virtualization platform

    Hope this help
    Till next time
    See ya

  13. A couple of things… thanks for the script….

    I’ve got a bug on a fresh install of 16.04.4, the “if” at the top where its checking for the version number isn’t working. I just “else-s” out.

    When I check:
    username@hostname:~$ lsb_release -d
    Description: Ubuntu 16.04.4 LTS
    version=$(lsb_release -d | awk -F”:” ‘/Description/ {print $2}’)
    echo $version
    Ubuntu 16.04.4 LTS

    Also we are currently using smbd/winbind on these machines to allow users to logon to them using their AD IDs. I found when they had an account on the box prior to running the scripts it worked great. Any new user who didn’t have an account, didn’t work. Solution. Copy the .xsession file to /etc/skel so that any “new” user will have that file to drawn the desktop.

  14. @SteelRat,

    The script checks for the string Ubuntu 16.04 only. So, this script should be working for any version of Ubuntu 16.04 version (i.e. Ubuntu 16.04.3 or 16.04.4 version)
    We will check that the Ubuntu version check is working and fix it if necessary

    Thank for the feedback and visiting our blog
    Till next time
    See ya

  15. I’m not seeing window decorations or the unity menu at the top of the desktop. Any ideas?

    Also, I have some users who would rather have xfce4. Attempted to override by placing the xfce4-session in their home dir .xsession. It didn’t work. How do we accomplish that?

    Thanks

  16. Wow! A little draconian to *force* only unity, don’t you think? I found my fix. The /etc/xrdp/startwm.sh overwrites everyone’s .xsession everytime the window manager starts…

    We commented this out. Still, very good tut.

  17. @Sprocket12,

    if you read the title of the post, we are assuming that your will run the script on Ubuntu 16.04.x where Unity is the default Desktop interface…Now indeed if you want to use different interface, you can per user customize the ~/.xsession file. This was the technique used with the previous script version.. but again,as people working in corporate infrastructure, they tend to use a unique Desktop interface and usually it’s Unity for Ubuntu 16.04
    Thank for the visit and the feedback
    Till next time
    See ya

  18. @sprocket12,

    double check the content of .xsession for the user. Some people reported already this issue but we are not able to replicate this….as we are working exclusively with virtual infrastructure, we never had this issue since we populating the .xsession file with additional commands to be executed at login

    For the users with different desktop, you need to change the /etc/xrdp/startwm.sh file and modify the ~/.xsession file for these users then

    Till next time
    See ya

  19. Hi,

    I’m trying to run this script on Ubuntu 16.04.4 and I get this error message:

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Dectecting Ubuntu Version and Desktop in use…
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    ./install-xrdp-1.9.2.sh: 26: ./install-xrdp-1.9.2.sh: [[: not found
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Your system is not running Ubuntu 16.04 Edition.
    The script has been tested only on Ubuntu 16.04.x…
    The script is exiting…
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Is that what is expected to happen?

    I have been trying for some time now to get xrdp up and running on my system and nothing has worked to day. My latest attempt involved version 1.9 of the script, before that I followed the easy instructions on your blog. The closest I have gotten so far is an exit message of “login failed for display 0”. Nothing seems to work.

    Regards,
    Paul.

  20. @Peo Manson,

    thank you for visiting our blog and sharing your experience…nice to hear that a post can be useful time to time 🙂
    Till next time
    See ya

  21. @Paul;
    No, this is not a normal behavior…Normally, the script should detect the version 16.04 using wildcart approach but it’ does not seem to work on your system
    are you sure your system is running bash or sh ? Error is usually generated when using sh shell…
    What do you see when you type /bin/bash –version (-> it should output bash and not shell)
    Can you try the following…
    from command line type /bin/bash ./test.sh and see if it works

    if not working, comment the line exit in the check Ubuntu version section and the script should go through
    Hope this help

    Till next time
    See ya

  22. Have installed custom script, works like a charm only….not when I install the Nvidia drivers. I need these drivers to run cuda (cuda needs the nvidia drivers installed) in order to do datascience research. I also need to be able to remotely connect to the machine.
    1) If I uninstall the Nvidia drivers, everything works again.
    2) Its perfectly ok, not to use the Nvidia when accessing Xrdp, as long as I can access the nvidia from the command prompt
    I’ve read a lot on the internet about this problem in particular GLX not being able to use openGL this way.
    I’m ok with that.

    – Could you give me a setup / solution in which the graphical drivers (nvidia) are not invoked when accessing xrdp, while I have the Nvidia drivers installed?
    – Obviously, best solution is when the nvidia GPU would be used, but this seems out of reach.

    Best I found so far: https://github.com/neutrinolabs/xrdp/issues/721

    Much appreciated upfront,

    Kindest regards
    Roland Zoet

  23. @ReZoet,

    Sorry for the delays in our responses we have been working quite a lot lately…We are happy that you have found a solution for your issues. Thank you for sharing your findings with this blog so info can be spread

    Till next time
    See ya

  24. Hello Griffon,

    First of, thanks for this excellent articles suite on xRDP. I was using the older version with Mate but needed the copy/paste ability.

    Looks like I’m the unlucky one though as I got every single issues you reported on. All fixed. But one remains. It is possibly similar to sprocket12’s one. I can go thru the xRDP logon. But once in, I only get the desktop part. No upper window bar and no docking panel on the left.

    The xRDP connection also takes over the console desktop.

    That makes it pretty hard to do anything at this point. At least, copy/paste works though. I tried reinstalling the whole kit but that didn’t work.

    Any ideas on how to get the docking panel and upper bar back would be appreciated.

    G.

  25. @Guy,

    can you provide a screenshot of your desktop in xRDP ? When remote login into your ubuntu, on the desktop with no dock bar and no upper windows, can you right click on the desktop, and select run terminal
    In the terminal, can you type unity. If this loads your Desktop interface correctly, this means that something is wrong in the .xsession file

    Hope this help
    Till next time
    See ya

  26. Hi Paul,
    I also encountered the issue with:

    ./install-xrdp-1.9.2.sh: 26: ./install-xrdp-1.9.2.sh: [[: not found
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Your system is not running Ubuntu 16.04 Edition.

    Just insert the following line as the first line of the install-xrdp-1.9.2.sh
    #!/bin/bash

    ABJ

  27. Hi Griffon,

    Here is the screen shot. A menu bar magically appears now, it was not there before. However, the normal top bar is not there nor the docking panel.
    https://www.dropbox.com/s/xalqpu9c03b4hwb/xRDPInitial.PNG?dl=0

    A reconnection didn’t show any improvements.

    Another thing to note, the top bar (the one with the X to close and minimize/maximize buttons) of any window is absent.

    When I ran “unity” from the xRDP session, it disconnected the session. I went to the console to see what had happened there. Same as before, top bar and docking had disappeared. So just for fun I ran “unity” from a terminal window on the console. It started a loop of “error spawning command line…” and eventually froze with several of this window showing up: https://www.dropbox.com/s/uafu2rl7xuuhcyd/SystemError.PNG?dl=0 and while looping, you could see the docking panel appearing and disappearing.

    I went back to the still open xRDP session and, low and behold, the top bar and the docking panel were there. The other windows top bars (with the closing X) were there too. The icons on the right of the top bar (system/keyboard/screen) are the same but bring the proper options when clicked.

    Here is the content of the .xSession file:
    ————————————-
    #Unity Xrdp multi-users
    /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
    ————————————-
    I checked the folders referenced in the for loop. There is 9 of them, each with an executable binary in it.

    So, running “unity” from the console session fixes the xRDP one but freezes the console one.

  28. @ABJ;

    This can fix the issue as long as the /bin/bash is pointing to the correct executable. Some software replace the bash engine with another one and simply create a symlink for this..So, even placing this line might not guarantee that the script will run for sure…

    Till next time
    See ya

  29. @Guy,
    Juss a Guess/idea… The problem seems to be related to the .xsession file…. This was the case in some previous versions of Ubuntu that the .xsession file trick was not working….. So To test and validate this intuition….

    So delete the content of the .xsession file and comment the section about unity desktop in the /etc/xrdp/startwm.sh file
    Reboot your machine and try to connect remotely….what you should see is a purple background with no bar no Docs…If you right-click on the desktop, select Open Terminal and type exec unity, is the Unity desktop loading accordingly ?

    Is the Ubuntu machine a virtual machine or physical machine, are you using NVIDIA drivers ?

    Till next time
    See ya

  30. Works great! Except I’m having intermittent issues with the ALT keys — e.g., ALT-TAB to switch applications, ALT+F4 to close an application; ALT+SPACE to bring up the menu of the application I’m in. I’ve double-checked that the keyboard shortcuts for those tasks are indeed set to those keys in system settings. Has anybody seen anything like this?

  31. @Justin,

    We have seen this issues in the past or similar issues with keyboards (see http://c-nergy.be/blog/?p=3858) but since then we have seen less and less issues related to that…. Plus you mentioning that the issue is intermittent…
    We would need to perform some additional testings to see if this happens in a recurring manner and see if this can be fixed….
    If anybody has seen that or solved this issue; feel free to post a comment 🙂

    till next time
    See ya

Leave a Reply