I want to install a graphical user interface (GUI) on Amazon Lightsail.
Resolution
Install a GUI on Lightsail
Complete the following steps:
-
Open the Lightsail Dashboard and select your Lightsail instance.
-
Choose Networking.
-
Under IPv4 Firewall, choose Add Rules, and then add the following rule:
Application: Custom Protocol: TCP Port or Range: 3389
-
Choose Create.
-
Use SSH to connect to Lightsail.
-
Confirm the operating system (OS):
# cat /etc/os-release
-
Install Xfce 4 and xrdp:
# sudo apt-get update; sudo apt-get -y install xrdp xfce4
-
Set Xfce as the user's default window manager:
echo "xfce4-session" > /home/example-user/.Xclients chown example-user: /home/example-user/.Xclients; chmod u+x /home/example-user/.Xclients
Note: Replace example-user with your username.
-
Activate xrdp:
sudo systemctl enable xrdp; sudo systemctl start xrdp
-
(Optional) If Uncomplicated Firewall (UFW) is installed, then add a firewall rule to allow Transmission Control Protocol (TCP) port 3389:
$ sudo su -
# if ! /usr/sbin/ufw status | grep inactive > /dev/null 2>&1;then /usr/sbin/ufw allow 3389/tcp;fi
Note: To check the status of UFW, run the following command:
sudo ufw status
-
Set the user password:
sudo passwd example-user
Note: Replace example-user with your username.
Connect to Lightsail with the GUI
Complete the following steps:
- Choose a remote desktop client.
- Enter the IP address.
- Enter the user ID and password.
Note: If you receive a "Failed to execute child process "dbus-launch" (No such file or directory)" error when you connect, then install dbus-x11:
sudo apt-get install dbus-x11