How to: Remote Desktop into an Ubuntu Server in Windows Azure
Basically there are three parts to enabling a remote desktop session into an Ubuntu Server. But before we get into all that I feel the need to point this out: Ubuntu Server is sort of meant to run without a GUI and managed through an SSH terminal. In my case I just felt more comfortable having a GUI to navigate the file system using nautilus, etc. But one thing I noticed is that having a desktop on your server does consume more resources and exposes you to added risks by having another layer of software running on it. If you have a more legit reason than mine (I “freak out” without a GUI) then continue, but if you are just fearful of a Linux terminal… fear not, it might take more time at the beginning but it gets the job done in a more leaner way that is good for the performance of your Ubuntu box. Hence the reason why Ubuntu Server ships without a GUI. You shoudn’t need it and it is just a drag to the server. Now, if you want to use it as a workstation and need a Graphical Desktop interface sorry I wasted your time. So with no further due here it is:
I. Install a Desktop system on your Ubuntu Server
Needless to say, if there is no GUI on the backend then there won’t be a GUI on the front-end. I already have an article on how to get your GUI installed on an Ubuntu Server: http://kx.cloudingenium.com/linux/ubuntu/run-ubuntu-server-gui/
II. Install a remote desktop host aplication
XRDP is probably a good choice as it leverages the already familiar Microsoft RDP (think port 3389). There are other alternatives like VNC that would work too.
To install xrdp simply use apt-get:
sudo apt-get install xrdp
I recommend performing all the following commands in that order to ensure a smooth installation of the latest xrdp:
sudo apt-get update
apt-get install ubuntu-desktop --no-install-recommends
sudo apt-get install xrdp
sudo /etc/init.d/xrdp start
III. Open the necessary Endpoint in Windows Azure or perform a tunnel using SSH
As usual, using SSH is just better. It adds and extra layer of security and does not expose an additional service. Regardles, if you want to you could go to the Windows Azure Portal and add an Endpoint on port 3389 (TCP endpoint). If you are using Putty you can set up the tunnel the following way:
- Add your tunnel.
- Source port would be the port in your localhost were you want the connection to take place. You can chose any arbitrary port that is not in use (you could use 3389 if you don’t have remote desktop enabled on your local PC).
- Destination should be were is your Ubuntu server going to connect. I would recommend using localhost:3389.
- Save your settings and connect
- Now that you have your tunnel configured, open remote desktop connection and for your remote host type localhost:3389. Port 3389 was the arbitrary port you indicated on your source port. If you actually used 3389 then you don’t need to indicate it using :3389.
Keep in mind that if you use VNC you will have to use a different client application as well as port.