Some users prefer the Desktop interface of the Windows operating system, and transitioning to the Terminal interface of the Linux operating system can be a bit challenging. This guide will walk you through installing a desktop interface on Ubuntu, which is a Debian GNU/Linux-based computer operating system. This will allow you to seamlessly switch between these two interfaces.
Ubuntu-instance





sudo apt update to update the list of available packages
sudo apt install xfce4 xfce4-goodies -y to install Xfce and Xfce goodies
xrdp is an open-source software that enables RDP connections for servers running Linux operating systems.
Run the command: sudo apt install xrdp -y to install xrdp

sudo systemctl status xrdp to verify the status of xrdp
Note: If xrdp is not running, use the following commands to start the service:
sudo systemctl start xrdp, thensudo systemctl status xrdp to verify the status of xrdpsudo nano /etc/xrdp/xrdp.ini
Note: By default, the user and password parameters are set to ask, meaning the user will need to enter their user and password to connect via RDP.
To exit the nano editor and return to the Terminal interface, press: Ctrl + X
The .xsession file adds xfce4-session as the session manager for login.
echo "xfce4-session" | tee .xsessionchmod 644 ~/.xsession
Note: This configuration ensures that xfce4-session is used as the session manager for the graphic login - Desktop interface. Since xfce is the chosen environment for the Desktop interface, xfce4-session functions as the session manager. Failing to include this in the .xsession file will prevent RDP sessions from connecting to the graphical login - Desktop interface.
sudo systemctl restart xrdp to restart xrdp, thensudo systemctl status xrdp to verify the status of xrdp
sudo passwd ubunturdp123)rdp123
Note: Remember to save the password you’ve just created; you’ll need it for step 10.


🔒 Security Note: For better security, avoid using Anywhere-IPv4 (0.0.0.0/0) because it allows any IP address on the Internet to attempt an RDP connection to your instance. Instead, it is strongly recommended to choose MyIP or specify a particular IP address or IP range that you trust. This reduces the exposure of port 3389 and minimizes the risk of unauthorized access or brute-force attacks.

On your local Windows desktop:

The Remote Desktop Connection window appears

The 3.237.187.56 - Remote Desktop Connection window appears
ubunturdp123 (created in step 8)
Congratulations! You’ve successfully connected to EC2 Ubuntu-instance using the RDP protocol. From here, you can easily switch between the Desktop interface and the Terminal.

lsb_release -a to check the Ubuntu versiondig +short myip.opendns.com @resolver1.opendns.com to check the Public IP