Provisioning Fedora CoreOS on libvirt

This guide shows how to provision new Fedora CoreOS (FCOS) instances on a libvirt platform, using the QEMU hypervisor.


Before provisioning a FCOS instance, you must have an Ignition configuration file containing your customizations. If you do not have one, see Producing an Ignition File.

You also need to have access to an host machine with libvirt. The examples below use the virt-install command-line tool, which must be separately installed beforehand.

If running on a host with SELinux enabled (use the sestatus command to check SELinux status), make sure your OS image and Ignition file are labeled as svirt_home_t. You can do this by placing them under ~/.local/share/libvirt/images/ or running chcon -t svirt_home_t /path/to/file.

Launching a VM instance

  1. Fetch the latest image suitable for the qemu platform (or download and verify it from the web).

    coreos-installer download -s "${STREAM}" -p qemu -f qcow2.xz --decompress -C ~/.local/share/libvirt/images/
  2. Launch a new machine via virt-install, using the Ignition file with your customizations.

    virt-install --connect qemu:///system -n "${VM_NAME}" -r "${RAM_MB}" --os-variant=fedora32 \
            --import --graphics=none --disk "size=${DISK_GB},backing_store=${IMAGE}" \
            --qemu-commandline="-fw_cfg name=opt/com.coreos/config,file=${IGNITION_CONFIG}"
virt-install requires both the OS image and Ignition file to be specified as absolute paths.
Depending on your version of virt-install, you may not be able to use --os-variant=fedora32 and will get an error. In this case, you should pick an older Fedora variant (--os-variant=fedora31 or --os-variant=fedora30 for example). You can find the variants that are supported by you current version of virt-install with osinfo-query os | grep "fedora[2-3][0-9]".
Make sure that your user has access to /dev/kvm. On most modern distribution, this means adding yourself to the kvm group.