Integrating TigerVNC with xrdp on Ubuntu for Remote Desktop Access
TigerVNC and xrdp are often used together to enable remote desktop access to Ubuntu systems. TigerVNC serves as the VNC server, handling graphical display and input, while xrdp acts as an RDP (Remote Desktop Protocol) gateway, allowing Windows and other RDP clients to connect to the Ubuntu desktop. Below is a step-by-step guide to configuring them for seamless integration.
First, install TigerVNC Server and xrdp on your Ubuntu system. Open a terminal and run:
sudo apt update
sudo apt install tigervnc-standalone-server tigervnc-common xrdp -y
This installs TigerVNC (for VNC functionality) and xrdp (for RDP compatibility).
TigerVNC requires a startup script (~/.vnc/xstartup) to launch the desktop environment. Without proper configuration, remote connections may fail or display a blank screen.
nano ~/.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
export XKL_XMODMAP_DISABLE=1
xrdb $HOME/.Xresources
gnome-session &
For XFCE (a lightweight alternative), use:#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &
chmod +x ~/.vnc/xstartup
This ensures the script runs when TigerVNC starts.xrdp needs to know which VNC server to use for remote sessions. By default, xrdp uses its own session manager, but we’ll point it to TigerVNC.
sudo nano /etc/xrdp/startwm.sh
exec lines (e.g., exec /etc/X11/xinit/xinitrc) and add:unset DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIR
/usr/bin/vncserver :1
This tells xrdp to start TigerVNC (listening on display :1, which corresponds to port 5901) when a user connects.TigerVNC requires a password for remote access. Run:
vncpasswd
Enter and confirm a password (note: this is separate from your Ubuntu login password). The password must be between 6–8 characters long.
If you’re using UFW (Ubuntu’s default firewall), allow traffic on the RDP port (3389) and TigerVNC ports (5901+). Run:
sudo ufw allow 3389/tcp # RDP port for xrdp
sudo ufw allow 5901/tcp # TigerVNC port (display :1)
sudo ufw enable # Enable firewall if not already active
Restart both xrdp and TigerVNC to apply configurations:
sudo systemctl restart xrdp
vncserver -kill :1 # Stop any running TigerVNC instances
vncserver :1 # Restart TigerVNC
On a Windows machine, open the Remote Desktop Connection client (built into Windows). Enter the Ubuntu system’s IP address (e.g., 192.168.1.100) and click Connect. When prompted, enter your Ubuntu username and the VNC password you set earlier. You should now see the Ubuntu desktop.
~/.vnc/xstartup file is executable and contains the correct desktop launch commands. Restart xrdp and TigerVNC after making changes./var/log/xrdp.log and /var/log/xrdp-sesman.log) for errors. Common fixes include ensuring xrdp and tigervnc-standalone-server are installed and the startwm.sh script is correctly configured.sudo ufw status to check rules.By following these steps, you can integrate TigerVNC with xrdp on Ubuntu to enable secure, cross-platform remote desktop access. This setup leverages TigerVNC’s performance and xrdp’s compatibility with RDP clients, providing a flexible solution for remote administration or user access.