Install, repair, and validate DeepScientist on Windows with WSL2 until the Windows browser can open the DeepScientist Web UI. Use when an agent needs to set up or fix DeepScientist on a Windows machine, including WSL distro creation, Linux-side Node/Python prerequisites, Codex auth/relay configuration, WSL proxy troubleshooting, and final `ds doctor` or Web UI verification.
72
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
High
Do not use without reviewing
Copy this to any AI coding agent (Claude Code, Codex, Cursor, etc.) to trigger the install:
Install DeepScientist on this Windows machine using WSL2. Follow the skill at
deepscientist-windows-wsl-setup/SKILL.mdin the DeepScientist repo for the full procedure. Keep going untilds doctorpasses and I can open http://127.0.0.1:20999 in my Windows browser.
wsl -l -vwsl --statusnode, npm, git, uv, codex, and ds already exist inside the target distro.docker-desktop or converting an unrelated user distro unless the user asks for that explicitly.codex exec --skip-git-repo-check "Print exactly OK and exit." succeeds.ds doctor reports [ok] Codex CLI (or [warn] Codex CLI: Codex startup probe completed.).ds starts and Windows can open http://127.0.0.1:20999.Some steps require the human to act. The agent cannot do these:
| When | What the human must do |
|---|---|
| WSL cannot start (HCS_E_CONNECTION_TIMEOUT) | Reboot the PC. Pending Windows updates or long uptimes cause Hyper-V VM creation to fail. |
| Proxy listens only on 127.0.0.1 | Open the proxy app (Clash, v2rayN, etc.) and enable Allow LAN so it listens on 0.0.0.0. |
| No valid OpenAI auth | Either (a) run codex login in a GUI terminal, or (b) provide an API key or relay config. |
| ChatGPT subscription expired | Renew subscription, or provide a third-party API relay endpoint and key. |
| Firewall blocks WSL networking | Temporarily allow WSL/Hyper-V through Windows Firewall. |
If wsl -d <distro> -- echo hello fails with HCS_E_CONNECTION_TIMEOUT:
HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager for PendingFileRenameOperations.(Get-CimInstance Win32_OperatingSystem).LastBootUpTime. If > 7 days, suggest reboot.wsl --shutdown then retry. If it still fails, a reboot is required.If free memory < 2 GB, warn the user. WSL2 VM needs at least 1 GB to start reliably. Check with:
$mem = Get-CimInstance Win32_OperatingSystem
[math]::Round($mem.FreePhysicalMemory/1MB,2)DeepScientist.ds and make it the default user for that distro.npm, codex, or other binaries:printf '[interop]\nappendWindowsPath=false\n' | sudo tee /etc/wsl.conf/etc/wsl.conf with wsl --terminate <distro>.command -v node does NOT resolve to /mnt/c/....Install the Linux-side dependencies inside the target distro. Prefer native Linux binaries over Windows binaries mounted under /mnt/c or other drives.
Required baseline (adapt the python3-venv package name to the distro version):
sudo apt-get update
# Ubuntu 24.04:
sudo apt-get install -y ca-certificates curl gnupg git sudo build-essential python3-venv python3-pip
# Ubuntu 22.04:
sudo apt-get install -y ca-certificates curl gnupg git sudo build-essential python3.10-venv python3-pipInstall Node.js 20 unless the official guide says otherwise:
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
printf 'deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main\n' | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install -y nodejsSet a user-local npm prefix so global packages do not require sudo:
mkdir -p "$HOME/.npm-global" "$HOME/.local/bin"
npm config set prefix "$HOME/.npm-global"Add to both ~/.bashrc and ~/.profile:
export PATH="$HOME/.npm-global/bin:$HOME/.local/bin:$PATH"uv.Typical pattern:
npm install -g @researai/deepscientist
npm install -g @openai/codex@0.57.0
curl -LsSf https://github.com/astral-sh/uv/releases/latest/download/uv-installer.sh | shAfter installation, verify Linux-side resolution:
command -v ds
command -v codex
command -v uvAll three must resolve to Linux paths (under $HOME/.npm-global/bin or $HOME/.local/bin), NOT under /mnt/c/.
If WSL cannot complete browser-based Codex login, reuse the Windows-side auth file:
C:\Users\<user>\.codex\auth.json.~/.codex/auth.json.chmod 600 ~/.codex/auth.json.Caveat: If the ChatGPT subscription is expired, auth will copy successfully but codex exec will fail with model errors. Check chatgpt_subscription_active_until in the JWT token.
Many users in China use third-party API relay services instead of direct OpenAI access. If the user provides a relay endpoint and API key, configure:
~/.codex/config.toml:
model_provider = "OpenAI"
model = "<model-from-relay>"
review_model = "<model-from-relay>"
model_reasoning_effort = "high"
disable_response_storage = true
network_access = "enabled"
windows_wsl_setup_acknowledged = true
model_context_window = 1000000
model_auto_compact_token_limit = 900000
[model_providers.OpenAI]
name = "OpenAI"
base_url = "<relay-base-url>"
wire_api = "responses"
supports_websockets = true
requires_openai_auth = true
[features]
responses_websockets_v2 = true~/.codex/auth.json:
{
"OPENAI_API_KEY": "<relay-api-key>"
}Known gotcha: Codex 0.57.0 does not accept model_reasoning_effort = "xhigh". Valid values are: minimal, low, medium, high. If the relay template says xhigh, change it to high.
If the user has a platform.openai.com API key:
~/.codex/auth.json:
{
"OPENAI_API_KEY": "sk-..."
}No config.toml changes needed for the base URL in this case.
First determine whether the user is using a Windows-side local proxy at all. Do not assume every machine needs proxy handling.
Quick connectivity test (run this early to decide if proxy is needed):
curl -s --max-time 10 -o /dev/null -w '%{http_code}' https://chatgpt.com/
curl -s --max-time 10 -o /dev/null -w '%{http_code}' https://github.com/If both return 200 or 3xx, proxy may not be needed. If chatgpt.com returns 000 (timeout/reset), proxy is almost certainly needed (common in China).
7890, 1080, 10808, 10809, and 20170, but users often customize them.127.0.0.1.ip route inside Linux over /etc/resolv.conf nameserver.Use the bundled helper script for the Windows-side inspection:
pwsh -File scripts/find-wsl-proxy.ps1If the user already told you the port, pass it explicitly:
pwsh -File scripts/find-wsl-proxy.ps1 -Ports 7890When running WSL commands from Windows (via wsl -d Ubuntu -- bash -c "..."), bash variable $ signs get consumed by the calling shell. Two reliable workarounds:
wsl -d Ubuntu -- bash /mnt/c/Users/<user>/AppData/Local/Temp/script.shwsl.exe -d Ubuntu -- bash /path/to/script.sh and execute it via powershell.exe -ExecutionPolicy Bypass -File script.ps1The PowerShell wrapper approach is the most reliable for avoiding escaping issues.
Only after the proxy port is confirmed:
cat > "$HOME/.wsl-proxy-env" <<'EOF'
host_ip="$(ip route 2>/dev/null | awk '/^default/ { print $3; exit }')"
proxy_port="<confirmed-port>"
if [ -n "$host_ip" ]; then
export http_proxy="http://$host_ip:$proxy_port"
export https_proxy="http://$host_ip:$proxy_port"
export HTTP_PROXY="$http_proxy"
export HTTPS_PROXY="$https_proxy"
export ALL_PROXY="$http_proxy"
fi
EOFThen source that file from both ~/.profile and ~/.bashrc:
echo '[ -f "$HOME/.wsl-proxy-env" ] && source "$HOME/.wsl-proxy-env"' >> ~/.bashrc
echo '[ -f "$HOME/.wsl-proxy-env" ] && source "$HOME/.wsl-proxy-env"' >> ~/.profileIgnore the generic WSL warning about localhost proxy mirroring if:
codex exec and ds doctor both pass.Run validation in this order:
whoami
command -v node npm git ds codex uvcd /tmp
codex exec --skip-git-repo-check "Print exactly OK and exit."ds doctords doctor warns about it:git config --global user.name "Your Name"
git config --global user.email "you@example.com"dshttp://127.0.0.1:20999Important: When starting ds from an agent, the process must outlive the agent's shell. Either:
Start-Process wsl.exe -ArgumentList '-d','Ubuntu','--','bash','-lc','ds'wsl shows a target distro as version 1, do not install into it until WSL2 is available or a new WSL2 distro is created.command -v ds or command -v codex resolves under /mnt/c, fix PATH and disable Windows PATH injection before continuing./etc/wsl.conf, you must wsl --terminate <distro> for changes to take effect.model is not supported when using Codex with a ChatGPT account: ChatGPT subscription expired or model not available on the plan. Switch to API relay.unknown variant xhigh: Codex 0.57.0 only supports minimal, low, medium, high. Change to high.Reconnecting... 5/5 then failure: usually a network issue. Check proxy first, then auth.codex exec fails with TLS resets or websocket resets, suspect proxy reachability before suspecting auth.ds doctor still says Codex startup probe failed, re-test network reachability to chatgpt.com and the proxy endpoint.python3.10-venv does not exist on Ubuntu 24.04. Use python3-venv instead. Always check lsb_release -r first.ds doctor run may take 10+ minutes as it downloads and installs the Python runtime via uv.ds says Codex is not marked ready yet. Running startup probe.., treat that as a normal transitional state until proven otherwise.Create a .bat file on the Desktop for the user to launch DS easily:
@echo off
start wsl.exe -d Ubuntu -- bash -lc "ds; exec bash"
timeout /t 5 /nobreak >nul
start "" "http://127.0.0.1:20999"b366244
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.