How to Upgrade a Raspberry Pi for Remote Desktop

Raspberry Pi low-cost computer

The Raspberry Pi is a low-cost computer with interfaces available for displays, human input devices, and multimedia equipment.  But sometimes it is more convenient to switch to using a remote interface after you already have the Pi in working condition.

Objective

Today, I will start with a Raspberry Pi that already has a working Raspberry Pi operating System and access to a local network.  This one has its own dedicated monitor, and a keyboard/mouse offscreen.

The goal is to make this Pi accessible anywhere within the local network.

If your Raspberry Pi does not yet have internet access or an Operating System, you will probably want to refer to my earlier article on starting this process from scratch: “Raspberry Pi 4 Setup for Windows Users.”

Notice of Non-Affiliation and Disclaimer: As of the publication date, we are not affiliated with, associated with, authorized by, endorsed by, compensated by, or in any way officially connected with the Raspberry Pi Foundation, PuTTY.org., Microsoft, or their owners, subsidiaries or affiliates.  The names Windows and Microsoft, as well as related names, marks, emblems, and images are trademarks of their respective owners.

External Links: Links to external web pages have been provided as a convenience and for informational purposes only. Unboxing Tomorrow and Voxidyne Media bear no responsibility for the accuracy, legality or content of the external site or for that of subsequent links. Contact the external site for answers to questions regarding its content.

Step 1: Update and Upgrade

As usual, the first step is to update your installed software package using…

sudo apt-get update
sudo apt-get upgrade

Step 2: Install PuTTY for Windows

On the Windows machine, visit the PuTTY.org website, where you can download an official copy of the PuTTY application.  PuTTY is a secure shell (SSH) client for Windows.  PuTTY also includes the PuTTY Secure Copy client (PSCP) for the Windows command line.  PSCP is outside the scope of this walkthrough, but you can use it later to transfer files between the Raspberry Pi and Windows.

Figure 2: The PuTTY.org Website as of November 2020

As with anything else you download from the internet, scan PuTTY with your favorite anti-malware tool.  If things look good, prepare to open it later, then return to your Raspberry Pi.

Step 3: Enable SSH (Raspberry Pi)

Back at the Raspberry Pi, return to the terminal.  Reboot the system for good measure, and when the desktop reloads, open the terminal again.

In the terminal, open the Pi Configuration tool using:

sudo raspi-config
Figure 3: The raspi-config Utility

In the resulting menu, enable SSH by navigating to:

Interface Options –> SSH

Follow the on-screen instructions to enable SSH capabilities.

Step 4: Change Your Password (Raspberry Pi)

If you’re still using the default password of “raspberry,” you should now use the raspi-config application to switch to a stronger password.  This is a cybersecurity measure that is especially important for connected devices that have SSH enabled.

Change the password by navigating to:

System Options –> Password

Step 5: Get your IP Address (Raspberry Pi)

How you need to find out the internet protocol (IP) address your Pi has leased on the local network.  In the terminal, type:

ifconfig

Record or memorize the IP address (inet address) for later.

Step 6: Open PuTTY (Windows)

Open the PuTTY application.

At the PuTTY configuration Window, you need to set the IP address to match the address your Raspberry Pi reported earlier.  You should also set the following properties…

  • Port = 22
  • SSH = selected
Figure 4: How to Configure PuTTY for a Raspberry Pi SSH Connection

When that is done, click “Open” to connect remotely to the Raspberry Pi.

Because this is your first time connecting, you may see a PuTTY Security Alert asking if your trust the device and its unrecognized server key.  If things look good, select “Yes.” to connect.

Figure 5: A Security Warning Typical of a First-Time Connection to a Raspberry Pi

Step 7: Access the Pi from Windows

In the resulting PuTTY window, you should see a prompt to enter the username and password for your Raspberry Pi.

Authenticate, and then you should see a terminal just like the Raspberry Pi’s.

Figure 6: The Raspberry Pi Terminal as Seen from Windows 10

Step 8: Install Remote Desktop Support

You can continue to use the PuTTY terminal for this step.

If you want to use the Pi’s Graphical User Interface (GUI) as well, you have one final step: installing remote desktop support using xrdp and tightvncserver.

To start from a clean slate, type into the SSH terminal:

sudo apt-get remove xrdp vnc4server tightvncserver

In my case, none of these were already installed anyway, but now we know we are starting clean.

Install tightvnc server…

sudo apt-get install tightvncserver

Respond with the “Y” key (for “yes”) if the installer asks if you want to continue.

Now install xrdp in a similar fashion…

sudo apt-get install xrdp

By default, the xrdp service will start up as soon as you have installed it.

To exit the remote terminal, enter…

exit

Step 9: Run Windows Remote Desktop

Use the Windows search bar to search for the “Remote Desktop” application.

Figure 7: The Windows Remote Desktop Application

Enter your Raspberry Pi’s IP address.

Then click “Connect.”

You will probably see a warning telling you to verify the device you are connecting to.  If nothing seems unusual, click OK to proceed.  If xrdp is running properly, you will see the following screen in Windows Remote Desktop…

Figure 8: A New Windows Remote Desktop Connection to the Raspberry Pi

Enter the Raspberry Pi’s username and password.  If everything went smoothly, you should see the Raspberry Pi desktop!

Figure 9: The Raspberry Pi Desktop as Viewed from Windows 10

Conclusions

The speed and convenience of the SSH interface is just one of the reasons why I recommend using a strong password with the Raspberry Pi as early as you can.

To see how to transfer files between your Raspberry Pi and your Windows machine, be sure to check out my recent article on PSCP!

Hopefully this helps with your next project!

References

[1]B. Mayes, “Raspberry Pi 4 (8GB) Setup for Windows Users,” 9 June 2020. [Online]. Available: https://unboxing-tomorrow.com/raspberry-pi-4-8gb-setup-for-windows-users/. [Accessed 25 Nov. 2020].
[2]Putty.org/, “Download PuTTY – a free SSH and telnet client for Windows,” [Online]. Available: https://putty.org/. [Accessed 25 Nov 2020].
[3]PuTTY.org, “PuTTY FAQ,” 11 Mar. 2020. [Online]. Available: https://www.chiark.greenend.org.uk/~sgtatham/putty/faq.html#faq-support. [Accessed 25 Nov 2020].
[4]B. Mayes, “Raspberry Pi: How to Transfer Files to Windows,” 22 Oct. 2020. [Online]. Available: https://unboxing-tomorrow.com/raspberry-pi-how-to-transfer-files-to-windows/. [Accessed 25 Nov. 2020].

Important Notice: This article and its contents (the “Information”) belong to Unboxing-tomorrow.com and Voxidyne Media LLC. No license is granted for the use of it other than for information purposes. No license of any intellectual property rights is granted.  The Information is subject to change without notice. The Information supplied is believed to be accurate, but Voxidyne Media LLC assumes no responsibility for its accuracy or completeness, any error in or omission from it or for any use made of it.  Liability for loss or damage resulting from any reliance on the Information or use of it (including liability resulting from negligence or where Voxidyne Media LLC was aware of the possibility of such loss or damage arising) is excluded.