Proxmox

Proxmox Containers with Fedora CoreOS Install

Learn how to install Fedora CoreOS in Proxmox to create a powerful Proxmox containers environment for running Docker and Kubernetes

I recently looked at the installation of Fedora CoreOS on VMware. In the home lab, many are running Proxmox and maybe more coming up will be switching from VMware over the course of 2024. Let’s take a look at the topic of running Proxmox Containers with Fedora CoreOS setup.

Proxmox and Fedora CoreOS

Combining an excellent hypervisor for virtualization and an operating system platform that is purpose-built for containerization and Kubernetes, is a great combination. We can do this by running Fedora CoreOS distribution on top of Proxmox VE with KVM for the purpose of running containers.

Fedora CoreOS

While you can run LXC container (Linux containers) configurations and container template machines inside of Proxmox natively, many developers and DevOps guys need access to Docker containers. In the home lab, most solutions you want to self-host are readily available as Docker containers also without running full virtual machine instances with full operating systems. So, running Docker is a great way to have access to these solutions.

Fedora CoreOS has as its focus, containerized infrastructure. If you look at the documentation, It offers an automatically updating, minimal, container-centric operating system that natively runs Docker, Podman, and can run Kubernetes as well also, with good support across the board. It is also immutable which means it has security enhancements for customers running it for their container cluster.

So if you are looking for a clean, secure, and immutable OS to run your containers on top of Proxmox, CoreOS is a great solution!

Proxmox

Running it on top of Proxmox has other benefits such as the ability to run Proxmox Backup Server solution to backup the host virtual machines. It has powerful networking and monitoring. Businesses can even choose to have enterprise support and home labbers can become a member of the Proxmox support forum (for search forums threads, requests, and share things with others in the home forums such as issues and troubleshooting) and access to other Proxmox solutions, like Proxmox Mail Gateway.

Fedora CoreOS install on Proxmox

Let’s look at the Fedora CoreOS installation on Proxmox VE and see what steps are involved. There is actually a really great community project that will allow getting up and running with Fedora CoreOS on Proxmox. We will take a look at this below. In addition, Fedora CoreOS can be installed on bare metal using a live ISO installation as well as OVA appliance for VMware. 

Note the steps we will cover:

  1. Clone the community repo
  2. Enable snippets on a Proxmox VE storage repository
  3. Run the included shell script
  4. Configure cloud-init options for the created template
  5. Clone the template VM to a new Fedora CoreOS virtual machine

1. Clone the community repo

Before creating containers with Fedora CoreOS, ensure your Proxmox VE setup is ready. This involves checking available disk space, configuring network settings, and making sure your Promox host is up-to-date. If you can navigate to the Proxmox web interface to manage containers (view Proxmox container toolkit settings) and virtual machines you should be good to go.

We need to clone the repository that contains the community script for deploying the Fedora CoreOS installation. You can clone the following repository:

I did this directly from my Proxmox VE host. Just install the git tools if you haven’t already: apt install git -y

You will see the fedora-coreos-proxmox folder. If you cd inside the folder, you will see a vmsetup.sh wrapper script that is the script we will run on the Proxmox VE server. The fedora-coreos-<version>.yaml serves as the ignition file for CoreOS. The Ignition file configures all the required settings.. 

Cloning the repo down from the community to install fedora coreos in proxmox
Cloning the repo down from the community to install fedora coreos in proxmox

2. Enable snippets on a Proxmox VE storage repository

Next, following the instructions on the GitHub repo, we need to enable snippets on a local storage repository. It defaults to the local default storage in Proxmox. However, you can edit the vmsetup.sh script to point to a different storage location for both the snippet storage and template storage which is also needed.

You will see the lines I have changed below in the top part of the script. I have changed the TEMPLATE_VMSTORAGE and SNIPPET_STORAGE to the locations I wanted. Also, the vmsetup.sh script was quite a bit behind on the Fedora CoreOS version it was looking to deploy. So, I updated that to the latest at the time of writing in the file below.

Changing the template and snippet storage in the shell script
Changing the template and snippet storage in the shell script

Make a connection in a browser to the URL of your Proxmox web UIIf you want to go with the default local location, or any other location, navigate to Datacenter > Storage > “your storage” in the menu navigation, then click EDIT.

Add Snippets to the Content dropdown. Then click OK. You can also create a new folder and enable it with the snippets content type if you want something specific set aside for this use case. Just create a new folder, enter a description if you like, and make changes to the vmsetup.sh file.

Enabling snippets on the local storage repository
Enabling snippets on the local storage repository

3. Run the included shell script

Now that we have the snippets enabled on the storage of our choice, we can run the vmsetup.sh script included in the cloned repo.

It will automatically download the Fedora CoreOS image in the QEMU QCOW format needed. The Fedora CoreOS container templates in Proxmox streamline the deployment process. The Fedora CoreOS template allows for new container creations and uses the configuration files for settings specific to Fedora CoreOS to ensure smooth operation within the Proxmox environment.

Running the vmsetup.sh script
Running the vmsetup.sh script

The process should complete with the message at the bottom: Convert VM 900 in proxmox vm template

The vm is converted to a template
The vm is converted to a template

If you hop over to the Proxmox web interface, you will see the new virtual machine template.

The new template vm
The new template vm

4. Configure the cloud-init settings for the created template

Click the VM and then look at the Cloud-Init settings. Here you will find settings you can customize for:

  • User
  • Password (passwd)
  • DNS domain
  • DNS servers
  • SSH public key
  • Upgrade packages
  • IP Config (defaults to the default Linux bridge)
Configuring cloud init parameters for proxmox fedora coreos install
Configuring cloud init parameters for proxmox fedora coreos install

Below, I have configured custom settings for Cloud-Init.

Entering custom cloud init parameters for fedora coreos in proxmox
Entering custom cloud init parameters for fedora coreos in proxmox

5. Clone the template VM to a new Fedora CoreOS virtual machine

Now that we have the Cloud-Init settings configured, we can clone a new virtual machine from the new template.

Cloning a new VM called pmcos01 from the newly created template.

Cloning a new virtual machine for coreos installation
Cloning a new virtual machine for coreos installation

The clone task completes successfully. As you can see, the process to spin up quick Dev workloads for app development, websites, working with source, etc, is easy.

The cloning task is successful for cloning a new proxmox fedora coreos installation
The cloning task is successful for cloning a new proxmox fedora coreos installation

Now, we boot the new virtual machine and it boots. We can see the OS loading the config from the Ignition file.

Booting the new fedora coreos installation in proxmox
Booting the new fedora coreos installation in proxmox

After the machine fully boots and grabs an IP address, I log into the VM on the console, and I used the linuxadmin user I had specified in the cloud-init settings.

Success! I can login with the new linuxadmin user, showing the VM has used our cloud-init settings.

Logging into the fedora coreos virtual machine
Logging into the fedora coreos virtual machine

The Fedora CoreOS installation already has Docker preinstalled, so we can create containers, including system containers and application containers immediately after cloning over new VMs. Now all we need to do is start spinning up our containers.

Fedora coreos comes out of the box ready to run docker containers
Fedora coreos comes out of the box ready to run docker containers

Wrapping up Proxmox containers Fedora CoreOS install

There are many advantages of using Fedora CoreOS with Proxmox for managing containers and virtual machines. Proxmox is gaining popularity in the home lab and even the business realm. Especially with the recent Broadcom shakeup with the VMware product portfolio, I think many others will be switching over to Proxmox and other options if they are currently running VMware. Fedora CoreOS provides the resources needed to go all in on an operating system set for container mode, giving dev and DevOps users what they need for development and a platform for running containers across the board. You don’t have to have a subscription for either and you can freely use many of the forum, wiki, and support thread resources out there. Let me know in the comments what you think about Fedora CoreOS and also be sure to sign up for the forums.

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

3 Comments

  1. Why make this so complicated?

    Download the CoreOS qemu image to ProxMox.
    Create a VM with no OS.
    Attach the qemu image to the VM as a disk and change the boot order so it is first.
    Create your butane -> ignition file and upload it to the server.
    5 Attach the ignition file using qemu’s fw_cfg device: pvesh create /nodes/pve/qemu/104/config/ –args “-fw_cfg name=opt/com.coreos/config,file=/var/lib/vz/snippets/example.ign”
    Start the VM.

  2. Regrets, but after having read this code, you have got to be kidding me as for this approach.

    To say that downloading some untrusted script from some random cartoon avatar face from Australia and running it as root on one’s Proxmox host is not a cybersecurity best practice would be an understatement.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.