UPDATE : Automatic tool now available : see http://scarygliders.net/x11rdp-o-matic-central-downloads-page/
This HOWTO is mainly about how to compile and install X11rdp, which is an xserver binary which provides a true RDP experience.
NOTE : While I was writing this article, I went through all the steps written in below but using an SVN version of the X11rdp source, and after testing the resultant X11rdp binary, I ended up with a corrupted RDP session. At first I wrote this article using Ubuntu 11.04 64-bit and thought the RDP corruption was due to that, then I tried Ubuntu 11.04 32-bit – same thing. Then I tried Debian 6.0 32-bit – same thing. Then I tried Ubuntu 10.04 LTS and still got the same corrupted RDP session. So then I tried using the .tar.gz-packaged version of the source code from the download location I mention below and finally it worked perfectly.
In other words, the SVN version of the x11rdp source does not work. *sigh* Correction : it does work – you just have to compile xrdp from source (as well as x11rdp) – which I'm writing a new article about right now so please be patient).
Using Ubuntu 11.10? You should now read this new article which is even better than the one you're reading now! :D
The pain I go through to make sure you lot get a top class article! ;)
Notice I've put up a DONATE button on the right hand side of the blog, if you find my articles useful. Hint hint ;)
Related posts :
For this tutorial, I shall be using a fresh Ubuntu 10.04 LTS installation (with latest updates and running the Ubuntu Classic desktop) running in a virtual machine by way of Virtualbox. Here's a screenshot of it up and running on my main desktop.
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.
Open up a terminal session on your desktop, and type
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;
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…
sudo apt-get build-dep xserver-xorg-core
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;
sudo apt-get install automake1.7 automake 1.9
Now we need to download the x11rdp source. As a normal user;
tar xvf x11rdp_xorg71.tar.gz
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;
sudo mkdir /opt/X11rdp
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;
sudo sh buildx.sh /opt/X11rdp
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;
You should see the x11rdp binary has been compiled.
Now we need to soft link that in to /usr/bin …
sudo ln -s /opt/X11rdp/bin/X11rdp /usr/bin/X11rdp
You can test if your binary runs without crashing now by typing;
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.
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;
rdesktop -a 16 -g 1240x800 192.168.1.239
192.168.1.239 of course being the IP address of my virtual machine.
Remember now to choose "sesman-X11rdp" from the drop-down menu on the xrdp login screen!
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.
Did I mention I now have a Donate button?