Search This Blog

Tuesday, November 13, 2018

How to Access your Ubuntu Instance by RDP

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.

1. Install the Ubuntu Desktop environment:

sudo apt-get install ubuntu-desktop
2. Install XRDP using the following command:


sudo apt-get install xrdp

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

Now you can connect from another computer by xrdp to this server. 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