-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(onboard): skip OLLAMA_HOST=0.0.0.0 on WSL2 to fix Docker routing #1104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -30,6 +30,7 @@ const { | |||||||||
| const { | ||||||||||
| inferContainerRuntime, | ||||||||||
| isUnsupportedMacosRuntime, | ||||||||||
| isWsl, | ||||||||||
| shouldPatchCoredns, | ||||||||||
| } = require("./platform"); | ||||||||||
| const { resolveOpenshell } = require("./resolve-openshell"); | ||||||||||
|
|
@@ -2192,7 +2193,11 @@ async function setupNim(gpu) { | |||||||||
| } else if (selected.key === "ollama") { | ||||||||||
| if (!ollamaRunning) { | ||||||||||
| console.log(" Starting Ollama..."); | ||||||||||
| run("OLLAMA_HOST=0.0.0.0:11434 ollama serve > /dev/null 2>&1 &", { ignoreError: true }); | ||||||||||
| // On WSL2, binding to 0.0.0.0 creates a dual-stack socket that Docker | ||||||||||
| // cannot reach via host-gateway. The default 127.0.0.1 binding works | ||||||||||
| // because WSL2 relays IPv4-only sockets to the Windows host. | ||||||||||
| const ollamaEnv = isWsl() ? "" : "OLLAMA_HOST=0.0.0.0:11434 "; | ||||||||||
| run(`${ollamaEnv}ollama serve > /dev/null 2>&1 &`, { ignoreError: true }); | ||||||||||
|
Comment on lines
+2199
to
+2200
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clear inherited At Line 2199, omitting inline assignment does not remove an already-exported 💡 Proposed fix- const ollamaEnv = isWsl() ? "" : "OLLAMA_HOST=0.0.0.0:11434 ";
- run(`${ollamaEnv}ollama serve > /dev/null 2>&1 &`, { ignoreError: true });
+ const ollamaEnvPrefix = isWsl() ? "env -u OLLAMA_HOST " : "OLLAMA_HOST=0.0.0.0:11434 ";
+ run(`${ollamaEnvPrefix}ollama serve > /dev/null 2>&1 &`, { ignoreError: true });📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fix intentionally avoids overriding OLLAMA_HOST on WSL2 to let Ollama use its default binding. If a user has explicitly exported OLLAMA_HOST=0.0.0.0 in their environment, that's an intentional configuration choice - overriding it silently would be surprising. This is an unlikely edge case since neither the Ollama installer nor NemoClaw sets this variable in shell profiles.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✏️ Learnings added
|
||||||||||
| sleep(2); | ||||||||||
| } | ||||||||||
| console.log(" ✓ Using Ollama on localhost:11434"); | ||||||||||
|
|
@@ -2230,6 +2235,7 @@ async function setupNim(gpu) { | |||||||||
| } | ||||||||||
| break; | ||||||||||
| } else if (selected.key === "install-ollama") { | ||||||||||
| // macOS only — this option is gated by process.platform === "darwin" above | ||||||||||
| console.log(" Installing Ollama via Homebrew..."); | ||||||||||
| run("brew install ollama", { ignoreError: true }); | ||||||||||
| console.log(" Starting Ollama..."); | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update local-validation guidance to include the WSL exception.
With Line 2199 intentionally avoiding
0.0.0.0on WSL, the currentvalidateLocalProvider("ollama-local")message inbin/lib/local-inference.jsstill tells users to bind0.0.0.0:11434, which is now the known-bad path on WSL.🤖 Prompt for AI Agents