cloudfoundry / cloudfoundry/bosh-linux-stemcell-builder
Resolute Raccoon Stemcell does not work on a mac under rosetta
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 50
- Forks
- 121
- Avg merge
- 13h 32m
- Merged PRs (30d)
- 29
Description
Resolute stemcells currently under development don't work under vz/rosetta. Documenting why in this issue in case the details ever change.
An arm warden stemcell might be nice in the future, though largely only useful for bosh development as it would be incompatible with many releases.
AI Summary of the Issue
Attempting to run or test an x86_64 Ubuntu Resolute BOSH stemcell under a Rosetta 2-backed Linux VM results in fatal ENOSYS (Function not implemented) errors during standard process supervision and container execution.
This prevents monit from properly restarting and blocks the BOSH Process Manager (BPM) from starting jobs.
Root Cause Analysis
The failure stems from a fatal intersection between Apple's Rosetta 2 system call translation and the aggressive deprecation of legacy cgroup code in modern systemd.
- Systemd v256 Strict Syscall Requirements: Ubuntu 26.04 ships with systemd v256+. Starting with this release, the systemd maintainers removed legacy fallback mechanisms for managing cgroups (such as reading
cgroup.procsand iterating standardkill()syscalls). Systemd now strictly mandates the use of modern process file descriptor syscalls—specificallypidfd_openandpidfd_send_signal—to eliminate PID recycling race conditions. - The Rosetta 2 Emulation Gap: Apple's Rosetta 2 acts as a translation layer between the
x86_64container userland and thearm64Linux kernel running in thevzVM. Rosetta 2 must explicitly map and translate system calls between the two architectures. It currently does not implement translations for thepidfdsyscall family. - The
ENOSYSWall: Whensystemdorruncfires apidfdsyscall, Rosetta 2 intercepts it, doesn't know how to translate it to the ARM kernel, and instantly returns-1 ENOSYS(Function not implemented). Because systemd v256+ no longer has a fallback loop for this failure, it bubbles the error up and aborts the operation.
Observed Symptoms
This missing syscall mapping manifests in two primary ways during stemcell/BOSH operations:
1. systemctl kill Failures
When scripts attempt to kill/restart services, systemctl kill relies on pidfd_send_signal to terminate the cgroup. It fails with:
Failed to kill unit monit.service: Failed to send signal SIGTERM to processes in unit cgroup '/system.slice/monit.service': Function not implemented
2. BPM / runc Failures
When BPM attempts to start a job, runc asks systemd to create a transient .scope unit and passes an array of PIDs. Systemd attempts to secure those PIDs using pidfd_open. It fails with:
level=error msg="runc run failed: unable to start container process: unable to apply cgroup configuration: unable to start unit \"runc-bpm-hello-world.scope\" (...): Failed to set unit properties: Function not implemented"
Conclusion & Workarounds
This is a fundamental architectural limitation of using Rosetta 2 to emulate modern x86_64 Linux userlands. Older Ubuntu versions (like 24.04 Noble) work on Rosetta solely because their older systemd versions (v255) retain dirty fallbacks to mask the emulator's missing syscalls.
Workarounds:
- Run integration tests and stemcell builds on native
x86_64hardware. - If testing on Apple Silicon is strictly required, switch the virtualization engine to use full QEMU CPU emulation instead of Rosetta 2 (e.g.,
colima start --arch x86_64 --vm-type qemu), which provides a 100% completex86_64kernel API at the cost of significant performance degradation.
Note: Opened for tracking and documentation purposes regarding Resolute stemcell development environments.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the documented systemctl kill and BPM/runc failures in the Resolute x86_64 stemcell under vz/Rosetta, then compare with Ubuntu 24.04 Noble. Check whether the reported ENOSYS behavior and the listed native x86_64/QEMU workarounds still hold; done means the tracking documentation is confirmed or updated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ubuntu
- Domain
- build-system, operating-systems
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100