The remote desktop feature allows you to connect to a remote computer or virtual machine over a network. This is quite convenient, but until recently, Ubuntu had some issues with this. The built-in remote desktop program didn't support creating new sessions, and most third-party programs didn't work if Wayland was used, wasn't open source or required a third-party server for connection.
Starting with Gnome 46, the built-in Gnome Remote Desktop service has received an update and the capability to create new sessions. This feature allows users to utilize gnome remote desktop as a replacement for x11vnc or xrdp, and in this article, we'll explore how to set it all up. For this tutorial, we'll focus on Ubuntu 24.10, since it comes with GNOME 47 and offers the latest implementation of Gnome Remote Desktop. However, these instructions should also work with Ubuntu 24.04.
Table of Contents
How It Used to Work
When I first started using Linux, the x11vnc service was very popular. It would run under a user's account and allow you to remotely connect to an active session. All you had to do was set up a password for connection and launch x11vnc in the terminal or through autostart. Then, you could connect to that computer using a VNC client by simply entering the configured password and username. If the computer already had an active session, you would connect to it. If not, you would see the system login screen, where you could log in.
There was also an XRDP service available at that time, which was more advanced and allowed you to simply enter a username and password when connecting to the system you needed to access. After that, a new session would be created for you, allowing you to work remotely. However, with XRDP, you were not able to connect to an already running session by default.
In GNOME, a remote desktop service called GNOME Remote Desktop has been implemented. However, until recently, it was quite challenging to replicate the functionality of x11vnc, and it was essentially impossible to do so with XRDP. You could set up a login and password for authentication in the settings, and if a computer already had an active session, you could connect to it using that login and password. If there was no session, you couldn't connect either. Additionally, if a session had a locked screen, you would also receive an error. Essentially, for everything to work, someone would have had to be physically present at the remote computer to assist you in connecting. Certain issues could be resolved with extensions, but not everything.
GNOME developers implemented built-in remote desktop service - Gnome Remote Desktop. However, until recently, it was quite difficult to replicate the functionality of x11vnc, let alone XRDP. You could set up a login and password for authentication in the settings, and if the computer already had an active session, you could connect to it using that login and password. If there was no session, you wouldn't be able to connect. Also, if the session's screen was locked, you would get an error either. In fact, for you to connect to the remote computer, someone had to be physically present to turn on the service, unlock the screen, and share the password with you. Some of these issues could be resolved with GNOME extensions, but not all of them. In one of previous articles I have explained how to configure it in Ubuntu 22.04.
How Does it Work Now?
In Gnome 46, the Gnome Remote Desktop received an update that adds remote login functionality. As a result, the built-in remote desktop service now has of two separate services, both utilizing the RDP protocol. The first service runs by the superuser and is responsible for creating and managing remote sessions. It listens on port 3389 by default. The second service runs by a regular user for the local session, allowing users to connect to that session just like before. This service uses port 3390. If you need to connect to a remote computer without the user's interaction, you'll use the first service. In contrast, if you need to assist a user with a task in their session, you'll use the second service. These are separate services, so you don't have to configure both. In the second service, the underlying logic remains largely unchanged.
The remote login service is implemented in a rather interesting way, bearing some resemblance to XRDP. Upon connection, you use your pre-configured login and password, and you land on the GNOME login screen. Here, you can select the desired user and input their password:
Next, either a new or an existing remote session is created or opened, and you gain control over it:
If you disconnect and then want to reconnect, you'll need to repeat the authorization procedure again, but you'll end up in the same session with all active applications. Multiple users can log in and work in remote sessions simultaneously. However, there's a limitation: one user, one session, one connection. If you connect to an already active remote session, the previous connection will be interrupted. If a local session is already running for a user, a remote session won't be created, and vice versa. Overall, this is logical because you don't need to think about how to connect to a previously created session, and there's a separate service for connecting to local sessions.
How to Configure Remote Desktop in Ubuntu
Now let's have a look how to enable remote desktop in Ubuntu 24.04 or 24.10 as well as remote login using g-r-d service.
Remote Desktop
Open the Settings, then navigate to the System section and select Remote Desktop:
Next, you need the Desktop Sharing tab. Here, you need to enable the switches next to Desktop Sharing and Remote Control. Then, you can specify the login and password for authorization in the Login Details section. If you do not set your own login, the program will use the login of your user account and generate a random password. In the How to Connect section, you can see the port being used and the hostname.
If you need to connect by IP address instead of a hostname, you can find out the computer's IP by running the following command:
ip -br a
You can now close the Settings application. You can verify that remote desktop is working by checking if the gnome-remote-desktop user service has been launched:
systemctl status --user gnome-remote-desktop
Next, use the credentials on another computer to connect remotely to this one, for example, using the Connections application or similar. For example, if the computer you want to connect to has an IP address of 192.168.124.156, enter the following string in the connection settings: 192.168.124.156:3390.
After entering login and password configured earlier, if they were input correctly, the remote desktop will open immediately in front of you.
Remote Login
Open Settings, then navigate to the System section and select Remote Desktop:
This time, you'll need the Remote Login tab. Here, click the Unlock button and enter your user password to gain access to change system settings:
Then turn on the switch next to Remote Login and specify a login and password for authentication in the Login Details section:
Once you've finished, close the settings program and reboot your computer. You can verify that service is working correctly by running the following command:
sudo systemctl status gnome-remote-desktop
That's it, now we can move on to connecting. Let's consider an example of connecting using the Connections application. If the IP address of the computer we are connecting to is 192.168.124.156, then in the address field, you need to enter 192.168.124.156:3389.
Then you'll need to enter the login and password set up in the Login Details section:
Next, you need to select the user from which you want to log in:
And the only thing left is to enter the user's password:
After that, the program will redirect you to a remote desktop:
Wrapping Up
In this article, we took a look at how to enable a remote desktop in Ubuntu 24.04 or 24.10 using built-in tools within the GNOME environment. We demonstrated how to connect to an active user session as well as how to create remote sessions.
This functionality has appeared relatively recently, in Ubuntu 24.04, so some bugs may still be encountered. However, this is the beginning, and over time, we probably will get a full-fledged remote desktop with Wayland support and all the necessary features that are available in XRDP. For example, in Ubuntu 24.10, connecting to a previously created remote session after disconnection was added; also, it is likely that in the next release, instead of the hostname, the IP address will be displayed in the remote connection settings, making connections more convenient.