Skip to content

Instantly share code, notes, and snippets.

@willnode
Last active August 15, 2025 06:47
Show Gist options
  • Save willnode/88da35d0c0542276b4631746d8fc3de1 to your computer and use it in GitHub Desktop.
Save willnode/88da35d0c0542276b4631746d8fc3de1 to your computer and use it in GitHub Desktop.
Build Redox OS in MacOS Apple Silicon

This is a way to compile Redox OS in MacOS Apple Silicon using Podman.

This gist follows the book but specifics to MacOS Apple Silicon for easy and fastest installation. For native bootstrap follow another gist (WIP)

Clone

cd ~/Document
git clone https://gitlab.redox-os.org/redox-os/redox
cd redox
git submodule update --init --recursive
./podman_bootstrap.sh -d

Setup .config

Set arch target. Write this to ./.config:

PODMAN_BUILD?=1
ARCH=x86_64
CONFIG_NAME=desktop
PREFIX_BINARY=1
REPO_BINARY=1

The PREFIX_BINARY and REPO_BINARY will make the build speed so much quick.

Switch to my branch

An open MR is requested for additional changes required to get rid of installing fuse (which is a horribly insecure thing to do in Mac Silicon). You can switch to this branch:

git remote set-url origin https://gitlab.redox-os.org/willnode/redox
git checkout patch-make-macos

Switch to my aarch64 tooling

Currently, the official toolchain only support amd64 podman. The official arm64 toolchain is unavailable, so I build it myself. Please patch mk/prefix.mk:

-	wget -O [email protected] "https://static.redox-os.org/toolchain/$(TARGET)/relibc-install.tar.gz"
+	wget -O [email protected] "https://redox-build.wellosoft.net/toolchain/$(TARGET)/relibc-install.tar.gz"

And mk/config.mk:

-ifneq ($(HOST_TARGET),x86_64-unknown-linux-gnu)
-    $(info The binary prefix is only built for x86_64 Linux hosts)
+ifneq ($(HOST_TARGET),aarch64-unknown-linux-gnu)
+    $(info The binary prefix is only built for aarch64 Linux hosts)

Without this, you'll end up building toolchain inside Podman, which likely will not work (need a huge memory/cpu for it and it take hours).

Running the build

  1. make build/container.tag create the container
  2. make rebuild build/rebuild the image disk
  3. make qemu open QEMU to boot the disk

Limitations of Redox for MacOS

This comments reflects to the state of running and building Redox using MacOS as of August 2025:

aarch64 Variant

The aarch64 target only usable with make qemu disk=usb and live disk (live disk is the default for aarch64 but try not to change the live disk mode when booting).

The exact reason for disk driver is not working is because of lack MSI-X implementation. My naive implementation for that is still WIP.

HVF Acceleration

The -accel hvf flag is currently making Synchronous exception because of (incorrect?) Generic Timer Initialization, which is an essential driver for desktop usage. if you insist to use HVF for server usage, try patch the kernel.

Netsurf Build Problem

Previously I told you to use REPO_BINARY=1. You can try set it to 0, but you'll hit a strange permission error when building netsuf. This is the problem with podman itself, not Redox build system.

To work around it while using REPO_BINARY=0, change the netsurf config in config/desktop.toml to:

netsurf = "binary"

Podman Clock Skew

You'll have a strage warning about clock skew by make and repeated make rebuild invocation. Just bear with it, it's podman fault.

You can set REPO_OFFLINE=1 to speed up rebuild to alleviate the pain caused by this.

Tracking Issue in Redox Project

Also see this tracking issue https://gitlab.redox-os.org/redox-os/redox/-/issues/1604

@Xunjin
Copy link

Xunjin commented Nov 22, 2024

Should this excerpt:

sh ./native_bootstrap.sh -d -e qemu
brew install coreutils

As right now, only native_bootstrap.sh and podman_bootstrap.sh are available

@thynus
Copy link

thynus commented Feb 16, 2025

I am going to try this out on an m3 macbook air. Thank you for putting this together! I am going to replace all the brew statements with port and see what happens.

= = = = = = =
sudo port install coreutils

bootstrap.sh not available using
native_bootstrap.sh

sh ./native_bootstrap.sh -d -e qemu

---> Configuring osxfuse
---> Building osxfuse
Error: Failed to build osxfuse: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_fuse_osxfuse/osxfuse/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port osxfuse failed

= = = = = = =

Any ideas on how to get past this point? osxfuse is version 3.8.3 but I would need version 4.8.3 (macOS 14.7) which requires security changes in my recovery environment.

@thynus
Copy link

thynus commented Feb 19, 2025

= = = = = = =
switching to ARM Ubuntu:

relibc does not compile; known problem with ARM hosts.

= = = = = = =

@willnode
Copy link
Author

Hello guys, I actually no longer recommends this approach. Please try running virtualized ubuntu if you can. I might will update this approach if i got some time.

@willnode
Copy link
Author

Updated

@willnode
Copy link
Author

Updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment