I am creating this post in order to document how I setup remote desktop on Pop OS.

The first step is to install xrdp

sudo apt update
sudo apt install xrdp -y

From there you need to create the security groups

sudo groupadd tsusers
sudo groupadd tsadmins
sudo usermod -aG tsusers $USER
sudo usermod -aG tsadmins $USER

The you need to edit /etc/xrdp/sesman.ini to enforce groups. Change AlwaysGroupCheck to true and disable root login.

From there you need to give xrdp permission.

sudo adduser xrdp ssl-cert

Next you need to setup polkit rules.

sudo bash -c "cat >/etc/polkit-1/localauthority/50-local.d/45-allow.colord.pkla" <<EOF
[Allow Colord all Users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
ResultAny=no
ResultInactive=no
ResultActive=yes
EOF
sudo bash -c "cat >/etc/polkit-1/localauthority/50-local.d/46-allow-update-repo.pkla" <<EOF 
[Allow Package Management all Users] 
Identity=unix-user:* 
Action=org.freedesktop.packagekit.system-sources-refresh;org.freedesktop.packagekit.system-network-proxy-configure 
ResultAny=yes 
ResultInactive=yes 
ResultActive=yes 
EOF

From there you need to setup the desktop. By default Gnome will start so you will need to set the pop desktop as default. To do this edit sudo nano /etc/xrdp/startwm.sh and add the following:

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

From there you can start xrdp.

sudo systemmctl start xrdp

enjoy!

Sources:

https://c-nergy.be/blog/?p=16637

https://forum.level1techs.com/t/xrdp-on-popos-fix/163985

https://linuxize.com/post/how-to-install-xrdp-on-ubuntu-20-04/

https://askubuntu.com/questions/1433247/ubuntu-22-04-xrdp-allow-multiple-sessions-and-restrict-some-users

  • Papamousse
    link
    fedilink
    52 months ago

    I’m using xrdp for years on MX (Debian) and never had to modify something after install, just

    sudo apt install xorgxrdp

    sudo apt install xrdp

    and that’s it

    • Possibly linuxOP
      link
      English
      22 months ago

      That’s not secure and for pop os you need additional configuration

      • lemmyvore
        link
        fedilink
        English
        12 months ago

        Then do VNC over Tailscale, or X2Go over SSH… seriously, anything would be faster than those instructions. Why is it so complicated?!

    • schuert
      link
      fedilink
      12 months ago

      @Frederic @possiblylinux127 then you got a very different experience then me. debian 11 / 12 (not sure which one) had a bug that made xrdp unusable.

      the only fix was a downgrade to an older version of the deb package installed manually. YMMV