VMware ESXi and vSphere Cluster Management
Access Raspberry Pi OS Remotely with XRDP from Windows
Install XRDP on Raspberry Pi OS and use Windows Remote Desktop Connection to access the Pi's graphical desktop over a trusted local network.
Remote desktop access lets you view and control the graphical desktop of a Raspberry Pi from another computer. With XRDP installed on the Raspberry Pi, a Windows computer can open an RDP session without requiring a monitor, keyboard, or mouse to remain attached to the Pi.
This is different from command-line-only access such as SSH. SSH provides a text terminal for commands, while remote graphical access displays windows, menus, file managers, and desktop applications. A headless Raspberry Pi is a Pi operated without directly connected display and input devices; XRDP is useful when the Pi is placed in a cupboard, server area, or another location without a dedicated monitor.
What XRDP Does
XRDP is a server implementation that allows Linux systems to accept Remote Desktop Protocol (RDP) connections. RDP transmits a graphical desktop session over a network. Windows includes a compatible client called Remote Desktop Connection, commonly started with the mstsc command.
Raspbian is the former name commonly used for the Debian-based Raspberry Pi operating system. Current releases are generally called Raspberry Pi OS, although older installations and tutorials may still use the Raspbian name. The steps below apply to a Raspberry Pi OS installation with a desktop environment.
Requirements Before Installation
Prepare the following items before installing XRDP:
- A Raspberry Pi booted into Raspberry Pi OS with a graphical desktop environment.
- A network connection for both the Raspberry Pi and the Windows computer. They should normally be on the same trusted local network.
- The Pi's LAN IP address or a hostname that the Windows computer can resolve.
- A local Raspberry Pi user account and its password.
- Administrative access through
sudo. - An up-to-date package list and enough free storage for the package and its dependencies.
| Component | Requirement | How to verify |
|---|---|---|
| Raspberry Pi | Powered on and running Raspberry Pi OS | Log in locally or confirm that it is reachable on the network. |
| Operating system and desktop environment | A Raspberry Pi OS installation that includes a graphical desktop | Confirm that the Pi normally displays a desktop when logged in locally. |
| Network connectivity | The Pi and Windows computer can communicate | Check that both are connected to the intended LAN rather than isolated guest networks. |
| XRDP service | The XRDP server is installed and running | Run sudo systemctl status xrdp. |
| Raspberry Pi address | A reachable IP address or resolvable hostname | Run hostname -I on the Pi. |
| Windows RDP client | Remote Desktop Connection is available | Open the Start menu and search for Remote Desktop Connection, or run mstsc. |
| User credentials | A valid local Raspberry Pi username and password | Use the account created during Raspberry Pi OS setup. |
Install XRDP on Raspberry Pi OS
Open a terminal on the Raspberry Pi. You can use a terminal window in the desktop, or another administrative method if the Pi is already operating headlessly. First refresh APT's package information:
sudo apt update
APT is the package management tool used by Debian-based systems, including Raspberry Pi OS. The update command downloads current information about available packages; it does not install updates by itself.
Install the XRDP package:
sudo apt install xrdp
Review the packages that APT proposes, then confirm the installation when prompted. The installation normally creates the XRDP systemd service and enables and starts it automatically. A systemd service is a background process managed by the system's service manager.
Verify the service if you want to confirm its state:
sudo systemctl status xrdp
Look for an active or running state. If the service is installed but not enabled or running, use:
sudo systemctl enable --now xrdp
The enable portion configures the service to start at boot, while --now starts it immediately.
Find the Raspberry Pi IP Address
On the Raspberry Pi, display its local network addresses with:
hostname -I
This prints one or more addresses. Select the address on the LAN used by the Windows computer. For example, an address beginning with 192.168. or 10. may be a private LAN address, but the correct choice depends on your network.
The Windows computer must connect to an address that is reachable from its own network. An address from a different interface, such as an unused wireless interface or a separate virtual network, may not work.
DHCP-assigned addresses can change when the Pi reconnects or when the router renews its lease. For repeated access, use one of these approaches:
- Find the current address whenever it changes.
- Use a hostname when local name resolution is available.
- Configure a DHCP reservation in the router so the Pi receives a consistent address.
- Use carefully planned static addressing if you understand the network configuration.
Connect from Windows
- On Windows, open the Start menu and search for Remote Desktop Connection, or press the appropriate Windows search shortcut and run
mstsc. - In the Computer field, enter the Raspberry Pi's LAN IP address or a hostname that resolves to the Pi.
- Choose Connect to initiate the RDP connection.
- When the XRDP login screen appears, enter the username and password for a local account on the Raspberry Pi.
- Accept any certificate or identity warning only when you recognize that it refers to your own Pi on the expected network.
- After successful authentication, the Raspberry Pi OS desktop should appear inside the Windows Remote Desktop window.
For the Windows client, the basic configuration is:
| Setting | Value |
|---|---|
| Computer | Raspberry Pi LAN IP address or resolvable hostname |
| Username | The Raspberry Pi local account name |
| Authentication | The password for that Raspberry Pi account |
Credentials and Security
Use the Raspberry Pi account created during operating system setup. Do not assume that an old tutorial's default username or password applies. Modern Raspberry Pi OS setup normally requires the user to create credentials, and historic default credentials should not be used.
- Choose a strong, unique password for the Raspberry Pi account.
- Keep RDP accessible only from a trusted local network unless you have configured additional secure remote-access protections.
- Do not directly forward TCP port 3389 from the internet to the Raspberry Pi. Exposing RDP this way is unsafe and invites automated scanning and attack attempts.
- For access from outside the home or office, consider a properly configured VPN or another secure remote-access design.
- Use network segmentation or firewall rules when the Pi contains sensitive data or services.
TCP port 3389 is the default port on which XRDP accepts RDP connections. Knowing the port is useful for diagnostics, but changing or exposing it does not by itself make an internet connection secure.
What to Expect from an XRDP Session
XRDP may create a separate graphical desktop session rather than showing the same session currently displayed on a physically attached monitor. Therefore, an application opened in the XRDP session may not appear on the locally attached display, and vice versa.
Desktop behavior can vary between Raspberry Pi OS releases, desktop environments, graphics configurations, and XRDP versions. A session that works on one release may need different troubleshooting on another. Performance also depends on network quality, display resolution, visual settings, Raspberry Pi hardware, and the applications being used.
XRDP is usually suitable for administration, configuration, file management, and lightweight desktop applications. It may be unsuitable for demanding 3D graphics, high-resolution video, or other workloads that require low latency and hardware-accelerated display rendering.
Practical Example: First Local-Network Connection
- Boot the Raspberry Pi OS desktop and connect the Pi to the same trusted LAN as the Windows computer.
- Open a Pi terminal and run
sudo apt update. - Install XRDP with
sudo apt install xrdp. - Confirm the service with
sudo systemctl status xrdp. If needed, runsudo systemctl enable --now xrdp. - Run
hostname -Iand note the reachable LAN address. - On Windows, run
mstsc, enter that address, and select Connect. - Authenticate with the Raspberry Pi local username and password.
- Recognize the Raspberry Pi OS desktop inside the RDP window as confirmation that the session succeeded.
Using a Pi Without a Monitor
A headless workflow requires some initial way to prepare the Pi. During initial setup, connect a monitor and keyboard temporarily, use an approved management method, or prepare the operating system and network settings before booting it without peripherals.
Once Raspberry Pi OS has a desktop, network access, a local account, and XRDP installed, the Pi can normally be administered from Windows through RDP. Keep an alternative administrative method available in case a network, service, or desktop-session problem prevents graphical login.
Basic Diagnostics
Confirm the Pi and network
- Check that the Raspberry Pi is powered on and has completed booting.
- Confirm that Ethernet or Wi-Fi is connected.
- Run
hostname -Iagain and make sure Windows is using the current address. - Check that the two devices are not separated by guest Wi-Fi isolation, VLAN rules, or another network boundary.
- Try the numeric IP address instead of a hostname to separate name-resolution problems from general connectivity problems.
Check the XRDP service and listening port
If Windows reports that the connection was refused, verify that XRDP is installed and running:
sudo systemctl status xrdp
sudo ss -tulpn | grep 3389
The second command checks whether a process is listening on TCP port 3389. If the service is stopped, start and enable it:
sudo systemctl enable --now xrdp
If port 3389 is not listening after that, review the service state and logs. Also inspect any firewall configured on the Pi or the network. A firewall must allow the intended local-network connection without exposing the service unnecessarily.
Review XRDP logs
For authentication errors, session-start failures, or a blank desktop, view recent service log entries:
journalctl -u xrdp --no-pager -n 50
Restarting the service and trying again can resolve a temporary service problem:
sudo systemctl restart xrdp
A blank or immediately closing session can indicate desktop-session incompatibility, conflicting graphical sessions, or a release-specific XRDP configuration issue. Install pending Raspberry Pi OS updates, review the logs, and consult guidance appropriate to the exact operating system release and desktop environment when necessary.
Common XRDP Connection Problems
| Symptom | Likely cause | Check or solution |
|---|---|---|
| Remote Desktop cannot connect | Wrong or outdated IP address, offline Pi, different or isolated networks, or unavailable hostname resolution | Confirm power and network status, run hostname -I, try the numeric address, and check guest Wi-Fi or VLAN isolation. |
| Connection is refused | XRDP is not installed, the service is stopped, or a firewall blocks TCP port 3389 | Run sudo systemctl status xrdp, start it with sudo systemctl enable --now xrdp, verify the listening port, and review firewall rules. |
| Login fails | Incorrect local credentials, an assumed historic default credential, or keyboard-layout differences | Use the account created during setup, verify the password through local or alternative administration, and check keyboard layout and special characters. |
| Black or blank session | Desktop-session compatibility issue or conflicting graphical sessions | Review XRDP and session logs, restart XRDP, install pending updates, and check release-specific desktop guidance. |
| Desktop session immediately closes | Session startup configuration or desktop compatibility problem | Inspect journalctl -u xrdp --no-pager -n 50, update the operating system, and investigate the installed desktop environment. |
| Connection is slow | Weak Wi-Fi, high display settings, limited Pi resources, or competing traffic | Use Ethernet or improve Wi-Fi, reduce display size and visual settings, close unnecessary applications, and avoid demanding graphics workloads. |
| Pi address changed | The router assigned a different DHCP address | Run hostname -I, update the saved RDP destination, use a stable hostname, or configure a router DHCP reservation. |
Exam-Relevant Notes
- XRDP is the server software on the Raspberry Pi; RDP is the graphical remote desktop protocol.
- Remote Desktop Connection is the built-in Windows client and is commonly launched with
mstsc. - APT installs the package, while systemd manages the
xrdpbackground service. hostname -Idisplays local IP addresses, and TCP port 3389 is the default XRDP listening port.- XRDP can create a separate desktop session instead of mirroring the physically attached display.
- RDP should be limited to a trusted network; direct internet port forwarding is unsafe, and a VPN is a safer option for off-site access.
Once XRDP is installed, the service is running, the Pi has a reachable address, and valid local credentials are available, Windows can provide graphical access to a Raspberry Pi OS desktop without permanently attaching a monitor, keyboard, or mouse.