Saturday, 22 August 2015

Using Windows RDP to Access your Ubuntu Instance

Had to setup rdp for my development vm today. I used THIS article to do it.

Using Windows RDP to Access your Ubuntu Instance

Purpose

To show the steps required to setup Ubuntu Desktop on an Ubuntu 12.04 instance in our environment and connect to it using the Windows Remote Desktop Connection utility.

Notes

  • Using this method of interacting with your instance will be slower so keep that in mind. By default our Linux instances are setup for terminal access only.
  • These steps were tested on our Ubuntu 12.04 LTS image only

Pre-requisites

  • Must have port 3389 open in the security group associated with your instance. If you have the Windows Firewall enabled on your instance you must also have that port allowed as well.

Walk-through Steps

Installing XRDP on Ubuntu for RDP connection

These steps will allow you to access a Desktop GUI environment for your Ubuntu 12.04 instance using the Remote Desktop Connection program on your Windows machine.
1. Install the Ubuntu Desktop environment:
sudo apt-get install ubuntu-desktop 
2. Install XRDP using the following command:
sudo apt-get install xrdp
NOTE: User must add port 3389 to Security Groups. If you need assistance setting up your Security Group we have this article which should help:
Managing Your Security Groups in 13.5
3. Once the installation is complete you will need to start the XRDP Application:
sudo /etc/init.d/xrdp start
4. Create a new user that you will use to log into the XRDP:
sudo adduser USERNAME
NOTE: If the server does not accept the name you chose for the account add: "--force-badname" to the end of the command above.
5. The user setup in step 5 will only have login access to the instance but will not be able to install applications or complete administrator tasks. You can grant sudo access to this user by putting them into the sudo group:
sudo adduser USERNAME sudo
Example:
6. Now start “Remote Desktop Connection” from your local machine. From the Run line (Start -> Run) you can type "mstsc" or you can find the program in your Accessories menu.
7. Access the additional options by clicking Show Options:
8. Enter your Floating IP and Username in their respective fields and then click the Connect button to connect:
9. If the desktop comes up blank you may need to do this additional step:
Access your instance via SSH and navigate to the home directory of the user account you created:
su USERNAME
Create a file called .xsession:
nano .xsession
populate this file with this data:
gnome-session session=Ubuntu-2d
Exit and save the file with CTRL+X. Then repeat Step #8. You now have a Desktop GUI for your Ubuntu instance!

No comments:

Post a Comment