Summary
On Apple Silicon macOS, BepInExPack_Valheim can launch Valheim successfully while BepInEx/Doorstop is never injected. The game reaches the menu and can join a server, but no BepInEx/LogOutput.log is created and no plugins load.
This appears to happen because the macOS start script needs to run Valheim's x86_64 slice through Rosetta, but the DYLD_INSERT_LIBRARIES environment used by Doorstop is not present at the final Valheim process when the architecture switch happens.
I found the related draft PR #20 for broader Valheim Apple Silicon support. This issue is narrower: a current-user failure mode in the packaged Valheim start script and a small workaround that restores Doorstop injection.
Environment
- Game: Valheim
0.221.12 (network version 36)
- BepInEx distribution:
BepInExPack_Valheim 5.4.2333 from Thunderstore
- OS: macOS
26.3.1 (25D2128)
- Hardware: Apple M4,
arm64
- Install path: external Steam library under
/Volumes/FitKid/SteamLibrary/steamapps/common/Valheim
- Launch method: Steam launch options running
start_game_bepinex.sh
Reproduction
- Install Valheim from Steam on Apple Silicon macOS.
- Install
BepInExPack_Valheim 5.4.2333.
- Configure Steam launch options to run
start_game_bepinex.sh.
- Launch Valheim from Steam.
Expected behavior
BepInEx preloader and chainloader start, BepInEx/LogOutput.log is created, and plugins under BepInEx/plugins are loaded.
Actual behavior
Valheim starts normally, but BepInEx does not load:
BepInEx/LogOutput.log is not created.
- No plugin load messages appear.
- Valheim's player log shows the game running as unmodded, for example:
The game itself continues to run, so the failure is easy to miss unless the BepInEx log is checked.
Local diagnosis
The packaged macOS start script switches to Rosetta/x86_64 for Valheim. In the failing case, Valheim launches, but Doorstop is not injected.
When I set DYLD_LIBRARY_PATH and DYLD_INSERT_LIBRARIES inside an x86_64 shell immediately before exec-ing the Valheim executable, BepInEx loads correctly.
Successful log after the workaround:
[Message: BepInEx] BepInEx 5.4.23.3 - Valheim
[Message: BepInEx] User is running BepInExPack Valheim version 5.4.2333 from Thunderstore
[Message: BepInEx] Chainloader started
[Info : BepInEx] 11 plugins to load
[Info : BepInEx] Loading [Craft From Containers 3.8.2]
[Info : BepInEx] Loading [BalrondShipyard 1.6.5]
[Info : BepInEx] Loading [NoTreeStump 1.0.3]
[Info : BepInEx] Loading [Jotunn 2.29.0]
[Info : BepInEx] Loading [Better Wisps 1.0.42]
[Info : BepInEx] Loading [ShaderHelperForMac 2.0.0]
[Info : BepInEx] Loading [Skills Preview 0.4.2]
[Info : BepInEx] Loading [Quick Stack - Store - Sort - Trash - Restock 1.4.13]
[Info : BepInEx] Loading [Sailing 1.1.8]
[Info : BepInEx] Loading [Display Day & Time in HUD 1.1.2]
[Info : BepInEx] Loading [RecyclePlus 1.3.0]
[Message: BepInEx] Chainloader startup complete
Workaround
For the current Valheim start script, this works locally:
- Enter an x86_64 shell with
arch -x86_64 /bin/sh -c.
- Set
DYLD_LIBRARY_PATH and DYLD_INSERT_LIBRARIES inside that shell.
exec the Valheim executable from there.
I am opening a small PR with that workaround scoped to the Valheim start script. It is not intended to replace the broader native Apple Silicon work in #20.
Summary
On Apple Silicon macOS,
BepInExPack_Valheimcan launch Valheim successfully while BepInEx/Doorstop is never injected. The game reaches the menu and can join a server, but noBepInEx/LogOutput.logis created and no plugins load.This appears to happen because the macOS start script needs to run Valheim's x86_64 slice through Rosetta, but the
DYLD_INSERT_LIBRARIESenvironment used by Doorstop is not present at the final Valheim process when the architecture switch happens.I found the related draft PR #20 for broader Valheim Apple Silicon support. This issue is narrower: a current-user failure mode in the packaged Valheim start script and a small workaround that restores Doorstop injection.
Environment
0.221.12(network version36)BepInExPack_Valheim 5.4.2333from Thunderstore26.3.1(25D2128)arm64/Volumes/FitKid/SteamLibrary/steamapps/common/Valheimstart_game_bepinex.shReproduction
BepInExPack_Valheim 5.4.2333.start_game_bepinex.sh.Expected behavior
BepInEx preloader and chainloader start,
BepInEx/LogOutput.logis created, and plugins underBepInEx/pluginsare loaded.Actual behavior
Valheim starts normally, but BepInEx does not load:
BepInEx/LogOutput.logis not created.The game itself continues to run, so the failure is easy to miss unless the BepInEx log is checked.
Local diagnosis
The packaged macOS start script switches to Rosetta/x86_64 for Valheim. In the failing case, Valheim launches, but Doorstop is not injected.
When I set
DYLD_LIBRARY_PATHandDYLD_INSERT_LIBRARIESinside an x86_64 shell immediately beforeexec-ing the Valheim executable, BepInEx loads correctly.Successful log after the workaround:
Workaround
For the current Valheim start script, this works locally:
arch -x86_64 /bin/sh -c.DYLD_LIBRARY_PATHandDYLD_INSERT_LIBRARIESinside that shell.execthe Valheim executable from there.I am opening a small PR with that workaround scoped to the Valheim start script. It is not intended to replace the broader native Apple Silicon work in #20.