Skip to content

fix(macos): allow reading kern.hv_vmm_present sysctl#312

Open
lucasfais wants to merge 1 commit into
anthropic-experimental:mainfrom
lucasfais:fix/macos-hv-vmm-present-sysctl-2
Open

fix(macos): allow reading kern.hv_vmm_present sysctl#312
lucasfais wants to merge 1 commit into
anthropic-experimental:mainfrom
lucasfais:fix/macos-hv-vmm-present-sysctl-2

Conversation

@lucasfais

@lucasfais lucasfais commented Jun 15, 2026

Copy link
Copy Markdown

I'm running a rails project with cabybara specs, using Selenium and chromedriver. Chrome/Chromium were not able to run without these changes. To be honest, I don't know much about the subject, but the agent help me fixed it. Let me know if that makes sense to the project.

Agent's description below.


Scenario

Running a Rails app's Capybara feature specs (Selenium + headless Chrome via chromedriver) with the bash command wrapped by the seatbelt sandbox (allowBrowserProcess: true). Chrome launched but every test died at visit with session not created: Chrome instance exited / tab crashed.

Root cause

Modern Chromium-based browsers PCHECK sysctlbyname("kern.hv_vmm_present") inside base::IsVirtualMachine() during startup (base/mac/mac_util.mm). The seatbelt profile didn't allow that sysctl, so the check failed and Chrome aborted with a FATAL before the renderer ever came up:

[FATAL:base/mac/mac_util.mm:379] Check failed: . : Operation not permitted (1)

This effectively breaks allowBrowserProcess for any current Chrome/Chromium on macOS.

Fix

Add kern.hv_vmm_present to the sysctl-read allowlist. It's a read-only, single-bit value (running under a VM or not) and is strictly less sensitive than entries already permitted (kern.bootargs, kern.hostname, etc.), so there's no meaningful security trade-off.

Testing

  • Added a regression test asserting the sysctl is readable under the generated profile.
  • Verified end-to-end: with the change, Chrome boots and a full Capybara/Selenium feature spec passes (was 100% failing before).

Chromium-based browsers PCHECK sysctlbyname("kern.hv_vmm_present") in
base::IsVirtualMachine() during startup (base/mac/mac_util.mm). When the
seatbelt profile denies this sysctl, the browser aborts with a FATAL at
mac_util.mm before launching, which breaks allowBrowserProcess support
for any modern Chrome/Chromium.

Add kern.hv_vmm_present to the sysctl-read allowlist so browsers can
start under the sandbox. It is a read-only, single-bit value (VM/host)
and is strictly less sensitive than entries already allowed (e.g.
kern.bootargs, kern.hostname).

Add a regression test asserting the sysctl is readable under the profile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant