If you wish to use your server beyond the terminal access, you would need to do 2 things:

1) Install an interface


The interface is the way how your desktop will look like, in our example we will use the xfce4 interface, this can be installed with the following command:

sudo apt-get install xubuntu-desktop

This will install the xfce interface, it will take some time for the installation to complete.


For Debian, you would install the interface with the code below:

sudo apt-get install task-xfce-desktop

2) Install an remote access application

We will be looking to install the remote access of xrdp, this works in the same way as windows RDP but this is for the linux environment. This is achieved via:

sudo apt-get install xrdp

In addition to the installation of this, we will also need to set the environment to be used as xfce, this is done with the command:

echo xfce4-session >~/.xsession

The last thing you would look to do is to reboot the server and you will be able to access the server via RDP from windows even though your running an linux session.

3) Session Management

The session within XRDP is dynamically generated on a per session basis. If an session is started and you close the session from the application level, but the session remains to be active but hidden from view. However upon reconnecting a new session is generated and the previous will be held in the background. The processes will remain active in the process list as well. The default session is on port 5910, this is located under:

more /etc/xrdp/xrdp.ini

Its not possible to define the port 5910 without the initial session being generated otherwise, you will be shown an error on connection as the port 5910 is not actively listened to. You would define the initial session with the port value of “-1” this will lead to the session being created under 5910. Afterwards you can edit the xrdp.ini file to always use the same port for the same session.

The alternative is to force the xrdp application to wait for you to define the session. I have the following configuration, it will force the session to stop and allows me to initialise the session as required and to resume the session of my choice.