In my home lab I have a Raspberry Pi 4, a Raspberry Pi 3 B+, and a Raspberry Pi Zero W (thanks Graham!). Setting up and configuring these is pretty straightforward, I primarily followed the instructions from the RaspberryPi.org but I thought I’d add my notes for easier reference. The instructions are fairly similar for each, so I’m going to focus on the Raspberry Pi Zero W.
Installing the Base Image
I flashed the image onto a 32 gig microSD card with Balena Etcher for OSX.
With my microSD card ready I plugged in my mini-HDMI adapter and HDMI cable, a micro-B OTG USB hub and a USB keyboard and USB ethernet cable and booted into Raspbian.
The default user/password combination on Raspbian is
raspberry, which you’ll want to immediately change with
I then used the built-in
raspi-config command to enable SSH and to configure the hostname, wifi, timezone and locale.
I then copied over my SSH key so I wouldn’t need to use my password when logging in.
Now that I was able to SSH over and sudo to root, there were a few final steps. Raspbian has the swap configured, which isn’t very useful on a system booting off an SD card.
dphys-swapfile swapoff dphys-swapfile uninstall update-rc.d dphys-swapfile remove apt-get remove dphys-swapfile
To ensure the latest versions of the base install:
apt-get update apt-get upgrade
Then I rebooted the box and unplugged the ethernet, video, and keyboard. It was now on my network via wifi and ready to be remotely administered.
GPU Memory Usage
Because my systems are used primarily has headless servers, I’ve configured them to use less GPU memory by setting
/boot/config.txt. I do this in the mattray::raspberrypi recipe used by all of my Raspbian systems.
Raspbian sets the file
in an attempt to support both the 6l and 7l ARMHF platforms. This breaks the Chef 32-bit ARM builds on Raspbian so I have replaced this line with
echo /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so > /etc/ld.so.preload
on the Raspberry Pi 3 and 4 and
echo /usr/lib/arm-linux-gnueabihf/libarmmem-v6l.so > /etc/ld.so.preload
on the Raspberry Pi Zero.