Oracle Database Enterprise Container on MAC AARCH64

For Mac M3 users running x86_64 containers on ARM-based devices, the workaround involves using Podman 4.2.1 and QEMU 6.2.0_1. Key steps include installing Homebrew, Rosetta 2, Podman, and QEMU, then configuring Podman for x86_64 images. Finally, start the Podman machine and set it as default.

Running x64 containers on Podman on AARCH64 (M3) Macs

For Mac M3 users, facing difficulty with x86_64 images on ARM-based Mac M1 devices, the suggested workaround involves utilizing Podman along with an older version of the emulator (QEMU), specifically recommending the use of Podman 4.2.1 in conjunction with QEMU 6.2.0_1 to address this compatibility issue effectively.

Prerequisites

1. Homebrew Installation:

Ensure you have Homebrew installed on your system. If not, you can install it using the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2. Rosetta 2 Installation:

Install Rosetta 2, which allows Apple Silicon Macs to run x86_64 code. You can do this via Terminal:

softwareupdate --install-rosetta

Step-by-Step Guide

Install Podman

Install podman 4.2.1 ( tested and working ) from below link

https://github.com/containers/podman/releases/download/v4.2.1/podman-installer-macos-aarch64.pkg

Download QEMU 6.2

curl -L -H "Authorization: Bearer QQ==" -o qemu-6.2.0_1.monterey.bottle.tar.gz https://ghcr.io/v2/homebrew/core/qemu/blobs/sha256:fcc3b1a8139f70dae57f5449f3856f9b3b67448ee0623e64da1e47dc255b46f6

Install brew switch

brew tap laggardkernel/tap

Disconnect the currently install qemu

brew unlink qemu

Install qemu 6.2.0_1 from the downloaded file

brew install -f qemu-6.2.0_1.monterey.bottle.tar.gz

Create a podman machine using the x86_64 image of Fedora CoreOS

podman machine init --cpus=4 -m=12288 --image-path=https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/36.20220806.3.0/x86_64/fedora-coreos-36.20220806.3.0-qemu.x86_64.qcow2.xz x86

With this default machine installation we have podman machine based on X86_64

Note: Don’t start the machine

Configure x86 to use QEMU x86_64

Now we have to adjust the machine JSON file because podman is set up for the aarch64 image, not the x86_64 image. By making these modifications, podman will operate as if it is on an x86_64 image.

Navigate to ~/.config/containers/podman/machine/qemu. We need to open the file called x86.json  in an editor to change the QEMU command line options. Before making any changes it is recommended to backup this file.

Change the qemu line near the top, this makes podman launch the correct QEMU for our image. (If applicable)

/opt/homebrew/bin/qemu-system-aarch64 to /opt/homebrew/bin/qemu-system-x86_64

This is my json file cmdline section looks like, modify your file accordingly , don’t copy paste, use it for reference

 "CmdLine": [
  "/opt/homebrew/bin/qemu-system-x86_64",
  "-m",
  "12288",
  "-smp",
  "4",
  "-fw_cfg",
  "name=opt/com.coreos/config,file=/Users/vigneshasathiyanantham/.config/containers/podman/machine/qemu/x86.ign",
  "-qmp",
  "unix:/var/folders/bj/5zzrj9ns63qbrskfyp95q2140000gn/T/podman/qmp_x86.sock,server=on,wait=off",
  "-netdev",
  "socket,id=vlan,fd=3",
  "-device",
  "virtio-net-pci,netdev=vlan,mac=5a:94:ef:e4:0c:ee",
  "-device",
  "virtio-serial",
  "-chardev",
  "socket,path=/var/folders/bj/5zzrj9ns63qbrskfyp95q2140000gn/T/podman/x86_ready.sock,server=on,wait=off,id=ax86_ready",
  "-device",
  "virtserialport,chardev=ax86_ready,name=org.fedoraproject.port.0",
  "-pidfile",
  "/var/folders/bj/5zzrj9ns63qbrskfyp95q2140000gn/T/podman/x86_vm.pid",
  "-drive",
  "file=/opt/homebrew/Cellar/qemu/6.2.0_1/share/qemu/edk2-x86_64-code.fd,if=pflash,format=raw,readonly=on",
  "-virtfs",
  "local,path=/users,mount_tag=vol0,security_model=none",
  "-virtfs",
  "local,path=/private,mount_tag=vol1,security_model=none",
  "-virtfs",
  "local,path=/var/folders,mount_tag=vol2,security_model=none",
  "-drive",
  "if=virtio,file=/Users/vigneshasathiyanantham/.local/share/containers/podman/machine/qemu/fedora-coreos-36.20220806.3.0-qemu.x86_64.qcow2.xz"
 ]

Launch Podman

Now podman machine is ready to run x86_64 arch of images

Start Machine

podman machine start x86

Set the x86 to default

podman system connection default x86

Next, retrieve the database image from the Oracle Container Registry and proceed to launch the container.

If you want to run with LIMA, refer my post: Setting Up Podman with Lima on Mac M3

Reference and Credits : https://community.ibm.com/community/user/integration/blogs/piers-walter/2022/07/28/running-x86-64-containers-such-as-mq-on-podman-on

Leave a Reply

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

Discover more from

Subscribe now to keep reading and get access to the full archive.

Continue reading