XRDP on PopOS fix

So I have been using PopOS a ton lately due to my workstation doubling as a gaming setup, but XRDP just breaks after a while.

After doing some digging, and finding other people who had this issue but no solution, I decided to post what I found to fix the issue in case others like me come across this as well.

The issue stems from GNOME_SHELL_SESSION_MODE, GDMSESSION, and XDG_CURRENT_DESKTOP not being populated. We will need to fix that.

Edit file /etc/xrdp/startwm.sh:

sudo nano /etc/xrdp/startwm.sh

And add these lines to the very top (below the comments):

export GNOME_SHELL_SESSION_MODE=pop
export GDMSESSION=pop
export XDG_CURRENT_DESKTOP=pop:GNOME

After you add those lines, restart xrdp:

sudo systemctl restart xrdp

This fixes every box I have Pop installed on with xrdp installed.