Install xrdp and x11rdp on Ubuntu server

Simple steps to install xrdp and x11rdp on Ubuntu server.

To install xrdp and x11rdp on Ubuntu server, refer to the following steps but make sure that you are logged in as a root user.

sudo apt-get install xrdp

sudo apt-get build-dep xserver-xorg-core

sudo apt-get install gnome-session-fallback

aptget install ubuntu-desktop

Create the new directory X11rdp

sudo mkdir /opt/X11rdp

cd /opt/X11rdp/

Download the laytest x11rdp tar file from the http://server1.xrdp.org/xrdp/ website

wget http://server1.xrdp.org/xrdp/x11rdp_xorg71.tar.gz

tar -xvf  x11rdp_xorg71.tar.gz

cd x11rdp_xorg71

sudo sh buildx.sh /opt/X11rdp –with-fontdir=/usr/share/fonts/X11

Once compilation completed run the following command

cd /opt/X11rdp/bin

Now we need to create the soft link for X11rdp binary in to /usr/bin directory

sudo ln -s /opt/X11rdp/bin/X11rdp /usr/bin/X11rdp

You can test if your binary runs without crashing now by typing; it will show you some error about fonts but you can ignore it or check for bugs

/usr/bin/X11rdp :1

You can try to use :2 or :3 if :1 is already in use bu vnc ..

Create the .xsession file in your home directory and insert the following text in it

sleep 1 gnome-session –session=ubuntu-2d
or
gnome-session –session=ubuntu-2d

If you receive the error about ubuntu-2d than refer to the following steps.

You can edit the file  /etc/xrdp/startwm.sh as per your desktop requirement in RDP.

Simply add the following BOLD line from startwm.sh script .

#!/bin/sh

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

echo gnome-session –session=gnome-fallback > ~/.xsession
. /etc/X11/Xsession

You can also use the following parameter.

If you want to use GNOME Fallback (“GNOME Classic (no effects)”) insert the following in the startwm.sh file

  • echo gnome-session –session=gnome-fallback > ~/.xsession

Or, to use Xfce (“Xubuntu Session”):

  • echo xfce4-session > ~/.xsession

Or, to use LXDE (“Lubuntu Desktop”):

  • echo lxsession -s Lubuntu -e LXDE > ~/.xsession
And it should work. Everytime you login to the remote-session the file .xsession will be created.

 

 

About Anant 384 Articles
Senior technical writer