Skip to content

docs: add a Windows (WSL) setup guide and setup scripts - #1443

Open
Shulamit sharabani (SHULMIT) wants to merge 7 commits into
microsoft:mainfrom
SHULMIT:docs/windows-wsl-setup-1419
Open

Shulamit sharabani (SHULMIT) wants to merge 7 commits into
microsoft:mainfrom
SHULMIT:docs/windows-wsl-setup-1419

Conversation

@SHULMIT

@SHULMIT Shulamit sharabani (SHULMIT) commented Sep 29, 2026 •

Copy link
Copy Markdown

Summary

Adds a Windows + WSL 2 setup guide for Scope contributors, and checks in the two
setup scripts from Christopher MANEU (@cmaneu)'s
gist so the
guide can use them.

Guide (docs/tips/03-windows-wsl-dev-setup.md)

  • A quick path with the scripts: scripts/setup-windows-wsl.ps1 in an elevated
    PowerShell, then scripts/setup-linux-prereqs.sh --skip-docker in Ubuntu.
  • Step by step, for Ubuntu 22.04/24.04:
    • WSL 2 and Ubuntu: first-run user, version and default checks.
    • Docker Desktop: WSL 2 backend, WSL Integration, verification.
    • Cloning into the Linux file system.
    • The Linux prerequisites, with Ubuntu commands: base tools, Node.js 22 from
      NodeSource, Corepack/pnpm, mkcert and GitHub CLI.
    • GitHub auth, starting the stack, and trusting the mkcert CA in Windows.
  • Links to the official WSL, Docker, Node.js, Corepack and GitHub CLI docs, and
    a troubleshooting section.

Scripts. The first commit imports them unchanged and is co-authored by
Christopher MANEU (@cmaneu). The next commit adapts them:

  • setup-windows-wsl.ps1: adds the license header. Its closing steps now clone
    Scope in WSL and run the checked-in Linux script, instead of downloading a
    gist revision.
  • setup-linux-prereqs.sh failed when run as root, as in a devcontainer. I
    reproduced both problems in ubuntu:24.04:
    • $SUDO -E bash - ran a command named -E.
    • The unset $USER stopped the script under set -u.
  • setup-linux-prereqs.sh now suggests DOCKER_GID only for Docker Engine.
    With Docker Desktop, the socket is root:root 0660 inside containers, and the
    Compose default of 0 already matches it.

The guide is also linked from CONTRIBUTING.md, the website's local
development page and the tips index.

Closes #1419

Demos

N/A: documentation and setup scripts, with no Portal or CLI change.

Before

N/A

After

N/A

Testing

  • setup-linux-prereqs.sh: shellcheck finds nothing new compared with the
    gist version. Only the existing SC2086/SC2015 notes remain.
  • setup-linux-prereqs.sh: both root-mode failures are reproduced in an
    ubuntu:24.04 container, and the replacement forms work there.
  • setup-windows-wsl.ps1: the Windows PowerShell 5.1 parser reports 0 errors,
    and #Requires -Version 5.1 still applies.
  • Docker Desktop socket ownership inside a container, checked with
    docker run -v /var/run/docker.sock:/var/run/docker.sock alpine stat: uid=0 gid=0 mode=660.
  • Ubuntu 22.04/24.04 package candidates, checked with apt-cache policy:
    • nodejs is 12/18, so the guide uses NodeSource.
    • gh is 2.4.0/2.45.0, so it uses GitHub's apt repository.
    • mkcert is 1.4.3/1.4.4.
    • shasum comes from libdigest-sha-perl.
  • All 19 external links return 200, and the in-page anchors and relative links
    resolve.
  • Not run: a full install of either script on a fresh Windows machine or Ubuntu
    distribution.

Documentation and compatibility

  • New guide, linked from CONTRIBUTING.md,
    website/src/content/docs/getting-started/local-development.md and
    docs/tips/README.md.
  • No breaking changes.
  • The guide downloads the Windows script from
    raw.githubusercontent.com/microsoft/scope/main/scripts/setup-windows-wsl.ps1.
    That URL works once this is merged.

Checklist

  • If Portal features changed, keep CLI capabilities in sync. (N/A)
  • If Portal components changed, update their Storybook stories. (N/A)
  • If database changes require a migration, include up() / down() and keep it CosmosDB-compatible. (N/A)
  • If dependencies changed, update the lockfile and regenerate NOTICE / NOTICE-REVIEW.txt with pnpm notice as needed. (N/A)
  • Video showing the behavior before the suggested change (N/A)
  • Video showing the behavior after the suggested change (N/A)

@SHULMIT

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@manekinekko Wassim Chegham (manekinekko) added the topic: dx Dev setup and developer experience label Oct 1, 2026
@cedricvidal Cedric Vidal (cedricvidal) added the community-contribution Pull requests submitted by external community contributors. label Oct 7, 2026
@cmaneu

Copy link
Copy Markdown
Member

Hello Shulamit sharabani (@SHULMIT),
Thanks for your PR! I reviewed your doc, it's going into the right direction, yet it needs some polish :).

The overall structure looks good, and the local HTTPS certificate in Windows is a great point. Here are some comments:

  • Some parts needs to be more detailed. For example, installing WSL2/Linux distrib and configuring Docker Desktop to show up inside WSL.
  • Some parts would benefit from links to official docs (like Docker ones)
  • We can assume Ubuntu 22.x/24.x will be used, and so give install commands for node/etc.. for that OS.

In parallel of your documentation work, I was working on two scripts (one from outside of WSL, one inside) to complete the install automatically. This setup script should be the basis of future devcontainer support. They should be integrated into that doc as well.

Import the two setup scripts from
https://gist.github.com/cmaneu/03e857b16ee36788962a9355d738970b
unchanged, so the follow-up adaptations are reviewable on their own:

- scripts/setup-windows-wsl.ps1 (scope-wsl.ps1): elevated PowerShell that
  updates WSL, installs Ubuntu and installs Docker Desktop with the WSL 2
  backend.
- scripts/setup-linux-prereqs.sh (scope-setup.sh): checks and installs the
  Linux prerequisites (Node.js 22, Corepack/pnpm, Docker, mkcert, gh).

Refs microsoft#1419

Co-authored-by: Christopher MANEU <790974+cmaneu@users.noreply.github.com>
Adapt the imported scripts for use from the repository:

- setup-windows-wsl.ps1: add the license header, and end with steps that
  clone Scope into the WSL filesystem and run the checked-in
  setup-linux-prereqs.sh instead of downloading a gist revision. The script
  then matches the checkout's pinned versions.
- setup-linux-prereqs.sh: when run as root (devcontainers, containers),
  $SUDO is empty and `$SUDO -E bash -` ran a command named "-E"; pipe to
  plain `bash` instead. $USER is unset there and aborted the script under
  `set -u`, so use `id -un`.
- setup-linux-prereqs.sh: only suggest DOCKER_GID for Docker Engine.
  Docker Desktop (including WSL) mounts its socket as root:root 0660 in
  containers, which the Compose default of 0 already matches.

Refs microsoft#1419

Co-authored-by: Christopher MANEU <790974+cmaneu@users.noreply.github.com>
Address the review on microsoft#1443:

- Start with the scripted path: setup-windows-wsl.ps1 in an elevated
  PowerShell, then setup-linux-prereqs.sh from the checkout in Ubuntu.
- Detail installing WSL 2 and Ubuntu (distribution, first-run user,
  version and default checks) and Docker Desktop (WSL 2 backend, WSL
  Integration, verification, DOCKER_GID left unset).
- Target Ubuntu 22.04/24.04 with manual install commands: base tools,
  Node.js 22 from NodeSource (Ubuntu ships 12 and 18), Corepack and pnpm,
  mkcert from apt, and GitHub CLI from its apt repository (Ubuntu's is
  outdated).
- Link the official WSL, Docker, Node.js, Corepack and GitHub CLI docs,
  and add troubleshooting for virtualization, Docker integration and WSL
  memory.

Refs microsoft#1419
- CONTRIBUTING: mention scripts/setup-linux-prereqs.sh under the
  prerequisites, and link the Windows WSL guide.
- Local development (website): link the Windows WSL guide.
- Tips index: describe the expanded guide.

Refs microsoft#1419
Shulamit sharabani (SHULMIT) added a commit to SHULMIT/scope that referenced this pull request Oct 7, 2026
Address the review on microsoft#1443:

- Start with the scripted path: setup-windows-wsl.ps1 in an elevated
  PowerShell, then setup-linux-prereqs.sh from the checkout in Ubuntu.
- Detail installing WSL 2 and Ubuntu (distribution, first-run user,
  version and default checks) and Docker Desktop (WSL 2 backend, WSL
  Integration, verification, DOCKER_GID left unset).
- Target Ubuntu 22.04/24.04 with manual install commands: base tools,
  Node.js 22 from NodeSource (Ubuntu ships 12 and 18), Corepack and pnpm,
  mkcert from apt, and GitHub CLI from its apt repository (Ubuntu's is
  outdated).
- Link the official WSL, Docker, Node.js, Corepack and GitHub CLI docs,
  and add troubleshooting for virtualization, Docker integration and WSL
  memory.

Refs microsoft#1419

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SHULMIT Shulamit sharabani (SHULMIT) changed the title Docs/windows wsl setup 1419 docs: add a Windows (WSL) setup guide and setup scripts Oct 7, 2026
@SHULMIT

Copy link
Copy Markdown
Author

Thanks Christopher MANEU (@cmaneu) for the review and the scripts! I've updated the PR:

  • More detail: installing WSL 2 and Ubuntu (first-run user, wsl --list --verbose, default distribution) and configuring Docker Desktop (WSL 2 engine, Resources > WSL Integration, verification).
  • Official docs: links to the WSL, Docker Desktop, NodeSource, Corepack and GitHub CLI documentation.
  • Ubuntu 22.04/24.04: install commands for the base tools, Node.js 22 (NodeSource, since Ubuntu ships 12/18), Corepack/pnpm, mkcert (apt) and gh (GitHub's apt repo).
  • Your scripts: checked in as scripts/setup-windows-wsl.ps1 and scripts/setup-linux-prereqs.sh. The first commit is your gist unchanged; the next one has the adaptations. The PowerShell script now points to the checked-in Linux script. Running the Linux script as root (the devcontainer case) failed in two places, both fixed. And DOCKER_GID is only suggested for Docker Engine, since Docker Desktop's socket is GID 0 inside containers.

I noticed draft #1415 also adds scripts/setup-linux-prereqs.sh. This PR uses your newer gist version, but if you'd rather land the scripts there, I can drop those commits and keep the guide pointing to them.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Pull requests submitted by external community contributors. topic: dx Dev setup and developer experience type: documentation Documentation additions, corrections, and improvements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write a quick guide to help Windows devs setup their env with WSL

4 participants