Prerequisites for the tutorials

The following tutorials are focused on helping you get started with Fedora CoreOS by learning how to automatically configure (or provision) an instance on first boot. Each tutorial has its roots in the previous one thus it is recommended to follow them sequentially.

If you don’t know what Fedora CoreOS is, you can refer to the FAQ for more information.

If you need any help or need to ask any questions while going through those tutorials, please join the Matrix room, or join our discussion board. If you find any issue in the tutorial, please report them in the fedora-coreos-docs issue tracker.

You should start with the setup instructions from this page as they must be completed first to be able to follow the tutorials.

Virtualização com libvirt

These tutorials are written targeting a Linux environment with a working libvirt setup and hardware virtualization support via KVM. There is, however, nothing specific to the libvirt environment in those tutorials and you can thus try the same configurations on any platform where you have console access (or you can skip to the SSH access tutorial to get remote access).

For instructions to set up libvirt and KVM you may refer to the Getting started with virtualization guide from Fedora. Although this setup guide is focused on Fedora, the tutorials should work on any distribution with libvirt installed and running.

Local working directory

To keep all configuration files and Fedora CoreOS images in the same place, we will create a new directory to work from:

mkdir ~/coreos
cd ~/coreos

SSH public key

Some of the tutorials add an SSH public key to the instances to allow for SSH access as opposed to serial console access. Please place a public key in your current working directory under the filename ssh-key.pub. For example, for a RSA keypair the default location would be in ~/.ssh/id_rsa.pub:

cp ~/.ssh/id_rsa.pub ssh-key.pub

Ferramentas do CoreOS

Para os tutoriais, precisaremos das seguintes ferramentas:

  • Butane: To generate Ignition configuration from Butane config files.

  • coreos-installer: Para realizar o download da última imagem QCOW2 do Fedora CoreOS.

  • ignition-validate: Para validar arquivos de configuração ignition.

Configure com podman ou docker

All the tools required to work with Fedora CoreOS are available from containers hosted on quay.io:

podman pull quay.io/coreos/butane:release
podman pull quay.io/coreos/coreos-installer:release
podman pull quay.io/coreos/ignition-validate:release

Para fazer isso ser mais simples de digitar, você pode adicionar os seguintes aliases para a configuração do seu shell:

alias butane='podman run --rm --interactive       \
              --security-opt label=disable        \
              --volume ${PWD}:/pwd --workdir /pwd \
              quay.io/coreos/butane:release'

alias coreos-installer='podman run --pull=always            \
                        --rm --interactive                  \
                        --security-opt label=disable        \
                        --volume ${PWD}:/pwd --workdir /pwd \
                        quay.io/coreos/coreos-installer:release'

alias ignition-validate='podman run --rm --interactive       \
                         --security-opt label=disable        \
                         --volume ${PWD}:/pwd --workdir /pwd \
                         quay.io/coreos/ignition-validate:release'

Você pode então usar coreos-installer para realizar o download da última imagem estável com:

coreos-installer download -p qemu -f qcow2.xz --decompress

Para fazer o tutorial mais simples, você deve renomear a imagem que acabamos de baixar para um nome mais curto:

mv fedora-coreos-39.20240225.3.0-qemu.x86_64.qcow2 fedora-coreos.qcow2

Agora você está pronto para prosseguir com o primeiro tutorial.

Instalando via pacotes do Fedora

All three tools (Butane, coreos-installer, and ignition-validate) are available as Fedora packages:

# Installing the tools
sudo dnf install -y butane coreos-installer ignition-validate

# Realizando o download da última imagem QCOW2 estável do Fedora CoreOS
coreos-installer download -p qemu -f qcow2.xz --decompress

Para fazer o tutorial mais simples, você deve renomear a imagem que acabamos de baixar para um nome mais curto:

mv fedora-coreos-39.20240225.3.0-qemu.x86_64.qcow2 fedora-coreos.qcow2

Agora você está pronto para prosseguir com o primeiro tutorial.

Download manual

If none of the previous solutions work for you, you can still manually download Fedora CoreOS from fedoraproject.org with:

RELEASE="39.20240225.3.0"
curl -O https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/$RELEASE/x86_64/fedora-coreos-$RELEASE-qemu.x86_64.qcow2.xz
curl -O https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/$RELEASE/x86_64/fedora-coreos-$RELEASE-qemu.x86_64.qcow2.xz.sig

Uma vez que o arquivo foi baixado, tenha certeza de verificar a integridade seguindo as instruções disponíveis clicando no botão Verify signature & SHA256. Você terá que baixar o arquivo checksum, a assinatura e as chaves GPG do Fedora para verificar seu download:

curl https://fedoraproject.org/fedora.gpg | gpg --import
gpg --verify fedora-coreos-$RELEASE-qemu.x86_64.qcow2.xz.sig

Uma vez que você verificou o arquivo, você pode extraí-lo com:

unxz fedora-coreos-$RELEASE-qemu.x86_64.qcow2.xz

Para fazer o tutorial mais simples, você deve renomear a imagem que acabamos de baixar para um nome mais curto:

mv fedora-coreos-39.20240225.3.0-qemu.x86_64.qcow2 fedora-coreos.qcow2

You should then download the latest Butane and ignition-validate releases from GitHub:

# Butane
curl -OL https://github.com/coreos/butane/releases/download/v0.20.0/butane-x86_64-unknown-linux-gnu
curl -OL https://github.com/coreos/butane/releases/download/v0.20.0/butane-x86_64-unknown-linux-gnu.asc
gpg --verify butane-x86_64-unknown-linux-gnu.asc
mv butane-x86_64-unknown-linux-gnu butane
chmod a+x butane

# ignition-validate
curl -OL https://github.com/coreos/ignition/releases/download/v2.18.0/ignition-validate-x86_64-linux
curl -OL https://github.com/coreos/ignition/releases/download/v2.18.0/ignition-validate-x86_64-linux.asc
gpg --verify ignition-validate-x86_64-linux.asc
mv ignition-validate-x86_64-linux ignition-validate
chmod a+x ignition-validate

You may then set up aliases for butane and ignition-validate:

alias butane="${PWD}/butane"
alias ignition-validate="${PWD}/ignition-validate"

Ou mover esses comandos para uma pasta no seu $PATH, por exemplo:

mv butane ignition-validate "${HOME}/.local/bin/"
# Or
mv butane ignition-validate "${HOME}/bin"

Agora você está pronto para prosseguir com o primeiro tutorial.