Connecting the Mac to the Pi
The main hurdle I’ve had with the Raspberry Pi is simply seeing the screen: Since I don’t have a spare monitor laying around, it’s plugged in over HDMI to my livingroom TV. Sitting on my couch,… the text is really small.
Thanks to the awesome people at Adafruit Learning Systems, they’ve provided two tutorials specifically for logging into your Pi remotely over SSH (Secure SHell), and remote-controlling the desktop via VNC (Virtual Network Computing). This gives you the advantage of not needing a spare monitor, keyboard & mouse to control the Pi: You can use your current PC’s setup.
I don’t know anything about Linux or sysadmin work, but their tutorials worked exactly as shown and I was connected in no time. I’m posting this mainly as a reminder to myself how I got all this stuff hooked up…
- First, you need to get a SSH connection from your computer (in my case, Macbook Air) to the Pi: Adafruit’s Raspberry Pi Lesson 6: Using SSH shows you how. Once this is setup, you can easily remotely login from a Terminal on your PC, and take control of the Pi. But you don’t have access to it’s gui system, only the command-line.
- Second, to control the Pi’s gui, you need to install a VNC server on the Pi, and a client on your PC (Adafruit recomends RealVNC’s ‘VNC Viewer’). Their tutorial covers all of this: Adafruit’s Raspberry Pi Lesson 7: Remote Control with VNC.
Once all that software is installed\setup\configured, how do you make the connection?
- Boot the Pi, wait for it to ‘be ready’.
- Open a terminal on your PC: SSH into the pi (put in appropriate ifnet address of the Pi and login name):
-
ssh 192.168.2.97 -l myPiLogin
- The terminal is now controlling the Pi.
- Next, start the VNC server on the Pi:
-
vncserver :1
- Now that you have a SSH connection to the Pi, and the VNC server running on the Pi, you can connect via VNC Viewer on your PC:
- Open the VNC Viewer app, and connect to the pre-configured server you made earlier: For example, 192.168.2.97:1
- After entering in the password, the Pi’s desktop should spring to existence on your PC.