Skip to content

Instantly share code, notes, and snippets.

@fagci
Created August 6, 2022 09:58
Show Gist options
  • Save fagci/c3aaa4d278f2a8d3edcc6a4104f455e0 to your computer and use it in GitHub Desktop.
Save fagci/c3aaa4d278f2a8d3edcc6a4104f455e0 to your computer and use it in GitHub Desktop.
[NOTE] Install Ubuntu server on Raspberry Pi 4 using smartphone
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
eth0:
dhcp4: true
optional: true
version: 2
wifis:
wlan0:
dhcp4: true
optional: true
access-points:
"<ssid>":
password: "<plain_text_password>"
# 1. umount mmc card using Setting > Storage
# 2. extract .img from tar.xz downloaded from
# https://old-releases.ubuntu.com/releases/focal/ubuntu-20.04.1-preinstalled-server-arm64+raspi.img.xz
# 3. write image to sdcard
dd if=/sdcard/ubuntu-20.04.1-preinstalled-server-arm64+raspi.img of=/dev/block/mmcblk0
# 4. create dir to mount partition w/ RW etc folder
su
mkdir /mnt/rp
# 5. mount partition
mount /dev/block/mmcblk0p2 /mnt/rp
# 6. copy 50-cloud-init.yaml (example file included)
cp /sdcard/50-cloud-init.yaml /mnt/rp/etc/netplan/
# 7. unmount partition
umount /mnt/rp
# 8. enable ssh
mount /dev/block/mmcblk0p1 /mnt/rp && touch /mnt/rp/ssh && umount /mnt/rp
# 9. insert microSD card into Raspberry Pi and enjoy!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment