HypriotOS is a linux distro for the Raspberry Pi that focuses on using Docker.
1. Download the Raspberry Pi Imager (not the Raspberry Pi OS)
2. Download hyriot os
- Hypriot is made to:
- Run on Raspberry Pi
- Run headless (ie no destkop)
- Run Docker
- Be 10-20x faster to flash than Raspberry Pi OS
Change X.YY.Z
to the latest version, in my case it's 1.12.3
*We are going to completely erase this card
Under Operating System
- Select Custom
- Navigate to your unzipped Hypriot OS (
hypriotos-rpi-vX.YY.Z.img
nothypriotos-rpi-vX.YY.Z.img.zip
) Under Storage system - Select the microSD card you inserted in step 4
When in doubt, do not just select anything. Eject your card, take note of available options on the Imager, insert card, select the new option.
- Confirm warnings
- Wait about 2-10 minutes
user-data
is just a yaml
file.
The following items I tend to change:
hostname
- default is
black-pearl
- default is
users.name
- default is
pirate
- default is
users.gecos
- default is
Hypriot Pirate
- default is
users.plain_text_passwd
- default is
hypriot
- default is
users.ssh_authorized_keys
- This is an optional field, I add my public ssh key here.
timezone
- default is
America/Los_Angeles
- default is
write_files.content.network.ssid
- default is
YOUR_WIFI_SSID
- default is
write_files.content.network.psk
- default is
YOUR_WIFI_PASSWORD
- default is
YOUR_WIFI_SSID
andYOUR_WIFI_PASSWORD
are your wifi network name and wifi password respectively.
I recommend setting passwords using at least plain_text_passwd
:
python3 -c "import secrets;print(secrets.token_urlsafe(32))"
Setting the ssh_authorized_keys:
will allow you to login without using a password. To get your ssh public key you can just:
mac/Linux
cat ~/.ssh/id_rsa.pub | pbcopy
windows
cat ~/.ssh/id_rsa.pub | type
Here's my working sample:
#cloud-config
# vim: syntax=yaml
#
# Set your hostname here, the manage_etc_hosts will update the hosts file entries as well
hostname: tars-1
manage_etc_hosts: true
# You could modify this for your own user information
users:
- name: cfe
gecos: "CFE for Life"
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
groups: users,docker,video,input
plain_text_passwd: qcxOIuSjAI1dKebYLwbzT7OciGNV5FpNe4Ij21BWRr0
lock_passwd: false
ssh_pwauth: true
ssh_authorized_keys:
- ssh-rsa AAAAB3N... cfe@justins-mbp.lan
chpasswd: { expire: false }
# # Set the locale of the system
locale: "en_US.UTF-8"
# # Set the timezone
# # Value of 'timezone' must exist in /usr/share/zoneinfo
timezone: "America/Los_Angeles"
# # Update apt packages on first boot
# package_update: true
# package_upgrade: true
# package_reboot_if_required: true
package_upgrade: false
# # Install any additional apt packages you need here
# packages:
# - ntp
# # WiFi connect to HotSpot
# # - use `wpa_passphrase SSID PASSWORD` to encrypt the psk
write_files:
- content: |
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
path: /etc/network/interfaces.d/wlan0
- content: |
country=de
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WifiIsComing"
psk="KingOfTheNorth"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
path: /etc/wpa_supplicant/wpa_supplicant.conf
# These commands will be ran once on first boot only
runcmd:
# Pickup the hostname changes
- 'systemctl restart avahi-daemon'
# Activate WiFi interface
- 'ifup wlan0'
13. Eject microSD, insert into pi, and boot. Wait for initial boot. Restart the pi again to ensure the user-data
(aka cloud-init
config) changes take place from above.
If you ever need to change
user-data
after you boot for the first time, you must reflash the OS and do steps 10-13 again.
14. To repeat on new raspberry pis, I recommend you change the hostname
in user-data
each time to something new. The reason I used tars-1
is because my next few would be tars-2
, tars-3
, etc.
macOS
nmap -sP "$(ipconfig getifaddr en0)/24" | grep "tars"
linux
nmap -sP "$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')/24" | grep "tars"
windows users use this guide