xRDP – Allow multiple sessions (local and remote) for the same user – More Option

Hello World, 

In this post, we will revisit again a recurrent topic/issue that some new users might encounter when using xRDP software.   

xRDP software allows you to perform remote desktop connection to a Linux machine.  However, xRDP software does not behave exactly the same way  as in Windows environment and some “limitations” exists when working with the software.   xRDP software will not allow you by default to have the same user  logged on locally and remotely on the same Linux machine.     

To overcome this situation, there are some workarounds that can be used.  These workarounds have already been provided and described in some previous posts that you can review 

Looking further into this issue, we have basically found another way that could prevent the black screen behavior that we will describe in this post. So, let’s move forward and check the additional option… ! 

Overview

xRDP is a software alternative that allow users to perform remote connections against a Linux machine.  xRDP, while providing similar functionality as Remote Desktop Services, does not behave exactly the same way as Remote Desktop Server.   For example, it’s not possible to connect via xRDP to the console session remotely (as far as we know).  The other limitation is that a same user account cannot be logged on concurrently locally and remotely on the system.   

More specifically, if a user (let’s call him Batman) is logged on locally on the Ubuntu machine where xRDP software is installed, the same user (Batman) will not be able to acquire a desktop session while performing the xRDP Session.  Instead, a black screen will be showing up or the session will be disconnected after a few seconds.   A similar behavior will show up if the user (Batman) is connected remotely on the Linux Machine and tries to login locally on the machine.  On the local session, the login screen will enter in a infinite loop….

u18.04.3_F11

Click on picture for better resolution 

The most common way to overcome this situation consists of performing only remote connections.  The Ubuntu machine would be seen as a headless machine.   However, in some situation, it might not be possible to use this approach and a concurrent session would be needed.   To meet this requirements, some workarounds can be used to prevent the black screen when already logged on (remotely or locally).  These workarounds are just that “workarounds” and come also with some limitations.    These workarounds have been already described in one of our previous posts (see xRDP – Allow multiple sessions (local and remote) for the same user – HowTo)

One Additional Option ?

As we were looking into this specific issue, we also came across another possible approach that would allow concurrent connection (i.e. local and remote) for the same user.   So, we wanted to give it a try and see if it could be also a viable option.   

To enable concurrent (i.e. local and remote) connection for a same user,  you would need to perform the following actions 

Login locally on your Ubuntu machine, open a Terminal console and issue the following command 

sudo apt remove dbus-user-session

xRDP_Concurrent_03

Click on Picture for Better Resolution

sudo apt install dbus-x11

xRDP_Concurrent_04

Click on Picture for Better Resolution

Note : You can see on the screenshot that this package was actually already installed and up to date and basically no action should be required 

You will need to reboot as well the machine in order to ensure that the changes have been applied accordingly 

Giving it a try

Initial Testing & Outcome 

Since we have installed the xRDP software on the Ubuntu test machine, we can start performing some tests.  We have performed initially a login locally on the Ubuntu machine. Then, while still connected locally, we have fired up our RDP client and initiate a remote connection.  As you can see in the screenshot below, we have been able to concurrently connect to the Ubuntu Desktop 

xRDP_Concurrent_05

Click on Picture for Better Resolution

It’s important to note that while we have access to a local session and a remote session,  the sessions are totally separated.  In other words, if you have started some works on your local connection and you are hoping to reconnect to the same session in your remote session, you will be disappointed as this would not be working.  Again, this trick only allows you to have distinct sessions running but unlock the possibility to concurrently perform local and remote connection to your Desktop. 

Issues & Side Effects 

Single Instance Running Application

After doing some really basic tests,  we came across the same limitations that we found out with the other workarounds we have already provided.  Some applications can be run only in a single session (again, either local or remote).  One application that’s showing such behavior would be Firefox Browser (as shown in the screenshot below).  As a quick fix, it might be possible to kill the process indeed and to try again to launch the Firefox Browser. 

xRDP_Concurrent_06

Click on Picture for Better Resolution

 

Lock Screen issues 

After some times, the lock screen kicked in and this is where some other problems started.  Indeed, while trying to unlock the session on the remote session,  after typing the correct password, the login process got stuck… So, we decided to try to login to the local session and there, the lock screen was simply looping over and over again. The only way to fix this was to restart the Ubuntu machine completely   

xRDP_Concurrent_07

Click on Picture for Better Resolution

Once the lock screen (automatically set or manually set) kicks in, we have encountered multiple times the unlock issue and we were not able to login to the system using the “normal” way. Sometimes, we were able to unlock through the local session. Once remote session freeze, we cannot do much. We didn’t push forward our investigation in order to explain and identify what could cause such issue.  At this stage, we think that this option might not be the best option after all since you have to fallback to a “legacy” package and given that the lock screen issue might simply prevent you to login to your machine (locally and remotely)

 

Final Notes

This is it for this post  ! 

To summarize, it should be clear by now that, by default, xRDP software cannot be used to allow concurrent connection (i.e. local and remote) for the same user.   This is a known limitation and so far the best way to avoid the black screen behavior is to ensure that users are either logged on locally or logged on remotely but never concurrently.  

This way of working might be really a limiting factor and workarounds exists in order to allow a user to access both local and remote session at the same time.  Based on the information provided in this following link,  this post has described a possible way to allow these concurrent sessions.    However, based on the fact that you have to remove some gdm packages, possible application limitations and mostly the lock screen issue,  we would not really recommend this approach…  (final decision is with you)

We still wanted to present and describe this option to have complete view on the issue and possible workarounds.  If we would really need to have the same user accessing local and remote session, we would use the DBUS option as described in xRDP – Allow multiple sessions (local and remote) for the same user – HowTo.   However, you might also end up with the lock screen situation…

Till next time 

See ya 

 

 

Leave a Reply