I'm posting this in the hope that it will make someone's life easier. There are not a lot of very firm descriptions of how to make XRDP work out there. That's probably because pretty much everyone uses VNC, and that makes complete sense. VNC 'just works'....period. However, I found myself in a position where my employer black-balled VncViewer from my work box, and suddenly I couldn't connect to my home Ubuntu machine. Since I'm stuck with WinXP at work, Remote Desktop Protocol seemed the logical choice, as my employer should not have a problem with it. But as I said, there just isn't much in the way of a road map out there that deals with the specifics of making XRDP work on Ubuntu. In my small way, I hope with this post to help some folks get XRDP working without going through the trial-and-error process I went through.
First, let me cite some links that were helpful to me, either with basic information, or clues, or suggestions, or just tidbits that made me think and sort this all out:
Use these as you will.....I found them helpful, but no single one or any combination got me to a successful conclusion. But their clues and such were invaluable. Thanks to all the writers of those posts.
Here's some stuff you need to understand up front..........
I'm running Ubuntu Intrepid, fully updated. I have a dual monitor setup, something that made all of this a bit more challenging.
There are three (3) pieces to this puzzle: 1) a VNC server. Doesn't really matter which one as XRDP doesn't particularly care as far as I can see; he just needs a VNC server to serve up your display. Your choices are:
All are readily available via Synaptic Package Manager. 2) XRDP. Again, available via Synaptic. He handles all of the Remote Desktop Protocol nonsense. 3) SESMAN....he handles login Ids, passwords, and such. Again, all are available in Synaptic.
You need to be aware of what ports each of the above VNC servers are listening on. Vnc4server and tightvncserver both listen on port 5901. Vino listens on 5900 exclusively.
If there is a router in your configuration, you need to know how to forward ports to the IP address of the machine you intend to control remotely (that is, your Ubuntu box). You are on your own to figure out how to do that....that's beyond the scope of this write-up.
If you are using a firewall on the machine you intend to control remotely, you need to understand how to create a rule that allows access through the port (5900, 5901, whatever) that you end up using for XRDP. Again, that's beyond the scope of this post.
There are .ini file(s) you need to be aware of. They are found in /etc/xrdp. The specific files are:
There is a control shell script for XRDP that you will need. It is found in /usr/local/xrdp.
'sudo' access will be required as you go through this, so be sure you know how to make yourself sudo.
I used a free third-party service called DynDns to give me a URL to my Ubuntu box that I want to control remotely. Do the same....you will find it helpful. But maybe you will want to use some other service....your choice.
So, here we go kids......this is how I made this work. I have tried all three (3) VNC servers and all worked, save some differences. Vnc4server and tightvncserver both, when started, spawn a new X session......that may be OK with you, but was not with me. Also, those two (2) servers were not able to deal with my dual monitor screen real estate. They simply scrunched my two monitor view down into the space of a single screen. Now, that was usable, but not what I had in mind at all. Vino, on the other hand, could deal with my dual monitor display by giving me a scrollable window. Another benefit was that he did not spawn a new X session, but instead just displayed my existing one......EXACTLY what I was looking for! Obviously, I settled on Vino as my VNC server. Choose your server as you see fit.
Next, let it be known that SESMAN never at any time gave me a problem.....it just worked. There is some confusion out there as to what port he likes to listen on. Either 3350 or 3389. I wimped out and forwarded both to my Ubuntu box, and opened both ports on my firewall. Done deal.
XRDP needed a little attention. By default, he likes to listen on port 5910. Now is where you will need to edit the 'xrdp.ini' file mentioned above, and you will probably need to be 'sudo' to do that. Do the right thing, and back up that .ini file first!! Here is what mine looked like after editting (remember I'm using Vino who likes port 5900.......make your changes for the appropriate port that your chosen VNC server likes):
You will notice everything is commented out except for the [globals] and [xrdp1] sections. This is what is working for me. You will also notice that in the [xrdp1] section, I am using port=5900....that is for Vino, which I've explained is my VNC server of choice. You need to alter that setting to fit the VNC server you have chosen to use. And a side note, using 'port=-1', to the best of my knowledge, causes XRDP to listen on its default port, which is 5910 as I mentioned above.
Now that this is done, you should be able to start up the three (3) pieces. Start them as sudo, or not. I'm not using sudo, and everything still works fine. I started things this way.........
first, the VNC server (in my case 'vino-server &' meaning I started him in the background)
then XRDP and SESMAN, using the start-up script in /usr/local/xrdp......usage is 'xrdp_control.sh start'.
Now, go to a Windows box, start Remote Desktop Connection, point it to the URL you created via DynDns (or whatever), and you will see your Ubuntu desktop magically appear in front of your eyes!!
Should you need to shut down XRDP / SESMAN, you definitely want to use the control script.....usage is 'xrdp_control.sh stop'. I did not do that once, and it left me with a nearly unusable X session.....not fun.
As of this writing, I've not set things up so that the above three (3) pieces are automatically started at system start-up, but I believe one of the links I listed at the start of this primer does explain how to do that. We are all on our own on that task at this point.
It is my sincere hope that this has somehow, someway helped someone with using this beautiful application called XRDP. As said before, information I found was sketchy at best. My hope is that I've filled in some information gaps, and given our community a little bit better road map for using this application.....I personally am thrilled that this is working, and working so well!!
This is a post-it-and-run kind of deal for me. I'll place this in the most prominent places I can find, but I won't be back for follow-ups. Use you head, and you'll be fine. Discovery is own pleasure anyway, right?? But maybe I've spared you 40 hours of discovery!! UBUNTU ROCKS!!!!