Today I updated my server to ubuntu 24.04, but I cannot connect the screen on the server forever, it’s not convenient to manage the server, so I researched how to install rdp server on ubuntu.

apt -y install xrdp tigervnc-standalone-server
systemctl enable xrdp
systemctl start xrdp
ufw allow 3389/tcp

When I tried to connect the ubuntu server, it showed a black screen. After searching some information, I setted the ~/.xsession file.

echo “gnome-session” > ~/.xsession

Ultimately, it worked.