Skip to content

fix(bootstrap-windows): install Ubuntu 24.04 when WSL distro is missing - #4101

Merged
cv merged 2 commits into
mainfrom
codex/fix-3974-wsl-ubuntu24
May 22, 2026
Merged

fix(bootstrap-windows): install Ubuntu 24.04 when WSL distro is missing#4101
cv merged 2 commits into
mainfrom
codex/fix-3974-wsl-ubuntu24

Conversation

@ericksoa

@ericksoa ericksoa commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Verification

  • npm ci --ignore-scripts
  • npx vitest run test/bootstrap-windows.test.ts
  • git diff --check

Fixes #3974

Summary by CodeRabbit

  • New Features

    • Windows bootstrap now defaults to Ubuntu 24.04.
    • Installer now runs missing distro installation immediately and always verifies Docker-in-WSL integration.
  • Bug Fixes

    • Improved distro installation polling, verification, and clearer installer messaging on failures.
  • Tests

    • Added end-to-end tests validating bootstrap behavior, install commands, and failure guidance.

Review Change Stack

Signed-off-by: Aaron Erickson aerickson@nvidia.com

@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Windows bootstrap script now defaults to and immediately installs Ubuntu-24.04 WSL when missing, replacing a deferred handoff mechanism. New helper functions handle install command creation, registration polling, and failure messaging. Top-level flow is simplified and covered by a Vitest suite that validates success and failure guidance.

Changes

Windows Bootstrap WSL Distro Installation

Layer / File(s) Summary
Update default distro to Ubuntu-24.04
scripts/bootstrap-windows.ps1
Script synopsis, .PARAMETER DistroName help text, and param default changed to Ubuntu-24.04.
Implement immediate distro installation and registration
scripts/bootstrap-windows.ps1
New helpers (install command builder, Show-WslDistroInstallFailure, Wait-WslDistroRegistration, Install-WslDistro) added; Ensure-UbuntuWsl rewritten to run wsl --install and verify registration/start immediately.
Remove deferred-install branches and simplify flow
scripts/bootstrap-windows.ps1
Removed $script:InstallDistroAtHandoff and handoff-stage install branch; Open-UbuntuForInstaller and Write-InstallerHandoff simplified; Ensure-DockerWslIntegration now always invoked; Invoke-Main guarded by NEMOCLAW_BOOTSTRAP_WINDOWS_SOURCE_ONLY.
Vitest harness and tests for bootstrap behavior
test/bootstrap-windows.test.ts
Adds PowerShell discovery and a temporary PowerShell harness; tests assert wsl --install Ubuntu-24.04, wsl --set-default Ubuntu-24.04, successful registration message, and preserved failure guidance including the issue-3974 instructions.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

bug, Platform: Windows/WSL, fix

Poem

🐰 I hop to open Windows doors,
Ubuntu-24.04 lands on the floors.
No handoff waits, the distro springs,
WSL sings, the installer brings.
Hooray for instant setup things!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: installing Ubuntu 24.04 when WSL distro is missing, which directly addresses the core fix.
Linked Issues check ✅ Passed The PR fully implements the objective from issue #3974: automatically install Ubuntu-24.04 via 'wsl --install' when no distro is registered, with actionable guidance if installation fails.
Out of Scope Changes check ✅ Passed All changes are scoped to the Windows bootstrap script and its tests, directly addressing the WSL distro installation issue without introducing unrelated modifications.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-3974-wsl-ubuntu24

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: wsl-e2e
Optional E2E: wsl-repo-cloud-openclaw, cloud-onboard-e2e

Dispatch hint: wsl-e2e

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • wsl-e2e (high): Required because the changed Windows bootstrap affects WSL setup and the Windows-to-WSL install/onboarding path. The existing WSL E2E runs on windows-latest, prepares WSL, builds NemoClaw inside WSL, and runs the full E2E flow when Docker is available.

Optional E2E

  • wsl-repo-cloud-openclaw (high): Useful scenario-runner validation for the WSL platform path and platform-wsl suite. It overlaps with wsl-e2e but gives scenario-framework coverage for WSL onboarding state.
  • cloud-onboard-e2e (medium): Optional sanity check for the standard installer/onboard flow that the Windows bootstrap hands off to after WSL preparation. The PR does not change the Linux installer itself, so this is adjacent rather than merge-blocking.

New E2E recommendations

  • windows-bootstrap-script (high): Existing WSL E2E workflows prepare WSL directly and do not execute scripts/bootstrap-windows.ps1, so regressions in the actual Windows bootstrap entrypoint, distro install command construction, handoff behavior, Docker Desktop branches, elevation/resume behavior, or Ubuntu-24.04 default can escape E2E coverage.
    • Suggested test: Add a Windows bootstrap E2E that runs scripts/bootstrap-windows.ps1 on windows-latest in a safe mode such as -InstallDockerDesktop:$false with controlled/mocked native command boundaries, validating WSL distro registration/defaulting and installer handoff output.
  • windows-arm-wsl-bootstrap (medium): The change introduces explicit Ubuntu 24.04 guidance for Windows ARM, but current GitHub-hosted WSL coverage is windows-latest x64 and does not validate ARM-specific behavior or availability constraints.
    • Suggested test: Add ARM-specific Windows bootstrap coverage, or a hermetic E2E-style harness that simulates Windows ARM WSL install failure modes and verifies the Ubuntu-24.04 recovery guidance.

Dispatch hint

  • Workflow: wsl-e2e.yaml
  • jobs input: wsl-e2e

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

E2E Scenario Advisor Recommendation

Required scenario E2E: None
Optional scenario E2E: None

Workflow run

Full scenario advisor summary

E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required scenario E2E

  • None. No scenario workflow, scenario metadata, scenario runtime, or validation-suite files changed.

Optional scenario E2E

  • None.

Relevant changed files

  • None.

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 1 needs attention, 0 worth checking, 0 nice ideas
Since last review: 1 prior item resolved, 1 still applies, 0 new items found

Review findings

🛠️ Needs attention

  • Exact curl|bash Windows failure path remains unaddressed (scripts/bootstrap-windows.ps1:886): Issue [Windows ARM][Install] curl|bash installer fails on fresh Windows ARM — WSL2 has no Ubuntu distro, no actionable error #3974 reports that the documented PowerShell command `curl.exe -fsSL https://www.nvidia.com/nemoclaw.sh | bash` fails in `bash.exe` before the NemoClaw installer script or any Windows-side bootstrap logic can run when no WSL distro is registered. This PR improves `scripts/bootstrap-windows.ps1` by installing `Ubuntu-24.04` before the handoff when that PowerShell script is launched, but the changed files still do not alter the shell installer, the published/documented Windows entrypoint, or any dispatch path that would cause the exact reported command to run this PowerShell preflight before `bash.exe` exits.
    • Recommendation: Route fresh Windows users through this PowerShell bootstrap before invoking `bash`, update the documented Windows ARM install entrypoint accordingly, or add a Windows-side preflight that runs before `bash.exe`; include evidence or tests for the exact no-distro command path from the issue.
    • Evidence: Linked issue clauses include `Run the documented NemoClaw install command: curl.exe -fsSL https://www.nvidia.com/nemoclaw.sh | bash` and `The NemoClaw installer script (nemoclaw.sh) is never executed.` The diff only changes `scripts/bootstrap-windows.ps1` and `test/bootstrap-windows.test.ts`; `Invoke-Main` in `scripts/bootstrap-windows.ps1` is still reached only when this PowerShell script is launched.

🔎 Worth checking

  • None.

🌱 Nice ideas

  • None.
Since last review details

Current findings:

  • Exact curl|bash Windows failure path remains unaddressed (scripts/bootstrap-windows.ps1:886): Issue [Windows ARM][Install] curl|bash installer fails on fresh Windows ARM — WSL2 has no Ubuntu distro, no actionable error #3974 reports that the documented PowerShell command `curl.exe -fsSL https://www.nvidia.com/nemoclaw.sh | bash` fails in `bash.exe` before the NemoClaw installer script or any Windows-side bootstrap logic can run when no WSL distro is registered. This PR improves `scripts/bootstrap-windows.ps1` by installing `Ubuntu-24.04` before the handoff when that PowerShell script is launched, but the changed files still do not alter the shell installer, the published/documented Windows entrypoint, or any dispatch path that would cause the exact reported command to run this PowerShell preflight before `bash.exe` exits.
    • Recommendation: Route fresh Windows users through this PowerShell bootstrap before invoking `bash`, update the documented Windows ARM install entrypoint accordingly, or add a Windows-side preflight that runs before `bash.exe`; include evidence or tests for the exact no-distro command path from the issue.
    • Evidence: Linked issue clauses include `Run the documented NemoClaw install command: curl.exe -fsSL https://www.nvidia.com/nemoclaw.sh | bash` and `The NemoClaw installer script (nemoclaw.sh) is never executed.` The diff only changes `scripts/bootstrap-windows.ps1` and `test/bootstrap-windows.test.ts`; `Invoke-Main` in `scripts/bootstrap-windows.ps1` is still reached only when this PowerShell script is launched.

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
scripts/bootstrap-windows.ps1 (1)

717-726: 💤 Low value

Misleading status message after fresh distro installation.

Line 726 prints "WSL distro already registered" unconditionally, even when we just installed the distro in lines 718-723. Consider updating the messaging to reflect the actual scenario.

💡 Suggested improvement
     if ($distros -notcontains $DistroName) {
         Install-WslDistro -Name $DistroName
         $distros = Get-WslDistros
         if ($distros -notcontains $DistroName) {
             Write-WslUbuntuRequiredNotice -Name $DistroName
             throw "WSL distro '$DistroName' is still not registered after install."
         }
+        Write-Status "WSL distro registered: $DistroName"
+    } else {
+        Write-Status "WSL distro already registered: $DistroName"
     }
-
-    Write-Status "WSL distro already registered: $DistroName"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/bootstrap-windows.ps1` around lines 717 - 726, The status message
"WSL distro already registered: $DistroName" is printed unconditionally even
after a fresh install; update the logic around Install-WslDistro/Get-WslDistros
to emit a different message when the distro was just installed versus when it
was already present — e.g., track a flag (e.g., $installed = $true) or check
membership of $distros after the install and call Write-Status with "WSL distro
installed: $DistroName" when installation occurred, otherwise keep "WSL distro
already registered: $DistroName"; modify the block that uses $distros,
$DistroName, Install-WslDistro, Get-WslDistros, and Write-Status accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@scripts/bootstrap-windows.ps1`:
- Around line 717-726: The status message "WSL distro already registered:
$DistroName" is printed unconditionally even after a fresh install; update the
logic around Install-WslDistro/Get-WslDistros to emit a different message when
the distro was just installed versus when it was already present — e.g., track a
flag (e.g., $installed = $true) or check membership of $distros after the
install and call Write-Status with "WSL distro installed: $DistroName" when
installation occurred, otherwise keep "WSL distro already registered:
$DistroName"; modify the block that uses $distros, $DistroName,
Install-WslDistro, Get-WslDistros, and Write-Status accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ca218e31-dd6d-4674-92c7-8693a9583e13

📥 Commits

Reviewing files that changed from the base of the PR and between 441664c and e39b379.

📒 Files selected for processing (2)
  • scripts/bootstrap-windows.ps1
  • test/bootstrap-windows.test.ts

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa ericksoa added v0.0.50 platform: arm64 Affects ARM64 or aarch64 architecture NV QA Bugs found by the NVIDIA QA Team UAT Issues flagged for User Acceptance Testing. labels May 22, 2026
@ericksoa
ericksoa requested a review from cv May 22, 2026 23:01
@cv
cv merged commit 7c7f7a4 into main May 22, 2026
34 checks passed
ericksoa pushed a commit that referenced this pull request May 27, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Fixes a regression from #4101 where first-run Ubuntu account setup ran
inside the current PowerShell console, causing prompt alignment issues.
This restores the separate WSL handoff window, keeps the `Ubuntu-24.04`
default, and documents how users with an existing `Ubuntu` distro can
reuse it with `-DistroName Ubuntu`.

## Changes
- Defer missing Ubuntu distro installation to the final handoff window.
- Skip Docker-in-WSL verification until first-run Ubuntu setup
completes.
- Update bootstrap tests to guard against same-console `wsl --install`
regressions.
- Document the `Ubuntu-24.04` default and `-DistroName Ubuntu` override.

## Type of Change

- [x] Code change (feature, bug fix, or refactor)
- [x] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Verification
<!-- Check each item you ran and confirmed. Leave unchecked items you
skipped. Doc-only changes do not require npm test unless you ran it. -->
- [x] `npx prek run --all-files` passes
- [x] `npm test` passes
- [x] Tests added or updated for new or changed behavior
- [x] No secrets, API keys, or credentials committed
- [x] Docs updated for user-facing behavior changes
- [ ] `npm run docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
<!-- DCO sign-off required by CI. Run: git config user.name && git
config user.email -->
Signed-off-by: zyang-dev <267119621+zyang-dev@users.noreply.github.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Updated Windows preparation guide with clarified instructions for
Ubuntu 24.04 installation, WSL 2 feature enablement, Docker Desktop
setup, and system restart procedures. Added details on default distro
configuration and reusing existing distributions.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/NVIDIA/NemoClaw/pull/4278?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: zyang-dev <267119621+zyang-dev@users.noreply.github.com>
@wscurran wscurran added area: install Install, setup, prerequisites, or uninstall flow area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression platform: wsl Affects Windows Subsystem for Linux and removed priority: high labels Jun 3, 2026
@cv
cv deleted the codex/fix-3974-wsl-ubuntu24 branch June 28, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: install Install, setup, prerequisites, or uninstall flow area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow bug-fix PR fixes a bug or regression NV QA Bugs found by the NVIDIA QA Team platform: arm64 Affects ARM64 or aarch64 architecture platform: wsl Affects Windows Subsystem for Linux UAT Issues flagged for User Acceptance Testing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows ARM][Install] curl|bash installer fails on fresh Windows ARM — WSL2 has no Ubuntu distro, no actionable error

3 participants