1. Update system
2. Install a Desktop Environment
Pick one:
XFCE (lightweight, best for VPS)
GNOME (heavier)
KDE Plasma (medium-heavy)
3. Install an RDP server (xRDP)
4. Set your GUI for xRDP (only needed if you installed XFCE)
Then restart xRDP:
5. Create a non-root user (RDP won’t allow root login by default)
You already know you need a user, so just run:
6. Allow the RDP port in firewall (if UFW is active)
7. Connect using RDP
From your local machine:
-
Windows → Open Remote Desktop Connection
-
Mac → Use Microsoft Remote Desktop
-
Linux → Use Remmina or any RDP client
Login with:
Optional: Fix black screen issues (common on VPS)
Optional: Install a VNC server instead of RDP
Recommendation for your case
Since it’s a VPS, XFCE + xRDP is the most stable and fastest combo.
Here is also a bash script for it:
# Ubuntu 24.04 VPS — XFCE + xRDP one-shot installer
# Usage:
# curl -fsSL https://example.com/script.sh | bash <-- (don’t do this)
# Instead: copy/paste this whole block into your VPS as root (or with sudo).
set -e
echo "==> Updating system..."
sudo apt update
sudo apt upgrade -y
echo "==> Installing XFCE desktop..."
sudo apt install -y xfce4 xfce4-goodies
echo "==> Installing xRDP..."
sudo apt install -y xrdp
echo "==> Enabling xRDP service..."
sudo systemctl enable --now xrdp
echo "==> Setting XFCE as default session for xRDP (for current user)..."
echo xfce4-session > ~/.xsession
echo "==> Restarting xRDP..."
sudo systemctl restart xrdp
echo "==> Firewall: opening RDP port 3389 if UFW is active..."
if sudo ufw status | grep -qi "Status: active"; then
sudo ufw allow 3389/tcp
echo "UFW rule added: 3389/tcp"
else
echo "UFW not active — skipping."
fi
echo "==> (Optional) Helping avoid some common 'black screen' issues..."
if [ -f /etc/X11/Xwrapper.config ]; then
sudo sed -i 's/^allowed_users=.*/allowed_users=anybody/' /etc/X11/Xwrapper.config || true
fi
echo ""
echo "=============================="
echo "DONE."
echo "RDP is listening on port 3389."
echo ""
echo "IMPORTANT:"
echo "1) Create a non-root user (recommended) if you haven't:"
echo " sudo adduser linuxuser"
echo " sudo usermod -aG sudo linuxuser"
echo ""
echo "2) Connect from your PC using an RDP client to:"
echo " <your_vps_ip>:3389"
echo " Login with: linuxuser"
echo "=============================="
