Note : Version 1 & 1.1 are now deprecated in favour of v2 which contains some fixes and additional changes. v2 is out now and is a vast improvment over v1.x
Article first published on May 23, 2012 @ 8:17
UPDATE : June 17, 2012
Added important note about Policykit – see below
Released v1.1 – see below
I've been busy these last few weeks.
I've written a utility which will do all the hard work for you to automatically compile and install X11rdp and xrdp :D
Bonus : included is a utility which will configure your RDP desktop session, and more!
Both utilities will work on Debian-derived distributions…
They're both Bash scripts using Zenity for the GUI bits… I'm was thinking about re-writing them in Python so I can present a better graphical user interface, Zenity is buggy and quite limited.
If you're running it on a desktop which uses Metacity, expect the windows to be placed pretty much randomly around your screen – it's annoying and it seems to be down to how Metacity handles new windows. Or something. Haven't had the time to find out why. A minor annoyance though. The slightly higher annoyance is that Zenity grows the height of info windows for some insane reason – hence the reason I think I'll totally re-write this in Python.
Don't expect the scripts to be perfect – they have next to no error trapping, can't detect if you have a network connection or not, and won't stop if there's a package download error.
If you download and try the utilities, let me know how you got on, and vote in the Poll at the bottom of this page.
If you wish to stop at any time, hit CTRL-C in the terminal window from which you started the utility.
However, they DO work and do the job, if you meet the requirements…
A Debian-derived distribution – this will not work for anything but those.
Your system connected to the Internet for package download – (possibly the install discs might work if you don't)
The ability to read, think, and to click OK from time to time.
An ability to be honest with yourself and to seriously consider sending me a donation for writing these ;)
Please read ALL of this page, including the walkthroughs, so you know what to expect before using the utilities!
This utility will automatically download, install, and configure X11rdp and xrdp on your Debian-based system, presenting you with various GUI menus and options along the way.
Easy to use GUI which helps you through decision making, if decisions need to be made
Automatically detects you have the required packages installed and will install them if needed
Automatically downloads the X11rdp and xrdp software and makes any changes required before compilation
Detects if your system has more than one CPU core and can automatically optimize the X11rdp build script to speed up compilation
You can run the utility repeatedly – it detects if you had previously downloaded the source or compiled X11rdp and will ask you what you want to do
Automatically updates the /etc/xrdp/xrdp.ini config file so the RDP session is the default
Automatically updates to an edited xrdp init script (to include the /var/run and SESMAN configuration)
Takes all the manual hard work away from you! ;)
This utility will help configure your RDP user's sessions automatically via an easy to use GUI menu system.
Easy to use GUI which helps you through decision making, if decisions need to be made
Automatically detects you have the required packages installed and will install them if needed (e.g. install LXDE if not already there)
Lets you select multiple users to configure their .xsession file automatically!
Can add a PolicyKit policy so that remote RDP users can perform priveleged tasks just like local users can!Removed – too dangerous – wait for version 2
A selection of Desktop choices, based on which distribution you are running on!
Important note about PolicyKit
I added the policykit generator into version 1, because a number of readers of this blog were wondering why they couldn't do a lot of the useful things that local desktop users can do. This feature is EXPERIMENTAL and I should have added that caveat right from the start – my apologies – the utilities are completely non-trivial to write and explaining the policykit caveat was on my to-do list, but, between answering questions here, working on other things, and family life, this one escaped.
The PolicyKit generator in version 1 created rules which will ONLY work for rdp users who are a member of a group called admin – if your system does not have this admin group, then you'll find the rules don't do anything. Also, the rules are dangerous in that they took a "bludgeon" approach and gave permission to REBOOT or SHUT DOWN the server to any user who is a member of the admin group, without asking for a password! You do NOT want remote users who do not know what they are doing being able to restart or shut down your precious server!
I have decided for the time being to REMOVE the PolicyKit generator from version 1.1 , and version 2 onwards will have a better and more refined PolicyKit generator.
In the meantime, if you want to be able to eject media, mount a device, etc etc from an RDP session, please see the files within the directory /usr/share/polkit-1/actions , and have a look for yourself. You will see how much work is involved in writing a tool to alter and maintain these permissions :
If you want to remove the rules that were created from version 1 , simply remove the file
Tested and works on…
Debian 6 (Squeeze)
Ubuntu 12.04 LTS
Xubuntu 12.04 LTS
Linux Mint 12
Linux Mint 13
And probably a lot of other Debian-based distros… I'll update the list when I get feedback and/or I test it myself. If it doesn;t work on your particular favourite Debian-based distro let me know and I'll have a look into it.
1) Download the package. Link is at the bottom of the article. Please read article beforehand.
2) Un-tar it to somewhere in your home directory. It will create a subdirectory called "ScaryMatic"
3) cd ScaryMatic
4) You will see a number of files. The two files you need to run are
x11rdp-o-matic.sh , and
4) Both utilities need to be run as root, so use su to get to your root prompt, or use sudo to start them
5) Relax as the utilities walk you through the process of both getting RDP installed, and configuring your RDP user's sessions ;)
6) Donate ;)
Run as root.
It'll check to see if you have all the packages necessary to get RDP up and running properly/compile and install the ones it sees aren't yet installed.
After that it'll remove but not purge xrdp so we can use the package's leftover stuff ;)
If you previously ran this utility and already have the source code there, it'll detect that and ask if you want to move it out of the way. You can usually asnwer No and re-use the existing source tree so you don't have to download it again, but, if you think it didn't download properly the last time, you can elect to do it again.
Then it'll grab the xrdp source…
Keep an eye on the terminal window too for useful information…
It'll also detect a previous installation of X11rdp, and suggest you remove that – probably a good idea to say Yes here…
Bonus feature! It'll make your CPU's even hotter! ;)
Toasty CPUs are great in the winter ;)
xrdp being compiled…
As you can see, it does everything for you!
And finished compiling and installing X11rdp and xrdp.
Next up is configure user desktop sessions, and PolicyKit if you need to…
Again, needs to be run as root…
Choose which desktop the selected users will see after they login…
Depending on the distribution, some of these options will change.
If your system doesn't yet have the desired desktop's packages installed, it will try to install them.
Choose which users will have their .xsession files created or altered from the choice you made above.
The utility will go through all users on your system and offer them up in the list. It automatically filters out "system" users like root for example, and also others like "smbguest".
You can choose 1 or more users to configure in one go – they'll all get the desktop which was selected previously.
Here for example I chose both users.
Again, some useful info is printed sometimes to the terminal window…
THIS EXPERIMENTAL FEATURE HAS NOW BEEN REMOVED AND WILL REAPPEAR IN A BETTER METHOD IN VERSION 2.
Another useful feature! Most distros implement PolicyKit these days, which is configured by default to treat remote users so as to reduce the amount of priveleged (read that as useful) tasks they can perform – like reading from a USB drive, mounting/unmount, etc… This has caused a few site vistors here some grief in the past. So I've incorporated this feature, which will create and install a remote users policy so they'll be able to do stuff that a user who logs in locally can. A different message will pop up if you've never configured a policy before. In this case I did before. Note, you only really need to do this once, regardless of what desktop session is being configured – it's just that sometimes configurations can change if for example PolicyKit packages have been updated.
And it's all done, and you can now log in via RDP and enjoy it :)
If you like these utilities, please make a donation :)
Reminder : Version 1 & 1.1 are now deprecated in favour of v2 which can be downloaded from here.
X11rdp-o-matic v1.1 Changelog
- Source code now downloads to inside the ScaryMatic directory – placing it in /root was a silly way to do it.
- removed the Zenity "Compiling …." pulser windows – Zenity consumes precious cpu time!
- Added alteration of xrdp source code Makefile.am so the PID file is now in /var/run/xrdp/
- Changed "PIDDIR=/var/run/" to "PIDDIR=/var/run/xrdp/" in the xrdp init script
- changed "xfce-session" to "startlxde" for LXDE sessions – seems to be common amongst all distros.
- completely removed the experimental policykit generator for the time being until v2 – policykit is complex and administrators should be careful which users they give permissions to – you don't want ordinary users being able to shut down or reboot your system!
Point Release and current v1.1 – use this :
Deprecated Version 1 :