Prepare a headless Raspberry Pi 3 with Arch Linux ARM to connect to WiFi

Revision history
Tags: raspberrypi arch

Prepare SD-card

Prepare the SD-card to use for the Raspberry Pi 3 by following the official documentation for Arch Linux ARM.

Prepare headless operation

It is expected that the root file system on the SD-card is mounted on your system at /mnt/root.

Beware that both root and alarm user has default passwords, hence the Pi should never be put on an untrusted network before those are changed (there’s a reason the username is alarm).

Let’s let dhcpcd take care of wireless networking (it’s not handling wired connections with this setup):

# ln -s /usr/lib/systemd/system/dhcpcd@.service /mnt/root/etc/systemd/system/

Add a hook so that dhcpcd can take care of starting wpa_supplicant:

# ln -s /usr/share/dhcpcd/hooks/10-wpa_supplicant /mnt/root/usr/lib/dhcpcd/dhcpcd-hooks/

Create a wpa_supplicant configuration file with your wifi connection details

# echo "ctrl_interface=DIR=/var/run/wpa_supplicant" > /mnt/root/etc/wpa_supplicant/wpa_supplicant-wlan0.conf
# wpa_passphrase "My SSID" "My passphrase" >> /mnt/root/etc/wpa_supplicant/wpa_supplicant-wlan0.conf

Place your public key inside root user’s SSH configuration directory to allow for root login

# mkdir /mnt/root/root/.ssh
# chmod 0700 /mnt/root/root/.ssh
# cat ~/.ssh/ > /mnt/root/root/.ssh/authorized_keys
# chmod 0600 /mnt/root/root/.ssh/authorized_keys

Boot up the Pi and it should connect to the wireless network you specified automatically on boot.

When I’m unsure what IP a device on my network has got, I use arp-scan to probe.

# arp-scan -l
Interface: wlp3s0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.9.5 with 256 hosts (	xx:xx:xx:xx:xx:a6	xxx	xx:xx:xx:xx:xx:24	xxx	xx:xx:xx:xx:xx:a4	Raspberry Pi Foundation

3 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.9.5: 256 hosts scanned in 2.013 seconds (127.17 hosts/sec). 3 responded

Then attempt SSH

$ ssh root@ -i ~/.ssh/id_rsa
Last login: Mon Jul 22 14:30:50 2019 from
[root@alarm ~]#

Apparently, I need to get ntpd or systemd-timesyncd running.


Network time synchronisation

I had troubles using systemd-timesyncd, as it was failing all the time. And, initially, I had problems with the default config of openntpd, but got it working by avoiding hostnames for the server directives, and instead using plain IPv4 addresses. I got the IPs of the DNS records of (dig +short

/etc/ntpd.conf (on the Pi):


Add a hook at /etc/dhcpcd.exit-hook (on the Pi):


if $if_up; then
	# Don't wait for this to finish
	systemctl start openntpd.service &
elif $if_down; then
	systemctl stop openntpd.service

If you have any comments or feedback, please send me an e-mail. (stig at stigok dotcom).

Did you find any typos, incorrect information, or have something to add? Then please propose a change to this post.

Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.