How to configure XRDP to work with Gnome on Ubuntu 22.04?

894 Views Asked by At

I want to connect to my Ubuntu 22.04 computer with a remote desktop app just like how I connect to my Windows PC. Now XRDP promises to do that, and it is easy to install. However, configuring it so that it works properly is kind of complicated -- I get display errors and login errors. There is a nice page explaining how to configure XRDP for the Xfe window manager here, but Xfe is not nearly as nice as the standard Gnome window manager for Ubuntu. For example, I cannot cut from local computer and paste into my remote Xfe window.

So, how to install and configure XRDP with Gnome on my Ubuntu computer?

Here's my XRDP remote desktop with Xfe: enter image description here Not bad, but no cutting and pasting into it, and the terminal is not as nice as Gnome, and I can't find a good Settings window, etc.

1

There are 1 best solutions below

0
Daniel Morris On

There are bits and pieces of how to do this around the web, with some incorrect. Here is what I found that works well for configuring XRDP with Gnome without having to modify global /etc files. When properly configured, it runs reasonably fast, although is not as zippy as Xfe.

  1. Install xrdp and gnome-session:
sudo apt update
sudo apt install xrdp gnome-session
  1. Allow log in after xrdp setup:
sudo adduser xrdp ssl-cert
  1. Specify Gnome for your remote session:
echo "gnome-session" | tee ~/.xsession
  1. Then add the following to your ~/.xsessionrc file:
export XAUTHORITY=${HOME}/.Xauthority
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg

Note: the XAUTHORITY line solves the Display error when opening Firefox and other apps that rely on root privileges.

  1. Finally do this:
sudo systemctl restart xrdp
  1. Then log out (or reboot) and connect with a Remote Desktop client.

Note that you must always be logged out locally in order to connect in remotely. Also, it asks for your password a few times at first login.

Here's my XRDP remote desktop with Gnome: enter image description here

Now I can cut from my local computer and paste into my remote computer. And the menus are almost the same as being logged in locally. Yay!