5 Ways to Remote Desktop on Raspberry Pi (Windows/Linux/Mac)


Using a remote desktop is a very convenient way to access your Raspberry Pi interface from another computer. This way, you can follow my tutorials on this website (for example) and apply them directly from the same device. There are several ways to do this. In this article, I will introduce you to the 5 best methods:

  1. Xrdp
  2. SSH with X11 forwarding
  3. VNC
  4. Teamviewer
  5. NoMachine

For each method, I will explain how to set it up on your Raspberry Pi and how to access it from any operating system (Windows, Linux, Mac and even from your smartphones). So keep reading to learn everything about these solutions.

If you are looking to quickly progress on Raspberry Pi, you can check out my e-book here. It’s a 30-day challenge, where you learn one new thing every day until you become a Raspberry Pi expert. The first third of the book teaches you the basics, but the following chapters include projects you can try on your own.

I answer your questions - Raspberry...
I answer your questions - Raspberry Pi FAQ

1. Install XRDP on Raspberry Pi OS

Download the Pi Glossary!
If you are lost in all these new words and abbreviations, request my free Raspberry Pi glossary here (PDF format)!

Warning: This method currently doesn’t work on a fresh installation of Raspberry Pi OS Bullseye. You won’t be able to log in. A workaround is to disable the auto-login in the Raspberry Pi Configuration tool.

Introduction

XRDP is an open-source remote desktop protocol server, which allows you to connect to the Linux desktop from any operating system.
If you need to open or redirect access on your router or firewall, know that XRDP uses the standard port 3389.

Installation

The installation of XRDP is straightforward as it’s available in the original Raspberry Pi OS repositories.

All you have to do is run the following command:
sudo apt-get install xrdp

XRDP is now installed as on your Raspberry Pi, so you can manage it with the usual command:
sudo service xrdp start | stop | restart | status

If you are not familiar with the command line on Linux, you might consider checking this other article first. I explain the most useful commands on Raspberry Pi, you can even download a cheat sheet with all of them.

But you can also use the Add/Remove software tool to install it if you prefer not to use the command line.

From Linux

To connect from a PC under Linux, I recommend using a solution like Remmina.
It is included in the repositories for most distributions, so you can install it with:
sudo apt install remmina

Once installed, start it and connect to your Rasperry Pi’s IP address.
If you don’t know how to get it, you can read this article that will explain several ways to find the IP address.

On my Ubuntu version, I encountered the following error:

"You requested an h264 GFX mode for server 192.168.1.15, but your libfreerdp does not support h264. Please check color depth settings."

So, I had to add it as a shortcut, as the quick connection does not allow defining the color depth.
By choosing GFX RFX in the list, the error disappeared, and I was able to connect.

Here is a screenshot of my configuration if you experience the same issue:

remmina remote desktop

From Windows

The good thing with XRDP is that Windows users already have the client to connect to it. It’s the same protocol that Windows uses to allow users to access Windows servers remotely, so we can use the same tool.

From Windows start the “Remote Desktop Connection” tool from the start menu and fill the IP address:

windows remote desktop
Raspberry Pi Bootcamp
Sale: 10% off today.
Take it to the next level.
I'm here to help you get started on Raspberry Pi.
Learn all the skills you need in the correct order.

If you don’t know the IP address, you can read this article that will explain several ways to find the IP address.
You can also type “raspberrypi” if there is only one on your network, that’s the default computer name.

Click on “Connect” and you will get the XRDP login screen:

xrdp login remote desktop

All you need to do is enter the credentials (pi / raspberry by default) and click OK.
Set Xorg for Session if you do not know what you are doing.
The desktop will then be displayed relatively well.

In my case, the icons were a bit big, so I changed it in the appearance options, but otherwise it was usable immediately.

From Mac OS

I could not do the test on Mac OS, but there are several RDP clients that you can use the same way.

For example, download “Microsoft Remote Desktop” from the App Store, and connect to your Raspberry Pi by specifying its IP address (follow the same procedure as for Windows users once the app installed).

From a smartphone

You can also use the RDP protocol from a smartphone quite easily.
The application “Microsoft Remote Desktop” is also available for Android and iOS.

So, it’s possible to connect and use it, but don’t expect a great experience, as the smartphone screen is not ideal to control a computer!

2. Enable SSH and use X11 Forwarding

Introduction

X11 is the main Linux graphical window manager.
X11 forwarding over SSH is one way to start an app from a server when connected to it via SSH.
In our case, this will launch Raspberry Pi applications from our desktop (so it is not full access to the desktop).

This method could work from a remote location. It would be enough to open SSH port (22) from outside.
Remember to limit the allowed IP addresses in this case, and maybe set up additional protections like fail2ban to avoid any security issues.

Installation

X11 forwarding is enabled by default on Raspberry Pi OS, but you need to enable SSH, that is now disabled on any fresh installation.

The easy way to do this is to open the Raspberry Pi Configuration tool, go to the “Interfaces” tab and enable SSH:

If you have any problems you can check that X11Forwarding is uncommented and set to yes in /etc/ssh/sshd_config.

From Linux or Mac OS

Using Linux or macOS, the access is almost the same because you only have to log in to SSH by adding a parameter:
ssh -X pi@192.168.1.15
Obviously, you’ll need to use your Raspberry Pi IP address instead of mine.

Enter your password, and then start your app with the nohup command:
nohup chromium-browser &

Replace chromium-browser with the app of your choice.

The application will open on your computer (with more or less slow depending on the case.

From Windows

If you are on Windows, it’s less simple but still not that complicated.
You will need these applications:
Putty (which you probably already have for the SSH connection)
Xming (download it on Sourceforge)

Once Xming is installed (the default options work very well), follow these steps:

  1. Start Putty.
  2. Fill the hostname with something like “pi@192.168.1.15”.
  3. Fill the Saved sessions with something like “Raspberry Pi”.
  4. Go to Connection > SSH > X11 in the left menu, and check “Enable X11 forwarding”.
  5. Go back to Session and click Save.
  6. Then double-click on your new saved session to connect.

You can read this article to get more details on how to connect via SSH to a Raspberry Pi.
Once this is done, your SSH access to the Raspberry Pi is kept, with the X11 forwarding enabled.

Once in the console, you can launch a Raspberry application on your Windows computer with the nohup command:
nohup baobab &

This will start the Raspberry Pi disk manager on your Windows desktop:

From a smartphone

I don’t think it’s possible to use this method from your phone (tell me if you know how).

I’ve already seen people starting an X server on Android to use an android app on their computer, but not the other way around.

3. Remote Access the Raspberry Pi with VNC

Introduction

VNC (Virtual Network Computing) is a system to share a graphical desktop, pretty similas to XRDP.
The difference is that you connect to the current session directly, unlike XRDP which creates a new session.
There are many VNC servers and clients you can use (RealVNC, TightVNC, UltraVNC, …).

VNC runs on port 5900.
You can NAT this port to make it available from the outside if needed.

Installation

Master your Raspberry Pi in 30 days
Sale: 10% off today.
Download the eBook.
Uncover the secrets of the Raspberry Pi in a 30 days challenge.
Learn useful Linux skills and practice multiples projects.

Like SSH, VNC is already installed on any Raspberry Pi OS version so we just need to enable it.
To do this, open the Raspberry Pi configuration tool, go to the “Interfaces” tab and check the “Enabled” box on the VNC line.

That’s it, the VNC server is installed and ready to use.

From Linux

On Linux, the easiest way I found was to install the RealVNC client (in theory you can also use Remmina for VNC, but it didn’t work for me).

So, I recommend downloading RealVNC viewer here.

Leave the default option (Standalone) if it is to use once, but I advise you to choose the .deb or the .rpm according to your OS, to have the RealVNC shortcut in the programs.

In most cases, you can install it by double-clicking on the file:

But if necessary you can do it on the command line, for example:
Debian like : dpkg -i VNC-Viewer-6.18.625-Linux-x64.deb
Redhat like  : rpm -ihv VNC-Viewer-6.18.625-Linux-x64.rpm

Then the use of RealVNC is super simple, just indicate the IP of Raspberry Pi and validate.
Access will be automatically bookmarked for future times.

From Windows

From Windows it is the same thing, you can download and install RealVNC from their official website.

Then launch the software via the start menu, type the IP of the Raspberry Pi and here you are connected to the remote desktop.

The requested logins are the usual users of the system (for example pi/raspberry if you have not changed the password)

From Mac OS

RealVNC is also available for Mac OS, so just get and install it and then follow the same steps as below.

From a smartphone

RealVNC also provides an app for iOS and Android smartphones so that you can use it every time, everywhere.

You can also use this solution with an iPad (as explained in my article here), it would be like if your iPad was the Raspberry Pi monitor.

4. Best for External Access: Teamviewer

Introduction

Teamviewer is a proprietary software very close to VNC for remote desktop use but adds additional features, mostly business-oriented.
For example, Teamviewer facilitates remote access to a machine in another building/city over the Internet.

There is no need to open a specific port for each computer as with previous solutions.
By default, TeamViewer connects on port 5938 but can also use ports 80 and 443 if not opened (so it will work natively most of the time).

Installation

The installation is not obvious because even if it is mentioned in the documentation of a package for the ARM, it is not present in the Linux download links and there isn’t a Raspberry Pi category.
The download is done from this page. You should be able to open this page from your Raspberry Pi, download the correct version (32 or 64 bits) and then install it with the graphical tool.

But if needed, I’ll give you the installation procedure from a terminal, without having to go to their site:

  1. Get the ARM package for TeamViewer:
    wget https://download.teamviewer.com/download/linux/teamviewer-host_armhf.deb
  2. Install it:
    sudo dpkg -i teamviewer-host_armhf.deb
  3. You will get some dependencies errors, fix them by doing:
    sudo apt-get update
    sudo apt-get -f install
  4. If you have a TeamViewer account (paid version), you can configure it by doing:
    sudo teamviewer setup
  5. Otherwise, you will need to set a password to connect, like this:
    sudo teamviewer passwd YOURPASSWORD
  6. And then you can just get the Raspberry Pi ID in this way:
    sudo teamviewer info

From Linux

On Linux, start by downloading the TeamViewer client from the official website.

Then install it with your package manager or by doing something like:
sudo dpkg -i teamviewer_15.25.5_amd64.deb

Start the app via the Start menu or by typing “TeamViewer” in a terminal.
Log in if you have an account.
Then enter the TeamViewer ID from the Raspberry Pi in the Partner ID field and press enter.

teamviewer remote desktop connect

It will ask you the password defined previously and connect to the Raspberry Pi in remote desktop.

From Windows and Mac OS

For Windows and Mac OS users it’s the same procedure, so I will not repeat it.

Download Teamviewer, install it and then enter ID & Password previously set.

From a smartphone

Master Python on Raspberry Pi
Sale: 10% off today.
Get the eBook.
Do more with your Raspberry Pi, learn the useful concepts and take the shortcuts.
You miss half of the fun of using a Raspberry Pi if you don’t know anything about Python.

TeamViewer provides support for its software to Android, iPhone, Windows and Blackberry smartphones.
It is, therefore, possible to use the app in the same way to make spontaneous support from anywhere.

5. Remote desktop with NoMachine

Introduction

NoMachine is another remote desktop access tool that you can use with your RaspberryPi.
NoMachine is based on the NX protocol, which was created to improve the performance of the classic X display.
Using it is very close to the experience you have with VNC.

If used behind a firewall, please note that NoMachine uses port 4000 for connections from the client.
It is possible to change the default ports in the administration tools of the NoMachine server.

Installation

NoMachine is provided for Raspberry Pi so that you can get the package corresponding to your environment on this page.
Currently, ARMv8 is only for 64 bits systems, so if you don’t have a 64-bits OS, download the ARMv7 version, even on a Pi 4/400.

Download it with your web browser and double-click on the downloaded file to install it.
Or you can do everything in a terminal with:
wget https://download.nomachine.com/download/7.7/Raspberry/nomachine_7.7.4_1_armhf.deb
sudo dpkg -i nomachine_7.7.4_1_armhf.deb
Replace the version number with the one you get.

Be patient as the installation may take a few minutes depending on your Raspberry Pi model.
Once complete, the NoMachine icon will appears in the upper-right corner.

From any OS

Once the installation is complete on the Raspberry Pi, you have to install it on the client computer as well.
Go back to the official site and download, this time, the version corresponding to your computer.

Install the downloaded file and launch NoMachine.
An assistant will start, then NoMachine will automatically detect your Raspberry Pi on the network.

You have to double click on the Raspberry Pi to connect.
It will ask you for your credentials (pi/raspberry or the password you have defined), and you will be logged in.

From a smartphone

NoMachine is also available for Android and iOS so that you can connect to your Raspberry Pi from anywhere.
I also made a video on how to use this solution with an iPad, you can watch it there.

Video

Subscribe to the RaspberryTips YouTube channel to receive new videos in your feed :

Thanks to all my Patrons for supporting me, helping me to keep doing this and producing even more tutorials for everyone! Thank you to everyone supporting me there.

Conclusion

Get My Cheat Sheet!
Grab your free PDF file with all the commands you need to know on Raspberry Pi!

So we learned to connect to the remote desktop in 5 ways:

  • With the Xrdp package that provides a Windows-like remote desktop.
  • With SSH and X11 Forwarding that allows launching an app on the client computer (and not the entire desktop).
  • With VNC that enables local access to the Raspberry Pi.
  • With Teamviewer which allows among others remote access to the Raspberry Pi.
  • With NoMachine that allows local access more elegantly and quickly than VNC.

So, what is your favorite?

In my opinion, I think that VNC and NoMachine are my favorites, with a quick and clean display, without the heaviness of Teamviewer.
But it’s because I need it only on my local network, it depends on the cases.

Another option to consider might be Anydesk, I wrote a tutorial recently about it, you can click on the link to learn more about this tool.

Raspberry Pi Resources

Not sure where to start?
Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.
Watch the Raspberry Pi Bootcamp course now.

Master your Raspberry Pi in 30 days
Don’t want the basic stuff only? If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.
Download the e-book.

VIP Community
If you just want to hang out with me and show your support, you can also join the Patreon community. I share behind-the-scenes content there and give you early access to my content. You’ll also get a shoutout when you join.
More details here.

Need help building something with Python?
Create, understand and improve any Python script for your Raspberry Pi.
Learn the essentials, step-by-step, without losing time understanding useless concepts.
Get the e-book now.

You can also find all my recommendations for tools and hardware on this page.


This tutorial doesn't work anymore? Report the issue here, so that I can update it!

0 0 votes
Article Rating

Patrick Fromaget

I'm the lead author and owner of RaspberryTips.com. My goal is to help you with your Raspberry Pi problems using detailed guides and tutorials. In real life, I'm a Linux system administrator with a web developer experience.

Subscribe
Notify of
guest
13 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Chris
2 years ago

Hi Patrick,

Thanks for a super analysis — almost perfect (minor negative is that your tip is undated). And yes, VNC was my original plan, but Nomachine (new to me) looks interesting — I will dig into it when I get out of your site.

BUT, is there a way to do any of this TRULY headless (as in the pi never connects to a screen/keyboard from cradle to grave)? …surely a couple of commands in an auto-run-once script could do the trick, no?

I do have a single Ubuntu laptop, but use the GUI (Linux completely destroys Mac/Win for network admin tasks), but I am not capable of writing that auto-run-once script.

Chris

Chris
2 years ago

Aaaaaaaah: you said it very clearly — SSH/XII needs no intervention on the pi.
Sorry to have troubled you — will try this route tomorrow.

Chris

Paul Harris
2 years ago

In addition to above 5 ways, another way to remote desktop on Raspberry Pi (Windows/Linux/Mac) is by using tools like on premise R-HUB remote support servers. It works on all platforms.

Hans
2 years ago

Hi Patrick,
thnx for information.
my favorite is Nomachine but…
how do i solve the problem in Nomachine with the german keyboard?
#Hans

Andre Milani Martin
Andre Milani Martin
2 years ago

Thanks for the guide with team viewer. This finally worked for me.

Lutz
Lutz
1 year ago

Thanks so much – it got me going. I ended up using TeamViewer (I already manage a few machines, so it was straight forward to add my Pi to that account).
Just two comments, if anyone is interested:
RealVNC is not available on Appstore and on their website directly they seem to offer a paid version (free trial-then buy), so that’s costly.
Teamviewer did work…but only using YOUR instructions. Kudos! If one goes directly to TV website, they offer linux 32b download but that bombs out.
Net/net: great job, much appreciated

Jason
Jason
1 year ago

Thanks for guide- it was very easy to follow but I ran into one problem that I cannot figure out.

I have my raspberry pi4 setup as my remote machine and am connecting to it via rdp from my Windows 10 Laptop. My laptop will connect to the raspberry pi and display everything but the raspberry pi does not accept the mouse/keyboard input from my laptop. Any suggestions would be appreciated!

Princess Jean Magsino Coquia
Princess Jean Magsino Coquia
Reply to  Jason
1 year ago

I have the same problem hehe . Did you figure it out already ?

pgr
pgr
1 year ago

What about Moba Xterm? It has a rdp function in it, hasn’t it?

Recent Posts

Master your Raspberry Pi - 10% off