Fedora CoreOS is another container operating system, with minimal operating system for running containerized workloads securely and at scale. It’s designed for clusters but also operable standalone, optimized for Kubernetes but also great without it.

You can deploy CoreOS to the cloud, install in bare metal or even run as VM, but in this writing we’re gonna install CoreOS from live ISO. The live ISO installation method can be used for bare metal or virtual machine like VirtualBox or VMWare. Download the live ISO of Fedora CoreOS from https://fedoraproject.org/coreos/download/ or download with podman command:

podman run --security-opt label=disable --pull=always --rm -v .:/data -w /data \
    quay.io/coreos/coreos-installer:release download -s stable -p metal -f iso

Burn the ISO to disk. You can use dd on Linux and macOS, or use Rufus in “DD Image” mode on Windows.

dd if=fedora-coreos-38.20230514.3.0-live.x86_64.iso of=/dev/sda bs=4M status=progress && sync

Change fedora-coreos-38.20230514.3.0-live.x86_64.iso in the if parameter to your downloaded ISO and the value of /dev/sda to your disk device.

To install Fedora CoreOS from live ISO, we need to produce an Ignition config. Ignition is a configuration file that runs only once during the first boot of the system. It can create users, partition disks, format filesystems, and write files before the userspace begins to boot.

Because Ignition configurations are formatted as JSON, these files are not easy for humans to read or write, so we use Butane to convert the YAML file (more readable for humans) into a JSON Ignition config.

Download the butane program directly from package manager:

# Fedora
sudo dnf install -y butane

# Homebrew
brew install butane

# Windows
winget install --id Fedora.CoreOS.butane

For other manual installations, binary can be downloaded from https://github.com/coreos/butane/releases.

wget https://github.com/coreos/butane/releases/download/v0.18.0/butane-x86_64-unknown-linux-gnu
sudo mv butane-x86_64-unknown-linux-gnu /usr/local/bin/butane
sudo chmod +x /usr/local/bin/butane

Create the config.yml file that contains the user password and ssh authorize keys:

variant: fcos
version: 1.4.0
passwd:
  users:
    - name: core
      password_hash: "$1$yo4rs4lt$IdIeXU/Atn62lqBBLOdad1"
      ssh_authorized_keys:
        - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHn2eh... hanan@pc-dev"
        - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSNZc3... user@laptop"

The password hash can be generated by the openssl command bellow:

$ openssl passwd -1 -salt yo4rs4lt
Password: coreos

$1$yo4rs4lt$IdIeXU/Atn62lqBBLOdad1

Generate the Ignition config from the config.yml file using butane command:

butane config.yml -o config.ign

Put the Ignition file in the local network or Internet. For example I ran the python HTTP server in my local computer that can be reached in my network with command python -m http.server

Run coreos-installer to install CoreOS to the disk with the Ignition config:

curl http://192.168.100.1:8000/config.ign -o config.ign
sudo coreos-installer install /dev/sda \
    --ignition-file config.ign

Once it completed then power off the machine and start again. It will prompt login screen once booted, now you can login with user ‘core’ and access it from remote through SSH.

Leave a comment

Leave a Reply