Skip to content

Instantly share code, notes, and snippets.

@adimyth
Last active March 26, 2024 14:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adimyth/923b60464c17f0b2273d9d665c3afed4 to your computer and use it in GitHub Desktop.
Save adimyth/923b60464c17f0b2273d9d665c3afed4 to your computer and use it in GitHub Desktop.
Ubuntu 20.04 RDP setup

Setup

MacBook Air(macOS Catalina) & Ubuntu 20.04 connected on the same network locally.

Steps

  • Install XRDP and enable
sudo apt install xrdp
sudo systemctl enable xrdp
sudo systemctl start xrdp
  • Allow RDP through the firewall (if enabled)
sudo ufw status
sudo ufw allow 3389/tcp
sudo ufw reload
  • Now login through RDP Client.

Possible Issues

SSH Login Issue

Sometimes even though the two devices are on the same network, even ping fails. In such cases disable the guest network if created.

Black Screen

One cause of this is that xfce4 has added code that prevents a second session from opening. You will find that if your computer's main screen is logged into xfce4 you may not be able to use it with xrdp. To solve this "second session" problem and allow as many sessions as you need, edit /etc/xrdp/startwm.sh and add these lines before the lines that test and execute Xsession. The $HOME/.profile is not part of the solution, but is something that should be run before starting the session anyway.

unset DBUS_SESSION_BUS_ADDRESS
unset XDG_RUNTIME_DIR

Auto Logout after Desktop loads

Sometimes if the user is not a root user then the rdp session logouts immediately after the desktop is loaded. Probably has some issues with GNOME desktop, so instead use xfce4. This problem occurs randomly.

  1. Install xfce4
sudo apt-get install xfce4

Select lightdm. 2. Create xfce session for each user logging through rdp

echo "xfce4-session" >> /home/username/.xsession
  1. Login again

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment