Configure your new Raspberry Pi in headless mode using macOS

You got your fresh Raspberry Pi but you lack external keyboard, mouse and monitor? Don't worry there an easy way to configure your pretty microcomputer. All you need is a little patience and some beer. 

To be honest initial configuration of Raspberry Pi is so easy I thought that I don't need to write this guide. But after spending some time, trying to find such a guide, I decided to create one.

First step of configuring Raspberry Pi supposedly should be the hardest. You need to install software allowing you to mount ext4 partition, and access it. Af far as I know it doesn't work (at least for me). The easiest way is to connect Raspberry Pi directly with your router, login via ssh and set wireless connection.

ssh to your Raspberry Pi

If you try to login using ssh you probably get an error like that (IP address may be different)

ssh: connect to host port 22: Connection refused

This means that you don't have ssh access to your Raspberry Pi. There is an easy fix for that. You need to mount SD card with Raspbian and create file named ssh on boot partition.  Next time you try to use ssh to login to Raspberry Pi you should be able to do it (source).

Configure WiFi

Probably you would like to use your Raspberry Pi with your WiFi. To do it connect to your Pi via ssh and edit /etc/wpa_supplicant/wpa_supplicant.conf file. You can do it using nano (there's no vim in default installation).


Enjoy your new Raspberry Pi

Last step - reboot (don't forget to disconnect ethernet cable). Now you can connect using assigned IP address or raspberry.local domain name.

ssh [email protected]

If using local domain doesn't work for you, use IP address. Enjoy!