Amazon EC2 Linux servers do not come with GUI, all the operations have to be done using ssh client like putty. So if you wish to have a GUI for your Amazon Linux instances, you can achieve it pretty easily. Once you installed the GUI essentials on your server, you can access it via windows remote desktop client. If you are using Linux, then you can use VNC viewer as a remote desktop client. In order to have a GUI, a lightweight LXDE desktop has to be installed on your server.
LXDE
- Specially designed for cloud-based servers.
- Lightweight GUI for Linux
- Better interface
- Multi-language support
- Supports standard keyboard shortcuts
- Fast performance
Prerequisites
- A running Ubuntu ec2 instance.
- Security group inbound traffic configured for ssh and RDP access (22 and 3389)
Getting Started
Step 2: Make sure that RDP port is enabled on the Ubuntu instance in which you are going to install lxde. Update the server and install lxde using the following commands.
1 2 |
sudo apt-get update sudo apt-get install lxde |
Step 3: Once lxde is installed on your server, start the ldxe using the following command
1 |
sudo start lxdm |
Step 4: Install xrdp to establish a remote desktop connection since you can’t have a GUI using putty. Use the following command to install xrdp
1 |
sudo apt-get install xrdp |
Step 5: Set a password for the default user “ubuntu”, since remote desktop connection requires username and password.
1 |
sudo passwd ubuntu |
Step 6: Start the windows remote desktop client and enter the public DNS or the elastic IP of your server instance and hit connect.
Step 7: Enter the username and password of the server instance and hit ok as shown below.
Bingo!! you can start using your Ubuntu server with GUI via remote desktop connection.
in aws, dont forget to open the right port. i has no idea which, so i opened all the traffic ^ ^
It is mentioned in the pre-requisites 🙂
Getting this on ubuntu 16.04
[email protected]:~# start lxdm
start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
uname -a
Linux ip-10-30-32-116 4.4.0-1013-aws #22-Ubuntu SMP Fri Mar 31 15:41:31 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
just a quick note your docs work on version 14 of ubuntu just not 16
Does not work for Ubuntu 16.04.
Gives the following error while doing sudo start lxdm:
“start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused”
Bro just ignore the message and forward to further request.
It will surely work, personally tried by me.
Gets the same error but i ignored.
For Ubuntu 16.04 you have to use for Step 3
sudo systemctl stop lightdm
sudo systemctl disable lightdm
sudo systemctl start lxd
sudo systemctl enable lxd
Thanks!
This article was written in 2017… should have used a post-16.04 Ubuntu especially since the Ubuntu AMI is 16.04.
For step 4, I had to do:
sudo systemctl start xrdp
sudo systemctl enable xrdp
And for step 5, I had to create a new user because “ubuntu” cannot have a password if you set up the instance with a private key.
WORKS LIKE A CHAMP!
THANK YOU…!