Install a Lightweight GUI on Ubuntu VM (XFCE) & Enable RDP (xrdp) on Azure
Turn your Ubuntu Server VM into a lightweight desktop you can access over Remote Desktop (RDP). We install XFCE, configure xrdp, open the right ports safely, and sign in via Microsoft Remote Desktop.
๐ Also posted on our website: https://cybersecureworld.net/
Steps & Commands (copy/paste)
1) Check version & update
lsb_release -a
sudo apt update && sudo apt -y upgrade
sudo reboot
Reconnect via SSH after the reboot.
2) Install XFCE desktop (light)
sudo apt -y install xfce4 xfce4-goodies
# Prefer full Xubuntu stack (heavier):
# sudo apt -y install xubuntu-desktop
3) Install and enable xrdp
sudo apt -y install xrdp
sudo adduser $USER xrdp
sudo adduser xrdp ssl-cert
sudo systemctl enable --now xrdp
4) Make XFCE your RDP session
echo "startxfce4" | sudo tee /etc/skel/.xsession >/dev/null
echo "startxfce4" > ~/.xsession
(Ensures new users and your user launch XFCE when connecting.)
5) Open port 3389 on the VM firewall (UFW)
sudo ufw allow 3389/tcp
sudo ufw status
6) Allow RDP in Azure networking (important)
Azure Portal โ VM โ Networking โ Inbound port rules โ Add
Destination port: 3389
Protocol: TCP
Source: Your IP only (best practice)
Action: Allow
Priority: e.g. 300
โ Even better: use Azure Bastion to avoid exposing 3389 to the internet.
7) Connect
Use Microsoft Remote Desktop (Windows/macOS).
Connect to the VM public IP (or via Bastion).
Log in with your Ubuntu username/password โ you should land in XFCE.
Chapters
00:00 Intro & prerequisites
01:00 Update & reboot
02:20 Install XFCE
04:10 Install xrdp & groups
05:40 Set session to XFCE
06:30 Open UFW 3389
07:20 Azure NSG rule (or Bastion)
09:00 Connect via RDP
10:30 Tips & security notes
Security notes
Restrict RDP to your IP and consider Azure Bastion or a VPN
Keep the VM patched and monitor NSG/Firewall logs
Helpful keywords
ubuntu gui azure, xfce xrdp, enable rdp ubuntu server, remote desktop linux, azure bastion, linux desktop in cloud
โ
๐ Like & subscribe if this helped.