Install GUI on Linux/Ubuntu
GUI offers simplicity, flexibility and easy approachability to users. As we know Amazon EC2 Linux servers do not come with GUI and all the operations have to be done using ssh client like putty which at times become a challenge for Naive users. With this tutorial, we can easily add GUI to our Linux servers and can make operability very interactive for new operators. Once we have installed all the GUI components on the server, we can easily connect it over RDP.
For enabling GUI, a lightweight LXDE desktop has to be installed in the server.
Starting from basic setup, the following are prerequisites we are supposed to do, I have spun T2.micro instance with ubuntu 18.04 for this experiment.
- Security group with port 22 open for SSH in inbound rules.
- Security group with port 3389 open for RDP in inbound rules
- Make sure Public DNS is assigned to it.
Getting started:
1. Connect to the instance using SSH client putty if you are using windows or you can directly connect to an instance (If you are using Linux/Ubuntu) after having its assigned public key downloaded locally and assigning it suitable permissions (chmod 400, in this case). Execute the following command using the terminal and switching to the directory where the PEM key exists.
ssh -i "key.pem" ubuntu@ec2-X-X-X-X.ap-south-1.compute.amazonaws.com
Update the server and install lxde using the following commands.
sudo apt-get update
sudo apt-get install lxde
Once LXDE is installed on your server, start the LXDE using the following command
sudo systemctl stop lightdmsudo systemctl disable lightdmsudo systemctl start lxdsudo systemctl enable lxd
4. Install XRDP to establish a remote desktop connection using the following command
sudo apt-get install xrdp
5. Set a password for the default user “ubuntu”, or you can set it for whatsoever user you want to login with as remote desktop connection requires username and password to establish a secure connection. On being prompted once you execute the below command, enter the new password followed by confirming it.
sudo passwd ubuntu
6. Start the windows remote desktop client and enter the public DNS or the elastic IP of your server instance and hit connect. I’m using Remmina Remote Desktop client for establishing an RDP connection.
7. Enter the username and password we have set for username “ubuntu”
8. And Tada, we are there on the main screen of our ubuntu server with full accessibility.
Perks associated to this:
- This is lightweight GUI for linux machine, even 1vCPU and 1GB ram would also be able to run this smoothly.
- Enjoy the linux capabilities on your mac/Windows with this.
With this, we can easily install any software on the instance, access all the system tools, access the internet and what not!
Hold on, not happy with this UI? No problem, go on and purge it with this command!
sudo apt purge --remove lxde*; sudo apt autoremove -y
Hope this article helped you, stay tuned for next. :)