Skip to content

Instantly share code, notes, and snippets.

@cblecker
Created September 27, 2025 00:07
Show Gist options
  • Select an option

  • Save cblecker/c0da41016b3ebdaf8e6e5e2626ae43f0 to your computer and use it in GitHub Desktop.

Select an option

Save cblecker/c0da41016b3ebdaf8e6e5e2626ae43f0 to your computer and use it in GitHub Desktop.
Ansible

Podman Machine Rosetta Configuration Playbook

This Ansible playbook automates the configuration of Rosetta support for Podman machines on macOS Tahoe systems.

What it does

The playbook performs the following tasks:

  1. Checks for existing Rosetta support - Verifies if the /proc/sys/fs/binfmt_misc/rosetta file exists
  2. Enables Rosetta if needed - Creates the /etc/containers/enable-rosetta file when Rosetta binfmt support is not present
  3. Reboots the machine - Automatically reboots the Podman machine after enabling Rosetta to ensure the configuration takes effect

Why it's needed

Starting with Podman 5.6, Rosetta is disabled by default due to compatibility issues between Rosetta and Linux kernels 6.13 and above. This affects performance when running x86_64 containers on Apple Silicon Macs, as the system falls back to QEMU for architecture translation instead of the more efficient Rosetta.

However, Apple has addressed these compatibility issues in macOS Tahoe. This playbook automates the manual process of re-enabling Rosetta functionality for users running this version.

Prerequisites

  • macOS Tahoe installed
  • Podman 5.6 with the "applehv" provider

Usage

Run the playbook with:

podman machine init --playbook rosetta-enabled.yml

Source

This playbook is based on the manual steps outlined in the Podman 5.6 Released: Rosetta Status Update blog post.

Verification

After running the playbook and the machine reboots, you can verify that Rosetta is enabled by running:

podman machine ssh "cat /proc/sys/fs/binfmt_misc/rosetta"

If Rosetta is properly enabled, this command should return enabled.

Thanks

Thanks to Brent Baude (Podman Architect, Red Hat) for the detailed explanation and manual steps that this playbook automates.

---
# Ansible playbook to check and configure Rosetta binfmt support for Podman machines
# Based on commands from: https://blog.podman.io/2025/08/podman-5-6-released-rosetta-status-update/
- name: Check and configure rosetta binfmt support
hosts: localhost
become: true
tasks:
- name: Check if rosetta binfmt file exists
stat:
path: /proc/sys/fs/binfmt_misc/rosetta
register: rosetta_file
- name: Touch enable-rosetta file if rosetta binfmt doesn't exist
file:
path: /etc/containers/enable-rosetta
state: touch
when: not rosetta_file.stat.exists
register: rosetta_touched
- name: Reboot VM if enable-rosetta file was created
command: systemctl reboot
when: rosetta_touched is changed
async: 1
poll: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment