In this tutorial, we'll guide you through setting up an RDP connection to your Ubuntu server with the Xfce graphical environment.
Why choose Xfce? Xfce is a lightweight desktop environment for Linux, allowing more system resources to be allocated to your services.
Prerequisites:
A freshly installed Ubuntu operating system on either a Container VPS or Linux VPS server.
Step 1: Install the Xfce Desktop Environment
Start by updating your package lists:

Ensure that the default display manager is set to lightdm.
Step 2: Reboot the Server
You can reboot the server from your client system or by running:

Step 3: Automate Display Manager Selection
To make the display manager selection automatic, install expect and configure it:

Step 4: Reboot the Server Again
Reboot the server from your client system or run:

Step 5: Install xrdp
Now, install xrdp:

Step 6: (For Container VPS Users Only)
If you're using a Container VPS, remove Network Manager to prevent networking issues, then restart the server:

Step 7: Create .xsession and .xsessionrc Files
In the home directory of the user who will connect, create the following files:

Finally, connect to your server using any Remote Desktop client of your choice.