Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure XRDP to work with Gnome on Ubuntu? [closed]

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.

like image 883
Daniel Morris Avatar asked Oct 19 '25 15:10

Daniel Morris


1 Answers

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 set your ~/.xsessionrc file using:
echo "export XAUTHORITY=${HOME}/.Xauthority" | tee ~/.xsessionrc
echo "export GNOME_SHELL_SESSION_MODE=ubuntu" | tee -a ~/.xsessionrc
echo "export XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg" | tee -a ~/.xsessionrc

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

Optionally, if you want the regular Gnome desktop with vertical menu on the side rather than Activities menu, do this:

echo "export XDG_CURRENT_DESKTOP=ubuntu:GNOME" | tee -a ~/.xsessionrc
  1. Finally do this:
sudo systemctl restart xrdp
  1. Then log out and connect with a Remote Desktop client.

Note that things are not quite as seamless as Windows remote desktop. In particular:

  • You must always be logged out locally in order to connect in remotely.
  • It asks for your password to authenticate a color managed device few times at first login, which is annoying. To fix that, follow this helpful blog post.
  • If you want to create additional users from a remote session, you'll need to enable this, see this post.

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!

like image 198
Daniel Morris Avatar answered Oct 22 '25 11:10

Daniel Morris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!