Installing xrdp 9.3 and xorgxrdp 2.3 on Debian Jessie (or Stretch) August 8, 2017 d h This how-to is based on the install instructions from XRDP’s github pages for installing on Debian 8. Nov 03, 2016 XRDP – How to install XRDP on Ubuntu 16.04 – Easy Way sudo apt-get install xrdp sudo apt-get update sudo apt-get install mate-core mate-desktop-environment mate-notification-daemon sudo sed -i.bak '/fi/a #xrdp multiple users configuration n mate-session n' /etc/xrdp/startwm.sh sudo.
Learning has never been so easy!
The following explains the basics on successfully establishing a connection from a Windows machine to Ubuntu 14.04 (trusty tahr) using Remote Desktop Connection. To do this right, your Ubuntu machine will need xrdp software, and a user account with group membership to tsusers (this is an xrdp specific group). Some additional configuration will be required when setting this up, so it is recommended that you have a second user account with which to perform your configuration on the remote desktop account.
12 Steps total
Step 1: Download XRDP for Ubuntu:
sudo apt-get install xrdp
Step 2: Install your desktop environment (in this case, xfce4):
Since gnome is no longer supported by XRDP sessions, you must utilize a lighter desktop environment for use with XRDP (xfce4 works very well).
sudo apt-get install xfce4
Step 3: Associate XRDP to use the newly installed desktop during a session (otherwise you will see a grey screen with an ‘X’ as your cursor):
echo xfce4-session >~/.xsession
Step 4: For good measure, it is a good idea to edit the startwm.sh file to ensure that XRDP will always use xfce4:
sudo vim /etc/xrdp/startwm.sh
Add the following lines at the end of the file:
. /etc/X11/Xsession
. /usr/bin/startxfce4
. /etc/X11/Xsession
. /usr/bin/startxfce4
Step 5: Edit the xrdp.ini file so that the proper port, username and password are used by XRDP:
By default, XRDP will open new instances of a session upon each login. These instances will also utilize unique port numbers. To avoid mirroring sessions over multiple ports, the port number must be statically identified at the XRDP login screen (this can be done within the xrdp.ini file).
To edit this file, type:
sudo vim /etc/xrdp/xrdp.ini
sudo vim /etc/xrdp/xrdp.ini
At the end of the [xrdp1] code block, there is a line for defining the port number value. We are only concerned with the [xrdp1] block, as it contains default values for sesman-Xvnc type connections. By default, the port value is -1 which instructs the XRDP session to search for a newly available port on which to open the connection. We want to be able to specify the port at login. We also want to be able to specify the username and password (IP should be left at the loopback address). The bottom four lines of our code block for [xrdp1] should now read:
a. username=ask
b. password=ask
c. ip=127.0.0.1
d. port=ask -1
b. password=ask
c. ip=127.0.0.1
d. port=ask -1
By changing the port to “ask -1” we instruct XRDP to prompt the user for the port number at login, and autofill its value to -1 (this is important and is needed for your first RDP login).
Step 6: Save the file and restart the XRDP service:
sudo service xrdp restart
Step 7: Add the XRDP user account to the 'tsusers' group:
Before attempting our initial login, we need to make sure that the user account that is to be used is a member of the tsusers group (this is a group created by XRDP program).
sudo usermod –a –G tsusers ‘username’
Step 8: Start RDC from your windows machine:
Now you are ready to open your first connection using Remote Desktop. For the IP, we want to type the IP of your Ubuntu machine (should be the eth0 IP).
Step 9: Enter your XRDP login info:
You will now be prompted for your XRDP login info. Enter the username and password of the user that was added to the ‘tsusers’ group. For this login, leave the port at its default value (-1).
Step 10: Write down which port number was opened by XRDP:
For our first login, we want the port to remain at -1. This will allow XRDP to open up a port for us to use during later logins. BE READY TO WRITE DOWN THE PORT NUMBER FOR REFERENCE LATER ON. Your initial XRDP login will print the port number on screen briefly, so have a pen and paper ready.
Step 11: Add the newfound port number to your xrdp.ini file:
After a successful log in is made, it is imperative that this port number be added to the xrdp.ini file in place of the -1 value (so you do not forget which port your session is on). In this case, it should now read:
port=ask 5911
Now we are free to disconnect from our running session, and reconnect via this port to find all of our programs up and running as we left them.
Step 12: Troubleshooting XRDP connections that are in an error state:
Note that if connected to an XRDP session, “logging out” of the xfce4 desktop in Ubuntu will not terminate the XRDP remote session, but rather it will leave your session in a state of limbo with no way of dropping to the terminal to recover your interface (you will see a grey screen with an ‘X’ for a cursor). Establishing new XRDP connections over the same port will not remedy this malfunction either, so in order to kill the connection without restarting Ubuntu, the following must be done:
a. The user session must be deleted
b. All processes running for that user must be killed
b. All processes running for that user must be killed
To delete the user session (in our case on port 5911), we navigate to the following directory:
/tmp/.X11-unix
From this directory, we can view all running Xsessions and their users by typing:
ls –l
ls –l
There will always be a root session running on X0. DO NOT KILL THIS SESSION. We are only concerned with our limbo session, which in our case should appear on X11. (This number may differ depending on the port that was used). To kill the session, type the following:
sudo rm X11
Now we need to kill all running processes for our user account. To view running processes for a user account, type:
top –U ‘username’
Your session should now be freed from its limbo state! Even though our Xsession was killed, a new port does not need to be discovered with the -1 value. Instead we can continue to use the port number from before (5911).
References
- Deleting 'orphaned' XRDP sessions
- How to install xrdp in Ubuntu 14.04
- How to set up xrdp to reuse an existing session.
- Ubuntu 14.04 LTS xrdp grey screen
1 Comment
- Pimientorobbytaylor Apr 30, 2015 at 07:19pmThank you for sharing this information.
i had the one issue with my Ubuntu 14.04 system, that is grey curson with x cursor.
and i got the best solution for me here....http://expertisenpuru.com/how-to-fix-grey-screen-with-x-cursor-problem-in-ubuntu-14-04-or-higher/