Add DYLD environment variables entitlement for macOS#21
Merged
Conversation
macOS strips DYLD_LIBRARY_PATH from hardened runtime processes.
The runner binary requires the hypervisor entitlement, which
enables hardened runtime, causing macOS to silently strip
DYLD_LIBRARY_PATH before the process starts. This prevents
libkrun from finding libkrunfw.dylib when it lives in a
separate firmware directory.
Add `com.apple.security.cs.allow-dyld-environment-variables` to
the runner entitlements so DYLD_LIBRARY_PATH passes through.
Verify with:
task build-dev-darwin
codesign -d --entitlements - bin/propolis-runner
Expected output includes:
```
[Key] com.apple.security.cs.allow-dyld-environment-variables
[Value]
[Bool] true
```
I was able to boot an image with this patch:
```
DYLD_LIBRARY_PATH=/opt/homebrew/lib bin/propolis-runner "$(cat /tmp/propolis-test.json)"
[2026-03-05T11:04:22Z DEBUG vmm::macos::vstate] Guest memory
host_addr=0x300000000 guest_addr=80000000 len=80000000
[2026-03-05T11:04:22Z DEBUG vmm::macos::vstate] Guest memory
host_addr=0x380000000 guest_addr=140000000 len=20000000
[2026-03-05T11:04:22Z DEBUG utils::macos::epoll] EpollEvent new: 4
[2026-03-05T11:04:22Z DEBUG utils::macos::epoll] EpollEvent data: 4
[2026-03-05T11:04:22Z DEBUG utils::macos::epoll] add fd in: 4
[2026-03-05T11:04:22Z DEBUG devices::legacy::aarch64::gpio]
SET_IRQ_LINE (GPIO)=33
```
JAORMX
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
macOS strips DYLD_LIBRARY_PATH from hardened runtime processes.
The runner binary requires the hypervisor entitlement, which
enables hardened runtime, causing macOS to silently strip
DYLD_LIBRARY_PATH before the process starts. This prevents
libkrun from finding libkrunfw.dylib when it lives in a
separate firmware directory.
Add
com.apple.security.cs.allow-dyld-environment-variablestothe runner entitlements so DYLD_LIBRARY_PATH passes through.
Verify with:
task build-dev-darwin
codesign -d --entitlements - bin/propolis-runner
Expected output includes:
I was able to boot an image with this patch: