Skip to content

Nuface Blog

隨意隨手記 Casual Notes

Menu
  • Home
  • About
  • Services
  • Blog
  • Contact
  • Privacy Policy
  • Login
Menu

Ubuntu Server: Install Desktop + XRDP (Fix IPv4, NAT, and “Something Has Gone Wrong” Error)

Posted on 2025-11-132025-11-13 by Rico

This guide provides a full step-by-step setup for XRDP on Ubuntu Server, covering:

  • Installing Desktop (XFCE / Xubuntu Desktop)
  • Installing XRDP
  • Force XRDP to listen on IPv4 (0.0.0.0:3389)
  • Fixing NAT/Port-Forward return-path issues
  • Fixing “Oh no! Something has gone wrong.”
  • Avoiding GNOME/Wayland problems

1. Install Desktop Environment (XFCE)

Option A — Xubuntu Desktop (full)

sudo apt update
sudo apt install -y xubuntu-desktop

Option B — Minimal XFCE (recommended)

sudo apt update
sudo apt install -y xfce4 xfce4-goodies

2. Install XRDP

sudo apt install -y xrdp
sudo systemctl enable xrdp
sudo systemctl start xrdp

Add SSL permissions:

sudo adduser xrdp ssl-cert

3. Force XRDP to Listen on IPv4

Edit:

sudo nano /etc/xrdp/xrdp.ini

Change:

port=3389

to:

port=tcp://0.0.0.0:3389

Restart:

sudo systemctl restart xrdp xrdp-sesman

Verify IPv4 listener:

netstat -tulpen | grep 3389

Expect:

tcp 0 0 0.0.0.0:3389  LISTEN

4. Fix NAT Connectivity (DNAT + SNAT)

If your router forwards:

public_ip:9250 → 192.168.100.250:3389

You MUST SNAT return packets:

iptables -t nat -A PREROUTING -p tcp --dport 9250 \
  -j DNAT --to-destination 192.168.100.250:3389

iptables -t nat -A POSTROUTING -p tcp -d 192.168.100.250 --dport 3389 \
  -j SNAT --to-source 192.168.100.254

This ensures the Ubuntu server replies through the same router.


5. Fix “Oh no! Something has gone wrong.” (GNOME/Wayland)

XRDP cannot start GNOME/Wayland → use XFCE.

Install xorgxrdp:

sudo apt install -y xfce4 xfce4-goodies xorgxrdp

Set XFCE as default:

echo "startxfce4" > ~/.xsession

Modify the start script:

sudo sed -i '/^\. \/etc\/X11\/Xsession/i [ -x \/usr\/bin\/startxfce4 ] \&\& exec \/usr\/bin\/startxfce4' /etc/xrdp/startwm.sh

Restart:

sudo systemctl restart xrdp xrdp-sesman

Now XFCE loads properly.


6. Connect via RDP (Windows)

Run:

mstsc

Connect to:

public_ip:9250

or

192.168.100.250

You should now see a stable XFCE desktop session.


✔ Done!

Your server now supports:

  • ✔ Ubuntu Desktop (XFCE)
  • ✔ XRDP working on IPv4
  • ✔ Full NAT traversal through DNAT+SNAT
  • ✔ Stable XFCE without GNOME/Wayland issues

Recent Posts

  • Postfix + Let’s Encrypt + BIND9 + DANE Fully Automated TLSA Update Guide
  • Postfix + Let’s Encrypt + BIND9 + DANE TLSA 指紋自動更新完整教學
  • Deploying DANE in Postfix
  • 如何在 Postfix 中部署 DANE
  • DANE: DNSSEC-Based TLS Protection

Recent Comments

  1. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on High Availability Architecture, Failover, GeoDNS, Monitoring, and Email Abuse Automation (SOAR)
  2. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on MariaDB + PostfixAdmin: The Core of Virtual Domain & Mailbox Management
  3. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Daily Operations, Monitoring, and Performance Tuning for an Enterprise Mail System
  4. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Final Chapter: Complete Troubleshooting Guide & Frequently Asked Questions (FAQ)
  5. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Network Architecture, DNS Configuration, TLS Design, and Postfix/Dovecot SNI Explained

Archives

  • December 2025
  • November 2025
  • October 2025

Categories

  • AI
  • Apache
  • Cybersecurity
  • Database
  • DNS
  • Docker
  • Fail2Ban
  • FileSystem
  • Firewall
  • Linux
  • LLM
  • Mail
  • N8N
  • OpenLdap
  • OPNsense
  • PHP
  • QoS
  • Samba
  • Switch
  • Virtualization
  • VPN
  • WordPress
© 2025 Nuface Blog | Powered by Superbs Personal Blog theme