In this tutorial we will provide an instruction on how to setup RDP connection to your Ubuntu server with Xfce graphical environment.
Why Xfce? Because Xfce is a lightweight desktop environment for Linux operating system, so more resources will be for your services usage.
- Requirements:
Freshly installed Ubuntu operating system on our Container VPS or Linux VPS server.
1. Install Xfce desktop environment:
apt install -y xubuntu-desktop
Check for a default display manager lightdm.
2. Reboot a server from a client system or perform a command:
3. Let's make selected display manager to be automated:
spawn sudo apt install -y xubuntu-desktop
expect "Default display manager: "
4. Reboot a server from a client system or perform a command:
5. Install xrdp:
sed -e 's/new_cursors=true/new_cursors=false/g' \
-i /etc/xrdp/xrdp.ini
6. For Container VPS
Remove Network manager which will prevent proper network configuration and restart server
apt-get remove network-manage
7. Create .xsession and .xsessionrc in home directory of user to be connected:
echo "xfce4-session" > ~/.xsession
D=/usr/share/xfce4:/usr/share/xubuntu:/usr/local/share
D=${D}:/usr/share:/var/lib/snapd/desktop:/usr/share
cat <<EOF > ~/.xsessionrc
export XDG_SESSION_DESKTOP=xubuntu
export XDG_DATA_DIRS=${D}
export XDG_CONFIG_DIRS=/etc/xdg/xdg-xubuntu:/etc/xdg:/etc/xdg
Connect to the server via any Remote Desktop client that you are using. Here is a tutorial on how to connect to server through RDP on Windows and on Linux: