Here, we'll discuss how to create a new custom image from the latest Raspbian OS and copy it into a SD card.
Spin-up & SSH into the Vagrant box if you are not using Linux.
vagrant up && vagrant ssh
cd base_image
Run the script with sudo
.
sudo ./init-base.sh
This will perform the following
- Creates a
downloads
- Download the latest
raspios_armhf
image - Enable SSH on image
- Create new username & password for the default user
- Generate the new 'custom' image -
xxx-armf-ssh-enabled.img
- Exit from vagrant SSH.
- Insert the SD card.
- Run the following command to unmount it.
diskutil unmountDisk /dev/disk2
- Copy generated image to SD card - something similar to this.
sudo dd bs=4M status=progress if=base_image/downloads/2022-09-22-raspios-bullseye-armhf-ssh-enabled.img of=/dev/disk2