01.05.07

Howto get xrdp working on Ubuntu 6.10 (server)

Posted in VMware, Ubuntu at 2:19 pm by Michael

I had some issues making xrdp work correctly in my standard Ubuntu Server install. I figured other people might have the same problems I did so I’m writing this article to show you how to make this awesome software work in Ubuntu. I use the Ubuntu server install iso to install a linux server. It’s a good way to get a lightweight box that can handle VMware Server. I install fluxbox and xorg onto the server just in case we have network issues, we can still run the VMware Server console from the local machine to make any changes we need.

The first step to making xrdp work is to be sure you have xorg and a window manager installed (I use fluxbox since it’s very light on resources). From the command line type:

sudo aptitude install xorg fluxbox fluxconf vnc4server

This will install xorg, fluxbox, and the vnc server that xrdp uses for it’s magic. Once those are all installed, you need to install the development tools and a few library files, to compile xrdp. From the command line:

sudo aptitude install build-essential libpam0g-dev libssl-dev

That should take care of everything you need for compiling xrdp. I only actually do this step on one server, and then I just make a tarball of the final compiled program to distribute to the rest of the servers. I don’t need a compiler and all that devel stuff on all the servers, just the 1 I use to compile. There are a couple steps to making xrdp work correctly that I illustrate below.

Fix up the font directory. For some reason Xvnc is set to look for fonts in the wrong path, but this is easily fixed with this command:

sudo ln -s /usr/share/fonts/X11 /usr/share/X11/fonts

Also because the newest Ubuntu uses dash instead of bash as the default shell, the scripts included with xrdp give me errors. You have to edit the files with a text editor and set them to use bash instead of the default /bin/sh:

sudo nano /usr/local/xrdp/*.sh

In each file change the top line from:

#!/bin/sh

To:

#!/bin/bash

Save the first one and it should automagically open the second and third files you need to edit. Make the change in all the files and be sure to save them. Now there is one more change you need to make for things to work correctly. The startwm.sh script doesn’t have support for fluxbox in it. What I do is make a backup of the original file, then make a new file with just the commands I need for fluxbox, I couldn’t seem to get it working correctly until I did this. Commands:

cd /usr/local/xrdp
sudo mv startwm.sh startwm.sh.orig
sudo nano startwm.sh

Now make this file look like this:

#!/bin/bash
/usr/bin/startfluxbox
exit 0

That’s it, save the file and try starting xrdp:

sudo /usr/local/xrdp/xrdp_control.sh start

Once xrdp is started, try connecting with rdesktop or Remote Desktop Connection in windows. You should be able to login using your normal username and password and get an xdesktop. As long as that works, you can now link the xrdp_control.sh into your /etc/init.d directory and start it like any other service:

sudo ln -s /usr/local/xrdp/xrdp_control.sh /etc/init.d/xrdp

And to have it start up at boot you want to create the links in the proper places:

sudo update-rc.d xrdp start 98 2 3 4 5 .

That should do it. xrdp should load on boot and start fluxbox for you.

Leave a Comment

You must be logged in to post a comment.