This guide shows how to set up a Remote Desktop Connection with a Raspberry Pi using RDP on a Windows PC. The Remote Desktop Protocol (RDP) is the proprietary network protocol developed by Microsoft to connect to a remote desktop computer and access its graphical user interface. This allows you to connect your Windows PC to your Raspberry Pi and control its GUI remotely.
We have a similar guide for Mac OS computer: Raspberry Pi: Set Up Remote Desktop Connection (RDP)
Prerequisites
Before proceeding, make sure you check the following prerequisites.
- You need a Raspberry Pi board.
- Operating System: you should have a Raspberry Pi running Raspberry Pi OS (32-bit or 64-bit). The OS should have Desktop support (doesn’t work on Lite OS).
- SSH: You should be able to establish an SSH connection with your Raspberry Pi.
xrdp (open-source Remote Desktop Protocol Server)
xrdp provides a graphical login to remote machines using RDP (Microsoft’s proprietary Remote Desktop Protocol). xrdp accepts connections from a variety of RDP clients. We’ll be using Microsoft Remote Desktop Client for Windows (but it’s also compatible with Mac OS, iOS, and Android).
xrdp allows you to connect to your Raspberry Pi to control its desktop remotely.
Please note that your Raspberry Pi must be running a full Raspberry Pi OS – it will not work with a headless or Lite OS.
Installing xrdp on Raspberry Pi (Remote Desktop Protocol)
Having an SSH connection established with your Raspberry Pi, update and upgrade your Raspberry Pi, if any updates are available. Run the following command:
sudo apt update && sudo apt upgrade -y
Next, we need to install the xrdp software on your Raspberry Pi:
sudo apt install -y xrdp
That’s it. You don’t need to change any configurations, everything will work out of the box with the default settings.
Finally, run the following command to get the Raspberry Pi IP address. You’ll need the IP address to establish the remote connection.
hostname -I
Remote Desktop Connection Software – Windows PC
The Remote Desktop Connection software is installed on all Windows PCs by default. Click the search bar.
Search for “Remote Desktop Connection” and open the App:
Type the Raspberry Pi IP address in the computer field and press the Connect button:
Click the “Yes” button to establish the connection.
Next, type your Raspberry Pi username and password and click the “OK” button to login into your device.
You might be prompted one more time for the authentication if you just powered your Raspberry Pi, so enter again your username and password.
That’s it! You can now control your Raspberry Pi desktop computer remotely from a Windows PC.
Wrapping Up
In this tutorial, you learned a very convenient, practical, and easy way to establish a remote connection with your Raspberry Pi using xrdp. This is our favorite method to access the Raspberry Pi desktop because you don’t have to connect an additional screen, keyboard, and mouse. You can also use RDP on a Mac OS computer.
We hope you found this tutorial useful. You can check all our Raspberry Pi projects on the following link:
Thanks for reading.
HI, FYI, lately the page redirect isn’t working.
Keep up with the good work!
Is this better than the standard VNC viewer that’s been around for years? (it comes with the RPi OS’s).
According to what I’ve researched and tested, RDP is faster. VNC literally shows physical display of what the remote user sees while RDP creates virtual desktop (uses less resources).
I had to do the line
#dtoverlay=vc4-kms-v3d
Comment out because when I opened vscode or chronium the display of the windows was not correct because the GPU was interfering. Interestingly, I was able to re-enable it after running vscode a few times. The first time, at the beginning of the year, I did it in a different place, where I commented out GPU. but don’t know where anymore. But that’s how it worked because I depend more on programming.
Page doesn’t load.
Feb 6, 2024 @ 5:32 PM EST
os links no email não estão a apontar para esta pagina. tal como algumas pessoas indicam. qual a diferença entre o vnc e rdp em termos de funcionalidades neste caso?
(I’ll reply in English)
Thanks for letting me know, I already reported the issue, I hope it gets fixed soon.
According to what I’ve researched and tested, RDP is faster. VNC literally shows physical display of what the remote user sees while RDP creates virtual desktop (uses less resources).
Thanks, very useful!
You’re welcome! Thank you for reading!
Interestingly, when I first connected my PC to mt RPi4B which is already attached to a monitor, keyboard, and mouse, the RPi startup screen appeared with none of the applications that showed on the monitor. I started a file manage, a terminal, and raspi config and they showed up on the xrdp window on my PC. I started a Firefox browser and it showed on the PC window, but in a completely garbled state. None of these show on the directly connected monitor.
Then I tried the Chromium browser and it displayed on the directly connected monitor but not on the xrdp screen.
I’m not sure what is going on, but my RPi seems confused.
Thanks for the article, I’ll continue to play with it.
Dan
Same here, some sort of rendering issue with browsers, will have to investigate some more…
set
#dtoverlay=vc4-fkms-v3d
in boot config
Hi
Could you also recommend a solution to access the PI if its in a complete other network without a static ip?
This works well. However, like Dan, I found the screens for Firefox and Chromium to be completely scrambled on the xrdp screen on my Windows 11 laptop.
And the suggestion from Claudius Viviani fixed it, for both Chromium and Firefox.
Very help and as well as slightly more responsive than TigerVNC I had been using.
Had same garbled screen with Chromium and Firefox browsers. But commenting off the line as mentioned by Claudius sorted it out:
sudo vi /boot/config.txt
— found and comment out the line with “dtoverlay=vc4-fkms-v3d”
— saved and rebooted.
I have been accessing a remote RBPi3 using xrdp for months. I mainly run a Thonny instance on the RBpi to tune a Python IoT application that in turn runs on an ESP32 controlled by the Pi. Complex stuff 🙂 Anyhow, some occasional (probably bad Wi-Fi related) visual problems set aside, everything has worked very, very well.
I also have and old Linx tablet that used to have Windows 8. I replaced it with Debian 12 (32-bit) and I can access it using xrdp, once again. The xrdp daemon is the only remote utility that has been reliable and fast enough when used with low-end devices, and that said with almost 20 years of VNC related experience.
Still no luck with browsers. I have tried commenting out the dtoverlay line in /boot/config.txt, but then the monitor attached to the RPi is blank after booting.
I tried dtoverlay=vc4-kms-v3d and dtoverlay=vc4-fkms-v3d with the same results:
Firefox browser window is scrambled
Chromium browser wind is displayed on the RPi monitor and works fine there but is not controllable from the xrdp window on the PC.
I tried dtoverlay=vc4-kms-v3d-pi4 and now both Chromium and Firefox browsers display on the xrdp window but scrambled and unusable.
I found this thread :
https://forums.raspberrypi.com/viewtopic.php?t=358637
and tried one of the solutions- in xrdp screen terminal window enter
firefox –safe-mode
This brings up an error message and a dialog. I clicked ‘continue’ and the Firefox bowser opened with a beautiful page. I tried several sites and everything seems to work.
Unfortunately, now when trying to open Firefox on the RPi monitor, it opens in the xrdp window.
So, for now, I can use Firefox in the xrdp window on my PC and Chromium in the real monitor. I can live with this, but I don’t understand it.
I finally have a headless Raspberry Pi 5B and am using it with xrdp. After commenting out the dtoverlay line in /boot/config.txt, both chromium and Firefox browsers work. They are pretty slow in startup, however, after they are on-screen, they work fine.
I’ve managed a few times to log in remotely with Microsoft Remote Desktop, but after a while, raspberry started rejecting my XRDP. it just won’t connect, opens the window then closes. Do you have any idea what I can do? I even tried reinstalling the operating system but it still doesn’t work.
SOLUTION for the rdp not connecting, your raspi screen has to be connected to hdmi0 port which is the left port next to the power inport usb-c.
Then reboot.
I am facing the same issue as others with distorted graphics.
Being anything but new to Linux but still quite new Raspberry Pi, I am also looking for a solution.
Obviously, disabling video acceleration “solves” it, but you fall back to slow software rendering using llvmpipe.
The “solution” that I found for this was in /etc/X11/xrdp/xorg.conf, under Section “Device”, changing the value behind Option “DRMDevice” from “/dev/dri/renderD128” to “”.
But disabling it system wide in the Raspberry Pi’s config.txt file does also work indeed, like others mention.
However, it’s all bad.
The Raspberry Pi still has a GPU, albeit a small one, and I want to take advantage of it.
So I want to actually get the Mesa V3D driver working with Xrdp.
Webbrowsers are not the best way to test it though. The most simple solution to actually check what you are using is
glxgears -info
(check GL_RENDERER to see what you are using).The animation of shows the same distortion as the webbrowsers when using the V3D driver, while it works “fine” with the llvmpipe. Any video game would have the same issue.
If anyone knows the solution it would be great. Otherwise giving up on RDP and getting back to Wayland and VNC would probably be the better solution.