Note: this guide will not spoon feed you basic things which can be found by simply searching on the web.
This post will Guide you on how to install Manjaro ARM (All editions) headless on a RPI using wifi. Many people don’t have Ethernet and using a monitor to setup headless install is PITA. So lets use wifi and ssh to setup our headless install.
This will work on Any RPI version with wifi (3b, 3b+, zero w etc). Heck it may also work with any SBC with WiFi.
You will need:
- A PC with Linux installed (Manjaro Preferred, but can work with any distro if you tweak some things) or boot into Manjaro Live USB.
- Internet or WiFi connection
- SD card to write Manjaro ARM RPI4 minimal
- A brain (must)
- Download the manjaro image you want to flash from the official Website and BalenaEtcher
- Flash that image using BalenaEtcher onto the sd-card/ssd.
- Here is a guides for ultra-noobs.
These steps are for Arch based distros but can be modified to work on any. Make sure you have installed AUR helper like pamac or yay.
We need to chroot into the root partition. To do that we need to install
qemu-user-static-bin on our PC.
yay -S --noconfirm --needed qemu-user-static-bin
Then mount your sd-card’s root partiton and bind important directories. Mine was
sdc2. so run below commands on your PC.
sudo mount /dev/sdc2 -o rw /mnt sudo mount --bind /dev /mnt/dev/ sudo mount --bind /sys /mnt/sys/ sudo mount --bind /proc /mnt/proc/ sudo mount --bind /dev/pts /mnt/dev/pts
If you want to run binaries from different architecture you will need an Emulator. Qemu is a good candidate for this. Copy the static ARM binary that provides emulation.
sudo cp $(which qemu-arm-static) /mnt/usr/bin sudo systemctl restart systemd-binfmt.service
For enabling networking, copy your resolv.conf to sdcard. you can also set other DNS servers if you like by editing this file.
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
And now finally chroot into the directory.
sudo chroot /mnt qemu-arm-static /bin/bash
If above command doesn’t work, try
sudo chroot /mnt .
Once you have chrootod into the system, you can do whatever you want. We will enable SSH and install other software like tigerVNC. We will also enable NTP, cron, and fstrim services (fstrim is necessory for ssd’s)
systemctl enable cronie systemctl enable fstrim.timer systemctl enable sshd systemctl enable systemd-timesyncd timedatectl set-ntp true
Setup WiFi on the RPI4 SD card from your PC. Manjaro ARM switched to iwd for managing networking. so we will create iwd config file and fill it with our WiFi’s SSID and password. Create WiFi settings file. Replace ‘WiFi_name’ with your WiFi SSID
mkdir -p /var/lib/iwd touch /var/lib/iwd/WiFi_name.psk
Add wifi details. Replace ‘WiFi_name’ with your WiFi SSID and ‘Password’ with your WiFi password in below 2 lines also.
echo "[Security]" | tee -a /var/lib/iwd/WiFi_name.psk echo "Passphrase=Password" | tee -a /var/lib/iwd/WiFi_name.psk
Finally Unmount the sdcard. I did force unmount.
exit sudo umount /mnt/dev/ -l sudo umount /mnt/sys/ -l sudo umount /mnt/proc/ -l sudo umount /mnt/dev/pts/ -l sudo umount /mnt/ -l
Now Plug the sdcard in RPI and boot. Then ssh using
root@<ip-addr>. Now you can setup VNC server and other things to complete the setup. You need to do VNC or have some kind of graphical connection to the machine since these versions with DE installed will have GUI setup wizard.
Some useful Links and Resources
- RaspberryPi/qemu-user-static - Debian Wiki
- iwd - ArchWiki
- Chrooting into raspbian SD card: How I did it - Raspberry Pi Forums
- [HowTo] Chroot from or into any Linux distribution
- How to set up VNC on home network [Manjaro i3] - #8 by Fabby