Repository navigation
[NemoClaw][Linux] Brew policy preset applies network rules but does not provision brew binary, so brew install step in test cannot succeed #3757
Description
Description
[Description]
When the brew policy preset is applied to a NemoClaw sandbox, the documented test case expects both: (a) network egress to Homebrew endpoints (formulae.brew.sh, raw.githubusercontent.com, ghcr.io, GitHub) and (b) a working brew CLI inside the sandbox so brew install hello can complete. In practice, after applying the brew preset, all the curl and git network probes succeed from inside the sandbox, but brew install --quiet hello fails with bash: brew: command not found. This shows that the preset correctly configures network access but does not ensure that the Homebrew/brew binary is installed in the sandbox, so the final “brew install hello” validation step in the test case cannot be executed as written.
[Environment]
NemoClaw: v0.0.44
OpenShell CLI: 0.0.39
OpenClaw: 2026.4.24 (cbcfdf6)
Sandbox OS: Linux (default NemoClaw base image, x86_64)
Container runtime: Docker on DGX Spark host
Network: outbound HTTPS generally allowed; no proxy errors for Homebrew endpoints
[Steps to Reproduce]
Pre-condition:
-
NemoClaw sandbox
new-sbis running. - No additional network-policy presets have been applied yet.
Steps:
-
On the host, apply the brew preset:
nemoclaw new-sb policy-addWhen prompted, select the
"brew"preset and confirm.
Verify it is active:nemoclaw new-sb policy-listConfirm that
brewshows as●(applied) in the preset list.
Connect into the sandbox:nemoclaw new-sb connectYou land at
sandbox@...:~$.
Inside the sandbox, probe the Homebrew registry:curl -sI --max-time 8 https://formulae.brew.sh
Still inside the sandbox, fetch the Homebrew install script:curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o /dev/null
Check git access to the Homebrew repo:git ls-remote https://github.com/Homebrew/brew.git HEAD
Probe ghcr.io:curl -sI --max-time 8 https://ghcr.io
Try to install a package via brew:brew install --quiet hello
Exit the sandbox:exit
[Expected]
-
nemoclaw new-sb policy-addwith thebrewpreset applies the Homebrew-related network policy; policy version increments. -
nemoclaw new-sb policy-listshowsbrewas●(applied) for sandboxnew-sb. -
nemoclaw new-sb connectenters the sandbox successfully. -
Inside the sandbox,
curl -sI --max-time 8 https://formulae.brew.shreturns HTTP200or301, confirming the Homebrew registry is reachable via/usr/bin/curl(which the test spec assumes is in the brew preset’s binary allowlist). -
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o /dev/nullsucceeds, confirming access to the install script. -
git ls-remote https://github.com/Homebrew/brew.git HEADsucceeds (no TLS errors), confirming git access to the Homebrew repo. -
curl -sI --max-time 8 https://ghcr.ioreturns HTTP200or301, confirming ghcr.io is reachable for bottle downloads. -
brew install --quiet hellosucceeds end‑to‑end: thebrewbinary exists in the sandbox PATH, downloads from ghcr.io / pkg-containers.githubusercontent.com / objects.githubusercontent.com succeed without “server certificate verification failed” errors, and thehellopackage is installed. - Sandbox exits cleanly.
[Actual]
-
nemoclaw new-sb policy-listshows thebrewpreset as applied (● brew — Homebrew (Linuxbrew) package manager access), alongside other presets (brave, discord, huggingface, local-inference, npm, pypi, etc.). -
nemoclaw new-sb connectenters the sandbox successfully and reports an inference route usingvllm-local/meta/llama-3.1-8b-instruct. -
Inside the sandbox:
-
curl -sI --max-time 8 https://formulae.brew.shreturns HTTP/2200with GitHub/varnish headers, confirming the registry is reachable. -
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o /dev/nullcompletes successfully (no output, zero exit code). -
git ls-remote https://github.com/Homebrew/brew.git HEADreturns a valid commit hash (e.g.,a7f3847d5f52c123207873b6ca5093e79701d468 HEAD), confirming git access. -
curl -sI --max-time 8 https://ghcr.iosucceeds withHTTP/1.1 200 Connection Establishedfollowed byHTTP/2 405, showing TLS and connectivity to ghcr.io are working.
-
-
However, attempting to install a package via brew fails immediately:
sandbox@2549dec54185:~$ brew install --quiet hello bash: brew: command not foundindicating that the
brewbinary is not installed in the sandbox at all, even though thebrewpolicy preset is applied and all the network probes succeed.
The final step of the test case (“brew install hello SUCCEEDS end‑to‑end”) cannot be executed as written because there is nobrewCLI in the sandbox PATH.
[Impact / Notes]
-
The
brewpreset correctly configures network access to the Homebrew registry, GitHub, and ghcr.io, but does not ensure that the Homebrew/brew CLI is present inside the sandbox. -
The documented test case for the
brewpreset implicitly assumes a workingbrewbinary, so the QA scenario “apply brew preset → brew install hello” cannot be validated in a fresh NemoClaw sandbox without manually installing Homebrew first. -
This may be resolved either by:
-
Updating the test plan/docs to state that the user must install Homebrew inside the sandbox before running
brew installchecks, or -
Enhancing the
brewpreset / onboarding flow to optionally install Homebrew (or to check for the presence ofbrewand warn clearly if it is missing).
-
Updating the test plan/docs to state that the user must install Homebrew inside the sandbox before running
Bug Details
| Field | Value |
|---|---|
| Priority | Unprioritized |
| Action | Dev - Open - To fix |
| Disposition | Open issue |
| Module | Machine Learning - NemoClaw |
| Keyword | NemoClaw, NEMOCLAW_GH_SYNC_APPROVAL, NemoClaw-SWQA-RelBlckr-Recommended, NemoClaw-SWQA-Sprint4-Blocker |
[NVB#6188343]
Activity
feat(sandbox): bake Homebrew core into the sandbox base image (#3913) (…
laitingsheng commentedon May 21, 2026
#3916 could be a solution for this
2 remaining items
fix(sandbox): keep Homebrew on Linuxbrew prefix (#4459)
prekshivyas commentedon May 28, 2026
Re-tested on NemoClaw v0.0.53 (latest tag): destroyed the old sandbox (
destroy --cleanup-gateway), re-onboarded fresh with the stock image, and applied thebrewpreset.Good news: the original bug is gone
brew: command not foundno longer happens — brew now comes pre-installed in the sandbox image:brewis at/usr/local/bin/brew→/home/linuxbrew/.linuxbrew/Homebrew/bin/brewbrew --version→ Homebrew 5.1.12All the network checks from the original report still pass:
curl -sI https://formulae.brew.shcurl -fsSL .../install.shgit ls-remote https://github.com/Homebrew/brew.git HEADcurl -sI https://ghcr.ioBad news:
brew install hellostill failsIt fails for two separate reasons. Neither is a network problem — the
brewpreset's network rules are fine. The problem is that brew tries to write to folders the sandbox user isn't allowed to write to.Problem 1 — brew thinks its home is
/usr/local, which is read-onlyBrew is actually installed under
/home/linuxbrew/.linuxbrew, but it thinks its home folder is/usr/local. Why? The image ships a/usr/local/bin/brewshortcut (symlink), and that shortcut triggers a special rule inside brew's startup script meant for macOS:So on Linux it wrongly settles on
/usr/local. The sandbox makes/usrread-only, so brew can't create its lock folder and stops. (Trying to fix this withHOMEBREW_PREFIX=...as an environment variable does not work — brew's startup script overwrites it. Verified.)Problem 2 — brew's temp folder
/var/tmpis blockedOnce Problem 1 is worked around, brew gets much further (it downloads Ruby and the
hellopackage from ghcr.io with no trouble), then fails here:/var/tmplooks writable (1777), but the sandbox user can't even list it. This is not a read-only mount — it's the sandbox's Landlock policy. The policy only allows writing to a fixed list of folders:/tmp,/home/linuxbrew,/sandbox,/dev/null, …/usr,/etc,/var/log,/lib, …/var/tmpis on neither list, so it's blocked.Proof it's only these two things
If I point brew at folders the sandbox does allow:
/home/linuxbrew/.linuxbrew(which is writable), andHOMEBREW_TEMP=/tmpthen
brew install helloworks end to end:Suggested fix
/usr/local/bin/brewsymlink (it's what forces the wrong home folder) and instead add brew to PATH the normal way, viaeval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)". That makes brew use its writable/home/linuxbrew/.linuxbrewhome.HOMEBREW_TEMP=/tmp).Bottom line: the "brew is missing" part is fixed, but a fresh sandbox still can't run
brew installwithout these tweaks.prekshivyas commentedon May 28, 2026
Quick follow-up: this is already fixed on
mainby #4459 ("fix(sandbox): keep Homebrew on Linuxbrew prefix"), merged today as a follow-up to #3916.It does exactly what's needed for both problems above:
/usr/local/bin/brewsymlink with a small wrapper script that execs/home/linuxbrew/.linuxbrew/bin/brew, so Homebrew keeps its writable Linuxbrew prefix instead of inferring/usr/local.HOMEBREW_TEMP=/tmp(andTMPDIR=/tmp), which is in the sandbox's writable set, so the unpack step no longer hits the blocked/var/tmp.brew --prefixresolves to/home/linuxbrew/.linuxbrew.My testing above was on v0.0.53, which predates that merge — that's why a fresh sandbox still showed the failure. The fix is on
mainnow and will be fully available in the next release. Once that release ships,brew install helloshould work end-to-end with no manual tweaks.