|
Enabling autologin and setting a custom hostname
|
|
|
Make sure that you have completed the steps described in the xref:tutorial-setup.adoc[initial setup page] before starting this tutorial.
|
|
|
Provisioning Fedora CoreOS
|
|
|
Fedora CoreOS does not have a separate install disk. Instead, every instance starts from a generic disk image which is customized on first boot via https://github.com/coreos/ignition[Ignition].
|
|
|
Set the system hostname by dropping a file at `/etc/hostname`,
|
|
|
Raise kernel console logging level to hide audit messages from the console.
|
|
|
Booting Fedora CoreOS
|
|
|
Now that we have an Ignition config, we can boot a virtual machine with it. This tutorial uses the QEMU image with `libvirt`, but you should be able to use the same Ignition config on all the platforms supported by Fedora CoreOS.
|
|
|
We use the `backing_store` option to `virt-install --disk` to quickly create a new disk image and avoid writing to the original image we have downloaded. This new disk image can be easily thrown away.
|
|
|
Once the machine is booted up you should see a few prompts and then you should be automatically logged in and presented with a bash shell:
|
|
|
[ OK ] Started rpm-ostree System Management Daemon.
|
|
|
Fedora CoreOS 32.20200715.3.0 Kernel 5.7.8-200.fc32.x86_64 on an x86_64 (ttyS0)
|
|
|
SSH host key: SHA256:XlbayjbgDKNoAAHQxsEL5Q7BdwLxxWSw4NXN9SALLmo (ED25519) SSH host key: SHA256:3sx5jseteO4BvdOMWIi0J4koQL015mLonnD0UPTtnZk (ECDSA) SSH host key: SHA256:K0fn5/TMJOoMs7Fu7RRkE7IBEf2t8OYCfVaVc+GJWGs (RSA) ens2: 192.168.122.127 fe80::5054:ff:feb9:3d97 Ignition: user provided config was applied No ssh authorized keys provided by Ignition or Afterburn tutorial login: core (automatic login)
|
|
|
[core@tutorial ~]$
|
|
|
Let's verify that our configuration has been correctly applied. As we were automatically logged in to the terminal, we can safely assume that the systemd dropin has been created:
|
|
|
[core@tutorial ~]$ systemctl cat serial-getty@ttyS0.service # /usr/lib/systemd/system/serial-getty@.service ...
|
|
|
# /etc/systemd/system/serial-getty@ttyS0.service.d/autologin-core.conf [Service] # Override Execstart in main unit ExecStart= # Add new Execstart with `-` prefix to ignore failure` ExecStart=-/usr/sbin/agetty --autologin core --noclear %I $TERM
|
|
|
We can also check that the hostname has correctly been set:
|
|
|
[core@tutorial ~]$ cat /etc/hostname tutorial [core@tutorial ~]$ hostnamectl Static hostname: tutorial Icon name: computer-vm Chassis: vm Machine ID: d06466128a1c4a6ab255d9581748755c Boot ID: 2a19abb9681e442cb1e10271350bfff3 Virtualization: kvm Operating System: Fedora CoreOS 32.20200715.3.0 CPE OS Name: cpe:/o:fedoraproject:fedora:32 Kernel: Linux 5.7.8-200.fc32.x86_64 Architecture: x86-64
|
|
|
Exploring Fedora CoreOS internals
|
|