Ubuntu – Enable Screen Sharing Features through RDP on Ubuntu 22.04

Hello World, 

This post will quickly explain how to use the Screen Sharing Feature that’s available in Ubuntu.  This feature has been around for some time but Ubuntu 22.04 introduce some interesting changes… 

Let’s go ! 

Overview

Screen Sharing feature allows a user to remotely access a Linux/Ubuntu desktop.  Remote Desktop capability is usually based on the VNC protocol.  Ubuntu Sharing feature is basically using VNC protocol to grant access to remote desktop either in read-only mode or to grant full access to the remote desktop session. 

Ubuntu 22.04 has introduced an interesting change in the Screen Sharing feature.   Ubuntu 22.04 allows you to share the screen through the RDP protocol instead of VNC protocol.   The VNC Protocol is still available for use but apparently the Sharing feature is promoting nowadays the RDP Protocol.  In this post, we will quickly show you how to enable this feature and what are the benefits and/or limitation of the Screen Sharing Solution 

Enabling the Screen Sharing Feature via RDP  

To enable the Screen Sharing feature on Ubuntu 22.04,  you will need to perform the following actions 

In the Top bar in Ubuntu desktop, on the right side, click on the group of icons and you will see the drop down menu displayed.  From this drop down menu, select the option Settings

Click on Picture for Better Resolution 

This will open the Settings Applet.  In the Settings page, in the left menu, select the option Sharing.  In the Sharing page, Click on the toggle button at the top or the option will be greyed out. 

Click on Picture for Better Resolution

To enable the Screen Sharing Access,  in the Sharing Page, Click on the Remote Desktop option in the page

Click on Picture for Better Resolution

The Remote Desktop Dialog box is displayed.  In order to enable the feature, you will need to use the toggle button to enable the function.  Doing this will only allow you to remote desktop to the desktop in read-only mode.  You will not be able to make any interaction.

Click on Picture for Better Resolution

In the Remote Dialog box, look at all the options available.  You will notice that the “Legacy VNC Protocol” is still available (but not enabled).  You can enable Remote control as well.  At the bottom, in the authentication section,  you can see the user account and password that can be used.  The password is automatically generated but if you wish to you can change it.   

Grant Full Remote Control 

In order to grant full remote control,  one would think that by using the toggle next to the Remote control would enable the full control access.  We have done that but when remotely connected to the Desktop interface,  we were not able to interact with the session. 

Click on Picture for Better Resolution

We have then decided to click on the 3 dots next to the legacy VNC Protocol and we have selected the option to require a password.  After we have enable this settings, we have been able to access the remote desktop and take control of the session through RDP

Click on Picture for Better Resolution

Limitations 

#1 – User must be logged on 

In order to access the remote desktop using the Screen sharing feature, a user must be logged on on the Ubuntu machine.  If the machine is presenting the login screen, the Screen Sharing feature will not work and you will not be able to access your remote session.   The Screen Sharing feature is apparently running as a user process and not as a system process.  Actually, you can check if the service is running or not by issuing the following command 

systemctl --user status gnome-remote-desktop.service

Click on Picture for Better Resolution

#2 – Anyone can see what you are doing….  

The other limitation/problem is that when you are using the Screen Sharing feature anyone who would have access to the physical machine can see exactly what a remote user is doing.  This is kind of  a security issue since someone is basically watching what you are doing.  Some people might argue that you can have headless solution on the physical machine but when you will need to perform some updates, the machine will need to reboot which means again that you will not be able to reconnect to your remote session since Screen Sharing feature only works when a user is actually logged in 

Click on Picture for Better Resolution

#3 – Can conflict with xRDP software 

If you have the Screen Sharing is enabled (using RDP protocol) and when you install the xRDP package on top of it,  you will probably notice that the xRDP software will not be useable.  Either the service is not started or the RDP port 3389 will be used by Screen Sharing Feature instead of the xRDP.  This is easily fixable but this is still an annoyance to be aware of 

 

Allow Remote Access When session is Locked  

While researching about this feature,  I have seen a lot of post recommending to enable Auto-login, remove the lock screen after inactivity and so on… All features that definitely reduce security of your Ubuntu machine.  A better option would be to allow RDP session even if the user session is locked.  After some search (took us some time), we have found a gnome extensions that could help achieve this goal.   

Since we are working with Ubuntu 22.04 and since Firefox is the snap version, we will need to install an additional piece of software to ease the installation of gnome extensions.  We will install the Extensions Manager software

Click on Picture for Better Resolution

After successful installation, open the Extension Manager Applet, Click on the Browse button.    

Click on Picture for Better Resolution

In the Search box, type Allow Locked and you will see that on top of the list you will have the extension called Allow Locked Remote Desktop

Click on Picture for Better Resolution

Go for it and install it 

Click on Picture for Better Resolution

Time to test it.  Lock your session and try to perform a remote desktop.  This should be working and you should be able to access your Remote desktop Session even if your session get locked….

Click on Picture for Better Resolution

Final Notes

Voila ! This is it for this post.  

The Screen Sharing feature could be useful when you need to get some help from other users so you can indeed share the screen and grant them full access to perform some required actions.  The drawback of the Screen sharing is that you need to have a user session running.  If the machine reboots and the initial login screen is displayed (not the lock screen), the Screen sharing will not allow you to perform the remote session. 

Clearly, Screen sharing is different (in its usage) than xRDP.  xRDP software offers the possibility to perform remote session even if no user is logged on.  However, xRDP software will not allow you to access remotely the console session.  It will always be a new desktop session.  Screen Sharing offers your the possibility to share your remote desktop (the console session) but will not work if no user is logged on into the machine. 

Based on this information, you now can choose which option would work better for your 

Till next time 

See ya 

 

 

Leave a Reply