Get remote desktop on remote headless server

Solution 1:

You will need an external rdp client, else there IS no display that can be recognize

Also, you must tell xrdp to use GNOME and allow non root login (if desired). No matter the desktop, the first command is needed for non root user login

sudo sed -i 's/allowed_users=console/allowed_users=anybody/' /etc/X11/Xwrapper.config
echo "gnome-session" > ~/.xsession

The last command will be done with every user that needs to login via RDP

My advice, though, is use cinnamon, XFCE, or MATE. GNOME has issue with xrdp.

For cinnamon

sudo apt install cinnamon xrdp
echo "cinnamon-session" > ~/.xsession

For mate:

sudo apt install ubuntu-mate-desktop xrdp
echo "mate-session" > ~/.xsession

For XFCE:

sudo apt install xfce4 lightdm xrdp
echo "startxfce4" > ~/.xsession

Please also note you need a display manager (DM), which the server doesn't come with. Some desktops come with one, else I recommend lightdm

I also do not recommend VNC; it has performance and security issue. I usually tunnel rdp over ssh for security