-
Download latest LTS image from official site.
-
Write the image to your SD card. In this example, the SD card is mounted on
/dev/disk4
.xzcat < ubuntu-24.04.1-preinstalled-server-arm64+raspi.img.xz | sudo dd of=/dev/disk4 bs=16m status=progress
-
Mount a SD card on your Mac.
cd /Volumes/system-boot
-
Setup netplan using
./network-config
.code ./network-config --- network: version: 2 ethernets: eth0: addresses: [192.168.0.221/24] routes: - to: default via: 192.168.0.1 nameservers: addresses: [8.8.8.8] optional: true
-
Enable SSH.
code ./user-data --- - ssh_pwauth: false + ssh_pwauth: true
-
Set hostname.
echo "hostname: kvm1" >> ./user-data
-
Optional: Disable bluetooth if don't need.
echo "dtoverlay=disable-bt" >> ./config.txt
-
Optional: Disable WiFi if don't need.
echo "dtoverlay=disable-wifi" >> ./config.txt
-
Optional: Activate cgroup if use docker and kubernetes.
code ./cmdline.txt <snip> cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1