Remote Desktop from Windows to Ubuntu: Updated Guide
Ubuntu now features a native RDP server. Learn how to enable it, when to use xRDP, and how to fix the black screen issue on your first connection.

On this page
You will notice the difference: the integrated server works with Wayland, requires no extra packages, and doesn’t suffer from the session issues that caused the infamous black screen with xRDP. Ubuntu 22.04 already allows you to share your screen via RDP; starting with Ubuntu 24.04, you can also use remote access with a dedicated session of your own.
The integrated RDP server #
Open Settings → System → Remote Desktop. If you can’t find it, type “remote” in the settings search (on Ubuntu 22.04, it is located under Settings → Sharing).
There are two modes, and it’s important to understand the difference right away:
| Mode | What it does | Port |
|---|---|---|
| Desktop Sharing | Connects you to the session already open on the computer, as if you were watching its screen | 3390 |
| Remote Desktop | Opens a new and separate session, even if no one is sitting at the computer | 3389 |
Desktop sharing is used for providing assistance or resuming work exactly where you left off. Remote desktop is what you should use to work on the computer from afar; additionally, it scales the resolution to your client window, resulting in a sharper image. If you only enable sharing, it usually uses port 3389: check the one shown in the panel.

Toggle the switch for the tab you need.
Make a note of the hostname and port shown in the panel, and set a username and password for the connection. These are credentials specifically for remote desktop, different from the ones you use to log into Ubuntu.
If your firewall is active, open the ports:
sudo ufw allow 3389:3390/tcp sudo ufw reloadOn Windows, search for rdp in the Start menu and open Remote Desktop Connection. Enter the IP address of the Ubuntu computer—adding
:3390if you are using desktop sharing—and enter the credentials from step 2.
ip a in the terminal and look for line inet of your network interface (which usually starts with 192.168. on most home networks). If it changes every time you reboot, set a static IP in your router settings.
From Show Options in the Windows client, you can save the connection to a file .rdp so you can reopen it with a double-click, and adjust resolution, color depth, and shared resources.
When xRDP is still needed #
Three cases where manual installation still makes sense:
- Older Ubuntu versions that lack the remote desktop panel;
- Headless servers, where you also need to install a desktop environment;
- Desktop environments other than GNOME, such as XFCE or MATE, which do not have the integrated server.
The installation requires three commands:
sudo apt update
sudo apt install xrdp
sudo systemctl enable --now xrdp
Check that the service is active using sudo systemctl status xrdp and open the port on your firewall:
sudo ufw allow 3389/tcp

If you want to change the xRDP port, open /etc/xrdp/xrdp.ini, edit line port=3389 in section [Globals] (for example, port=49952), restart with sudo systemctl restart xrdp, and open the new port on UFW. In your Windows client, you will then type indirizzo-ip:49952.
The black screen with xRDP #
This is the problem that stops almost everyone on their first attempt: the connection succeeds, but then a black window appears and the connection closes.
The most common cause is that the same user already has an active graphical session open on the computer. With xRDP, you cannot have both a local and a remote session for the same user running simultaneously: log out of your local session (locking the screen is not enough) and try again.
The graphical session fails to start. With xRDP, you must specify which environment to launch by creating a file in your user folder:
echo "gnome-session" > ~/.xsession
sudo systemctl restart xrdp
Wayland. xRDP was built for X11, and results can be hit-or-miss with Wayland. If the problem persists, open /etc/gdm3/custom.conf, remove the hash symbol before line WaylandEnable=false, and restart your computer. You don’t need to do this if you are using the integrated RDP server.
Color and resolution. If the window stays black but the connection doesn’t drop, try lowering the color depth to 16-bit in the Windows client options.
Connecting from outside your home #
Never open RDP ports directly to the internet: they are among the most targeted by automated attacks.
There are two secure ways:
A VPN, such as Tailscale or WireGuard, which virtually places you inside your home network; from there, you connect as if you were actually there;
An SSH tunnel, which routes the RDP connection through an encrypted connection. From your Windows computer, using the OpenSSH client already included in Windows 10 and 11:
ssh -L 3390:localhost:3389 utente@indirizzo-del-serverThen, while keeping that window open, connect via your RDP client to
localhost:3390.
If you absolutely must open a port on your router, at least use a different external port, restrict access to authorized IP addresses, and choose long passwords.
RDP {#alternative} alternatives #
VNC is the classic Linux protocol: in some cases it’s easier to set up, but it performs poorly on slow connections and isn’t encrypted by default.
Remote desktop software like RustDesk or AnyDesk routes through their own servers, so you don’t need to open ports or touch your router settings. This is the fastest way when you need to help someone who wouldn’t know how to follow a manual procedure.
SSH alone is enough if you only need terminal access rather than a graphical interface: it’s lighter, more secure, and works over any connection.
FAQ #
Can I use the Ubuntu computer while someone else is connected? #
It depends on the mode. With screen sharing, yes, because you both see the same session: this is specifically designed for remote assistance. With remote desktop access, the session is separate from the local one.
Is the RDP connection encrypted? #
Yes, the protocol encrypts the traffic, but it uses self-signed certificates by default. This is fine on a local network; if you are connecting over the internet, always use a VPN or an SSH tunnel.
Does it work from a Mac or a phone too? #
Yes. Microsoft offers the Windows App (formerly called Remote Desktop) for macOS, iPhone, and Android, and the process is the same: address, port, and remote desktop credentials.
Does copy-pasting between Windows and Ubuntu work? #
Yes, both with the built-in server and with xRDP. If it doesn’t work, before connecting, open Show Options → Local Resources in the Windows client and make sure Clipboard is checked.
Why is the resolution wrong? #
With screen sharing, you see the resolution of the physical Ubuntu screen, which might not match your window size. With remote desktop access, however, it adapts to the client’s dimensions.
The connection is slow: can it be improved? #
Lower the color depth, disable graphical effects, and uncheck clipboard and printer sharing in the client options. On very slow connections, a lightweight desktop like XFCE with xRDP performs better than GNOME.

