Raspberry Pi Remote Desktop for Mac

by hlothsch in Circuits > Raspberry Pi

4406 Views, 0 Favorites, 0 Comments

Raspberry Pi Remote Desktop for Mac

mac pic.jpg
pipic.jpg
logo_tightvnc.png

This is a tutorial on how to setup tightvnc to access a Raspberry Pi's desktop using a Mac, when the Pi is running in headless mode.

Supplies

1. SSH enabled Raspberry Pi

-This instrucable assumes that your Pi is already online running in headless mode, that is to say, connected to the network you intend to remotely access it through. There are many extant tutorials on how to do this, come back here when you successfully SSH into your Pi and are ready to set up remote desktop.

2. A Mac running Java

- The reason for this exercise. As the Remote Desktop Protocol that is the standard was developed by Microsoft, macs have no client for RDP connections installed by default. We will be rectifying this by installing an alternate client using a different protocol, tightvnc. Tightvnc relies on Java, so we will need it installed for our client to work.

SSH Into Your Pi

Screen Shot 2020-09-27 at 6.47.25 PM.png

Connect to your Pi to begin the process.

Download Tightvnc Server Onto Your Pi

image6.png

Enter the command

$ sudo apt-get install tightvncserver xrdp

Run Tightvncserver

image3.png

Enter the command

$ tightvncserver

on the Pi to start the program. You will be prompted to enter a password. This will be used later to connect to your desktop. The password must be between 5 and 8 characters. Any additional characters you type will be truncated.

Note: This step must be performed via SSH every time the Pi is turned on in order to connect the client

Download the Tightvnc Java Client on Your Mac

image5.png

Go to

https://www.tightvnc.com/download.php

and download the latest java client

Unzip and Open

image9.png

Unpack the contents to the directory of your choice, and then attempt to open tightvnc-jviewer.jar. Most likely you will see the above error. If it opens, go ahead and skip to step 8.

From System Preferences Open Security and Privacy

image1.png

Open System Preferences and select Security and Privacy

Grant Permissions

image4.png

Navigate to the General tab, and look towards the bottom. There should be a notification about our .jar. Go ahead and select Open Anyway.

Run Tightvnc Client to Connect

image8.png

Run the .jar, and it will open this window. Enter the Pi's IP address in the Remote Host field, and change the port number to 5901. You are now ready to connect to your Pi.

Enter Password

image12.png

If everything went well in the previous step, you will be prompted to enter the password you created in step 3.

If this is not what you see, most likely either the IP address is wrong, or if you are returning to this tutorial after initial installation, you may have forgotten to run the server on the Pi via SSH first. Go ahead and verify that information is correct.

Congratulations!

image11.png

You are now viewing your Pi's desktop... remotely!

A Note on Creating GUIs

image2.png
image10.png
image7.png

Because of the nature of how the screen is created and displayed, you might run into permissions issues trying to run programs from the command line that will create a GUI. The easiest workaround for this is to simply preface these commands with 'gksudo'. This will prompt you for your sudoer password, and then create the GUI you are looking for.