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)
now, running Xvnc at the moment will probably not work. try it:
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.
Code:
cd /usr/share/X11
sudo mv fonts fonts.bak
This renames your fonts folder. If something drastic goes wrong, just rename it back!
now to link to the proper folder:
Code:
sudo ln -s /usr/share/fonts/X11/ fonts
now try Xvnc again:
and hopefully it wont crash, which should mean xrdp can run properly!
2) INSTALLING XRDP
It needs to be downloaded and compiled, so we'll need to install some tools:
Code:
sudo apt-get install build-essential libpam0g-dev libssl-dev x11vnc vncviewer fakeroot checkinstall x11vnc
now download the latest version (0.3.2) from sourceforge, or type
Code:
cd ~
wget http://mesh.dl.sourceforge.net/sourceforge/xrdp/xrdp-0.3.2.tar.gz
now, cd to the folder you downloaded it to and type:
Code:
tar -zxvf xrdp-0.3.2.tar.gz
cd xrdp-0.3.2/
make
fakeroot checkinstall
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 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.
so, backup startwm.sh
Code:
cd /usr/local/xrdp/
sudo mv startwm.sh startwm.sh.bak
sudo gedit startwm.sh
and enter the following code into the file:
Code:
#!/bin/bash
x11vnc -display :0 -localhost &
sleep 5
vncviewer localhost:0 -fullscreen
and make it executable:
Code:
sudo chmod +x startwm.sh
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.
Bookmarks