Open up a terminal session on your desktop, and type
1 | sudo apt-get install xrdp
|
The xrdp package and any dependencies will be
downloaded automatically, and installed. The package install scripts
will also set up the RSA keys needed for encrypted RDP sessions and will
create a default xrdp configuration in /etc.
This tutorial should work fine on all Debian-based distributions like
Ubuntu, for example. If you’re using an RPM-based distribution then
you’ll have to adapt the steps to suit yourself.
Install xrdp.
Open up a terminal session on your desktop, and type
1 | sudo apt-get install xrdp
|
The xrdp package and any dependencies will be
downloaded automatically, and installed. The package install scripts
will also set up the RSA keys needed for encrypted RDP sessions and will
create a default xrdp configuration in /etc.
Now, at this point, you should be able to load up your favourite
Terminal Server client utility, and connect to the xrdp login screen,
here’s an example of that straight after I installed xrdp on my virtual
machine. Remember to set your rdp client to 8 or 16 bit color depth – I always use 16 bit anyway;
Client connection window
Set the color depth to 8 or 16 bit
Xrdp login screen
xrdp session after login
And here’s the session running after successfully logging in via the xrdp login window.
You may be wondering why do anything more – the thing’s working, right? Well, it is, but xrdp at the moment is using vnc4server, which was automatically installed as a dependency when I installed the xrdp package earlier. VNC
is another method of getting a remote desktop session. Because VNC is
pixel-based, speed and performance-wise it’s great over a local network,
but if you’re logging in remotely over the internet, it’s simply not as
good as using a genuine RDP session, so we need a way to obtain a
genuine RDP session.
And this is where the fun starts…
Obtaining the X11RDP binary…
You’d think that when you installed the xrdp package that it would
have included the x11rdp binary, but for some reason this isn’t the case
– perhaps because currently the X11rdp binary itself is a complete pain
to build – mainly due to it being built against a single snapshot of
the Xorg source code – and therefore a complete pain to package. So, we
need to build our own binary from source.
First, ensure you have the necessary utilities and development libraries needed for building from the source…
1 | sudo apt-get build-dep xserver-xorg-core
|
apt-get build-dep <packagename> will retrieve everything necessary to build that package
This will install all the stuff required to build the Xorg package
from source – we won’t actually be using the Xorg source as downloaded
from Ubuntu itself, but we’ll need all the build dependencies for that
all the same.
Next up we’ll also need automake versions 1.7 and 1.9 … during
compilation in the freshly installed virtual machine I noticed the
source build system was looking for both – I don’t think it’s fatal if
you haven’t got them installed but I install them anyway;
1 | sudo apt-get install automake1.7 automake 1.9
|
Now we need to download the x11rdp source. As a normal user;
1 | wget http: //server1 .xrdp.org /xrdp/x11rdp_xorg71 . tar .gz
|
Then;
1 | tar xvf x11rdp_xorg71. tar .gz
|
Getting and extracting the source....
Lines
of text will scroll past as the various source files are extracted. In
fact, not only have you downloaded the x11rdp source, you’ve downloaded a
somwhat older version of the complete Xorg source. X11rdp will be
compiled against that.
I think there are supposed to be plans for
somehow changing this so that you will be able to compile x11rdp against
the current versions of Xorg – after all, the x11rdp source should just
be able to use the current development libraries. I may try to produce a
much smaller version of the X11rdp source, which will be able to build
against the current versions of Xorg, by using the distribution’s "-dev”
packages. Anyway, for now, we’ll use this method.
We need to make a directory to which the Xorg build system will use
to store all the built binaries and files. In my case I used;
Next, go into the root of the downloaded source;
Then start the compilation of the underlying Xorg build… this is done by using the already configured build script;
1 | sudo sh buildx.sh /opt/X11rdp
|
Seriously, go away and do something else that
If all is going well, the build script starts working, and the compiling begins!
This will take a while, so get off your chair and go have a cup of tea or whatever your favourite beverage is ;)
In fact, it’ll take quite a long time to compile so, go do something
else for a while. On my machine/the VM, it took about 45 minutes to
build!
If all has gone to plan, the compilation should have completed with no errors.
From your current location, type;
And then
The X11rdp binary in /opt/X11rdp/bin/ - in highlight.
You should see the x11rdp binary has been compiled.
Now we need to soft link that in to /usr/bin …
1 | sudo ln -s /opt/X11rdp/bin/X11rdp /usr/bin/X11rdp
|
You can test if your binary runs without crashing now by typing;
Not crashing == good...
The ":1″ is required because you probably already have an Xorg session running as ":0″.
It seems from the screenshot that all is well… pressing ctrl-C exits the program.
ALT-F2 from Gnome or KDE lets you enter a command line...
All should now be ready for use!
Fire up your RDP client of choice. For this howto, I’ve been using
tsclient. For better fine tuning you can use rdesktop, either from your
gnome or kde prompt window or from a terminal command line, and for
example;
1 | rdesktop -a 16 -g 1240x800 192.168.1.239
|
192.168.1.239 of course being the IP address of my virtual machine.
Choose "sesman-x11rdp"
Remember now to choose "sesman-X11rdp” from the drop-down menu on the xrdp login screen!
A full RDP session running, using X11rdp
And voila! It works! See the various xrdp and X11rdp processes in action, too.
Well, that’s it now, everything’s fully up and running. Enjoy your full RDP server running from your Linux machine :)
If you have any further questions, don’t hesitate to ask. I’ll try my best to answer them.
http://scarygliders.net/2011/09/23/install-xrdp-and-x11rdp-the-comprehensive-howto-for-ubuntu-and-debian-based-systems/
|