gyptazy

DevOps

Developer

IT Consultant

gyptazy

DevOps

Developer

IT Consultant

Blog Post

Run Linux Containers on FreeBSD 14 with Podman

Run Linux Containers on FreeBSD 14 with Podman

In one of my recent blog posts, I shared my journey as a long-time FreeBSD user. I talked about how I’ve been incredibly happy with the system, appreciating its rock-solid stability, flexibility, and performance. But, like every OS, FreeBSD had its gaps, especially when it came to some modern developments – one of which has been a pain point for many of us working with containerized environments: native support for Docker and Podman Linux images. Until recently, this missing functionality made working with containerized applications a bit of a challenge. Let me explain why that’s changed and how FreeBSD 14 has finally caught up to the container party.

The Old Way: bhyve Linux VMs

For a long time, one of the workarounds for running Linux containers on FreeBSD was to spin up a Linux VM using bhyve, FreeBSD’s native hypervisor. While bhyve is fantastic in its own right (fast, lightweight, and a core part of many FreeBSD setups), running an entire Linux VM just to execute a single container image felt like overkill. For many of us, the process was cumbersome, especially when working with teams that used Linux-based systems and containers regularly.

Let’s face it: when you’re collaborating with teammates who share container images with you, whether it’s for development, testing, or production use, you don’t want to jump through hoops just to get things running. The usual scenario went something like this:

  1. A teammate shares a Linux-based container image.
  2. You set up or spin up a bhyve VM with a Linux OS.
  3. Install Docker or Podman inside that VM.
  4. Finally, run the container inside the VM.

This workflow was anything but seamless. It worked, but it wasn’t efficient, and over time, it became clear that this was a barrier for FreeBSD to fully embrace modern containerization.

Enter FreeBSD 14 and Native Podman Support

Fast forward to today, and things have changed for the better. With the release of FreeBSD 14 and the latest Podman updates, we now have the ability to run Linux containers natively (more or less by using FreeBSD’s Linux emulation) – without having to rely on a full-fledged virtual machine. This is a huge leap forward, and honestly, it’s something that many of us in the FreeBSD community have been waiting for.

So, what exactly does this mean for us FreeBSD users?

1. Direct Linux Container Support

This is the headline feature. FreeBSD 14 introduces improved Linux container compatibility layers that allow us to directly execute Linux container images using Podman. In simpler terms, when your teammate shares a Docker or Podman image with you, you no longer have to spin up a VM. You can run it natively on FreeBSD as if you were on a Linux system.

This eliminates the unnecessary overhead and resource consumption associated with running full virtual machines. You get the lightweight, isolated environment that containers promise, but now with the added bonus of FreeBSD’s renowned efficiency and performance.

2. Simplified Workflows

The native container support on FreeBSD brings a major boost to our workflows. If you’ve ever felt left out of the container revolution because of the OS you love, now’s your chance to embrace it without compromises. Collaborating with teams becomes smoother because you no longer need to worry about additional layers of complexity just to run the same container images.

Personally, I’ve found that this update has improved my day-to-day development work. Sharing container images with colleagues or deploying them for testing is now a much faster, cleaner process. It’s almost surreal to think how much of a game-changer this is for FreeBSD users who have had to contend with workaround-heavy solutions for too long.

How-To Install

Installing Podman is pretty straightforward and can be simply installed by the FreeBSD’s native package manager. However, running Linux Containers requires some additional changes to the system to ensure that the underlying storage and networking will work.

Warning: This steps will configure everything on a freshly installed FreeBSD installation. Take care to not overwrite your maybe already existing configurations!

pkg install podman
mount -t fdescfs fdesc /dev/fd
echo 'fdesc   /dev/fd         fdescfs         rw      0       0' >> /etc/fstab
echo 'pf_load="YES"' >> /boot/loader.conf
echo 'net.pf.filter_local=1' >> /etc/sysctl.conf.local
zfs create -o mountpoint=/var/db/containers zroot/containers
cp /usr/local/etc/containers/pf.conf.sample /etc/pf.conf
kldload pf
sysctl net.pf.filter_local=1
service podman enable
service pf enable
service linux enable
service pf start
service podman start
service linux start

Afterwards, you’re already ready to go and to use Linux Containers on your FreeBSD based system.

Example

Running Linux Containers on FreeBSD works now the same like you’re already doing it on Linux with Podman.

cat /etc/os-release && echo -e "\n\n\n\n" && \
podman run --rm --platform linux/arm64 \
docker.io/arm64v8/debian NAME=FreeBSD \
cat /etc/os-release

Looking Ahead

FreeBSD 14 marks a turning point for the platform. This new container capability puts FreeBSD squarely back in the conversation for anyone looking at an OS that combines the best of both worlds: traditional Unix-like reliability with modern containerization support. It also opens up new doors for FreeBSD to be used in environments where Linux-based container solutions have long dominated.

While FreeBSD will likely never be a drop-in replacement for Linux in every use case, it doesn’t need to be. What matters is that FreeBSD users now have the tools and support to work seamlessly in mixed environments. You get the stability and unique features of FreeBSD without missing out on the flexibility of modern containerized workloads.

But take care! There’s unfortunately also a huge disadvantage. Mostly you tend to use Podman over Docker for the rootless mode which is here not possible and requires you to run it under root permissions.

If you’ve been holding out on FreeBSD for container support, now is the time to revisit it. FreeBSD 14 and Podman have brought us into the modern age of containers, and I, for one, couldn’t be more excited to see where this leads.

Final Thoughts

Being a FreeBSD user has always felt like being part of a smaller, passionate community that values stability, performance, and control. But in today’s world, where containers are the norm for so many workflows, missing out on native support was a real disadvantage. I’m thrilled to see that the gap has been closed with FreeBSD 14 and Podman, making FreeBSD a more viable option for developers, sysadmins, and anyone who relies on containers.

For those of you out there who, like me, have been sticking with FreeBSD but yearning for better container support – this is the moment we’ve been waiting for. It’s time to dive in and explore all the new possibilities FreeBSD 14 brings to the table.

Taggs: