[TUTORIAL] Fedora CoreOS on Proxmox

Mace6401

New Member
Oct 13, 2024
1
1
1
I wanted to run Fedora CoreOS as VM on Proxmox VE but I couldn't find good resources on it. I somehow figured it out and decided to share my learnings.
Proxmox VE doesn't officially support Ignition which is what Fedora CoreOS uses to commission VMs. Here's the overview of the steps:
  1. Run an HTTP server in an LXC that will serve the Ignition file
  2. Run Live ISO image on Proxmox as VM and install CoreOS using the hosted Ignition file
1) Run an HTTP server in an LXC that will serve the Ignition file
Spin up your favorite LXC container. Install Apache server on it:
Bash:
##On Debian/Ubuntu
sudo apt update && sudo apt install apache2


##On CentOS/Rocky/Alma Linux
sudo yum install -y httpd

Change the listen port to 8080:
Bash:
##On Debian/Ubuntu
sudo sed -i 's/Listen 80/Listen 8080/' /etc/apache2/ports.conf


##On CentOS/Rocky/Alma Linux
sudo sed -i 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf
sudo setsebool -P httpd_read_user_content 1

Now start and enable the service:
Bash:
##On Debian/Ubuntu
sudo systemctl enable apache2
sudo systemctl restart apache2


##On CentOS/Rocky/Alma Linux
sudo systemctl enable httpd
sudo  systemctl restart httpd

Verify if the server is running:
curl localhost:8080

Create Ignition Config for Flatcar Container Linux:
vim coreos.bu

JSON:
variant: fcos
version: 1.5.0
passwd:
  users:
    - name: core
      groups: ["wheel", "sudo", "systemd-journal"]
      ssh_authorized_keys:
        - replace-me-with-public-ssh-key
      password_hash: your password has using 'openssl passwd -1 -salt your-salt'
      shell: /bin/bash
storage:
  files:
    - path: /etc/hostname
      mode: 0644
      overwrite: true
      contents:
        inline: "replace-me-with-your-hostname"
systemd:
  units:
    - name: "install-qemu-guest-agent.service"
      enabled: true
      contents: |
        [Unit]
        Description=Ensure qemu-guest-agent is installed
        Wants=network-online.target
        After=network-online.target
        Before=zincati.service
        ConditionPathExists=!/var/lib/%N.stamp


        [Service]
        Type=oneshot
        RemainAfterExit=yes
        ExecStart=rpm-ostree install --allow-inactive --assumeyes --reboot qemu-guest-agent
        ExecStart=/bin/touch /var/lib/%N.stamp


        [Install]
        WantedBy=multi-user.target

Create ignition file from butane config:
Bash:
dnf install -y butane
butane --pretty --strict coreos.bu > coreos.ign

Move this file to the Apache web root directory:
Bash:
mkdir /var/www/html/coreos
cp coreos.ign /var/www/html/coreos

Test if everything is okay:
curl localhost:8080/coreos/coreos.ign

2) Run Live ISO image on Proxmox as VM

Download the Live ISO image of Fedora CoreOS. Upload the ISO on your proxmox server, provision Storage, and memory according to your needs, and start the VM. Once the Live ISO is booted up do the following:

Find the drive to install Fedora CoreOS:
lsblk

Download the Ignition file:
curl -o coreos.ign http://<ip-address>:8080/coreos/coreos.ign

Install CoreOS:
coreos-installer install /dev/sda -i coreos.ign
Assuming /dev/sda is the drive you want to install CoreOS

Credits:
https://computingforgeeks.com/install-flatcar-container-linux-in-proxmox-ve/
https://0a6160f0.wirywolf-com.pages.dev/2022/12/coreos-template-on-proxmox-with-packer
https://blog.cloudbending.dev/posts/fedora-coreos-on-proxmox/
 
  • Like
Reactions: UdoB

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!