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.
If you forget the address of your Pi, you can run ifconfig from the pi itself (which of couse means hooking it back up to a monitor\keyboard) to get it.
Programming Python on the Pi will be so much easier now…

Pi's desktop on my Mac's desktop: Success!

 

Raspberry Pi
Raspberry Pi WebIDE & making things blink
  • Trackback are closed
  • Comments (3)
    • george
    • July 18th, 2013 9:27am

    I have a MacBook Air, and I’ve successfully connected my Pi to my Mac via SSH and have access to my Pi’s terminal from my Mac.

    The problem I have right now is that my Pi can’t access the Internet to download the VNC client. I can successfully ping Airport from my Pi, but that’s it. I have my sharing preferences on to share with my Ethernet adapter.

    I made a static IP address for my ethernet adapter and connected my Pi to it.

    Any help from a fellow MacBook Air/Pi user would be awesome!
    -George

  1. I got this working just fine but using the nano Wifi adapter Adafruit sells. I’m not sure about using your Mac’s built in Wifi, you may need to connect to the Pi using just an ethernet cable.

    • Tino Kanngiesser
    • November 23rd, 2013 11:06pm

    Yes, it’s working great. Thanks for the good tip. I have a quick question regarding the keyboard setup since I realised that I cannot type e.g. [] etc. by using the standard Mac keys. Do you have made any changes to the Raspberry configuration in order to have it work?
    Thanks in advance, Tino

Comment are closed.