XRDP working with GNOME - howto (HACK)

This solution is a bit of a messy hack, but it should work until xrdp/Xvnc are fixed.

What is XRDP?

It is a vnc-like server to allow you to connect to ubuntu from a windows machine (or using rdesktop) in the same way that Windows Remote Desktop does. (i.e. no additional software on the windows machine is needed). website here.

What is this guide

This guide will help set up xrdp on Ubuntu and, optionally get it working with GNOME (this has been a difficulty for many people). The GNOME solution is a bit of a hack, and certainly not perfect, but its the first working solution I've seen. It has been tested by myself on Edgy only, although it should work on any other version too. Let me know!
The manner in which it works with gnome is to have an extra layer of vnc (using x11vnc). The problem is that you MUST have already logged on as yourself before trying to use xrdp. But IMO its better than nothing. The end result is actually a lot more like the bahaviour of RDP on Windows XP.

The first two sections (sufficient for running kde with xrdp) should be usable by anyone, and can be easily undone.

The third section should probably only be used by those who understand what the instructions do.

THE GUIDE:

1) GETTING XVNC TO WORK

xrdp relies on Xvnc, which has problems with fonts (which we will fix!)

Code:

sudo apt-get install Xvnc

now create a password file for Xvnc (this password is only for testing now, it will not be needed later so anything can be used)

Code:

vncpasswd

now, running Xvnc at the moment will probably not work. try it:

Code:

Xvnc :1

It will almost definitely give erroros about fonts but if it doesn't exit outright, and instead waits around for a connection you can proceed to section 2).

Otherwise, you need to link to your fonts directory so that you can run Xvnc.

If it asks questions just accept the defaults
This will result in an error about not being able to install the package, but ignore that.
Once its done there should be a .deb package in the xrdp folder that can be installed in the usual manner (by double-clicking it, or using sudo dpkg -i _packagename_)

The package can be uninstalled by using synaptic or

Code:

sudo apt-get uninstall xrdp

now run

Code:

sudo /usr/local/xrdp/xrdpstart.sh

If you run KDE then the howto is now complete!

either way test it by running

Code:

rdesktop localhost

You should be able to log in if you have KDE installed but it probably wont work if you use gnome. This seems to be a problem with Xvnc, and there currently seems to be no proper solution(i'm not sure about other desktop environments like XFCE).

EDIT --- it has been pointed out to me that at this point usingthe command

Code:

sudo apt-get install vnc4server=4.1.1+xorg1.0.2-0ubuntu1

to downgrade to a different version of vnc4server makes gnome work fine.
However, following section 3 will enable xrdp to run like the windows version: i.e display the same session as you were previously logged onto. If this is what you want, follow the instructions below, however you may be better advised to instead use rdp as it was meant to be used, then run x11vnc on their previous display. Proceed only if you understand whats going on, and its limitations.

3) GNOME

Now comes messy but necessary part if you really want gnome.

To explain:
XRDP uses a file called startwm.sh to determine which Desktop environment to use. Any program can be run in this file (the defaults are things like gnome-session, but gnome session can't run inside Xvnc).

The only solution I can find is to first run x11vnc, which runs a vnc server that captures an already running session (hence the need to be logged in already) and then run vncviewer in fullscreen mode instead of having a desktop environment running.

Now, make sure you are logged on to your desktop, go to a windows machine and log onto you ubuntu machine using remote desktop, and hopefully it'll work.

PS. This guide is entirely my own work. I found the font fix on these forums, i'm not sure where but its posted many times by many people. The hack I came up with myself. This is my first tutorial and I wrote it in a bit of a hurry as I was so excited to have found a way to make xrdp, ubuntu and gnome work together; I've been trying for about a year - periodically looking for solutions. All comments, criticisms, sugesstions and requests for help are welcome, but try to post exactly where things went wrong and what any errors were.
Good luck.

Re: XRDP working with GNOME - howto (HACK)

Yes, there should be.

If (as I infer from your message) you have installed xrdp and done nothing else, the file you need to look at is /usr/local/startwm.sh (which needs to be edited by root).
If you look at this file it should be clear (without knowing EXACTLY whats going on - I don't quire know exactly either) that the first Desktop it tries too run is KDE. the solution it to delete the bits that don't refer to gnome (or just delete everything and put your own startup command in). However, as described just before part 3, gnome cannot run in xrdp unless you downgrade Xvnc, so follow the instructions just before part 3. however, if you want to rdp into your existing session automatically (as per windows, except you must be already logged in from GDM or KDM), then follow the instructions in part three.
I'm going to rewrite this guide in a better format with better descriptions of the different options, if you can't get it running as you want before I do that then feel free to PM me on these forums.

Re: XRDP working with GNOME - howto (HACK)

Getting this to work in Ubuntu 704 has kept me up late. In the end, I installed tightvncserver to solve the problem. I followed the instructions in the Install.txt document bundled with xrdp 4.0 with some minor alterations - installed x11vnc. Can anyone tell me why vncserver and vnc4server would not work, yet tightvncserver did?

Last edited by SmartestAzz; August 28th, 2007 at 06:25 AM.
Reason: To Ask A Question