docs(windows): fix WSL gateway-autostart recipe for WSL ≥ 2.6.1.0 idl… · openclaw/openclaw@95da644
spencer2211
·
2026-06-16
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -186,14 +186,15 @@ into Windows.
|
186 | 186 | Inside WSL: |
187 | 187 | |
188 | 188 | ```bash |
| 189 | +sudo apt-get install -y dbus-x11 |
189 | 190 | sudo loginctl enable-linger "$(whoami)" |
190 | 191 | openclaw gateway install |
191 | 192 | ``` |
192 | 193 | |
193 | 194 | In PowerShell as Administrator: |
194 | 195 | |
195 | 196 | ```powershell |
196 | | -schtasks /create /tn "WSL Boot" /tr "wsl.exe -d Ubuntu --exec /bin/true" /sc onstart /ru SYSTEM |
| 197 | +schtasks /create /tn "WSL Boot" /tr "wsl.exe -d Ubuntu --exec dbus-launch true" /sc onstart /ru "$env:USERNAME" |
197 | 198 | ``` |
198 | 199 | |
199 | 200 | Replace `Ubuntu` with your distro name from: |
@@ -202,6 +203,11 @@ Replace `Ubuntu` with your distro name from:
|
202 | 203 | wsl --list --verbose |
203 | 204 | ``` |
204 | 205 | |
| 206 | +> **Note:** Two changes from older recipes: |
| 207 | +> |
| 208 | +> - **`dbus-launch true` instead of `/bin/true`** — On WSL ≥ 2.6.1.0 a regression ([microsoft/WSL #13416](https://github.com/microsoft/WSL/issues/13416)) causes the distro to idle-terminate 15–20 seconds after the last client exits, even with linger enabled. `dbus-launch true` keeps a child-of-init process alive as a workaround ([community discussion, microsoft/WSL #9245](https://github.com/microsoft/WSL/discussions/9245)). |
| 209 | +> - **`/ru "$env:USERNAME"` instead of `/ru SYSTEM`** — Per-user WSL distros (the default setup) are not visible to the SYSTEM account; the task appears to run but the distro is never started. Running as your own account avoids this. Windows will prompt for your password when the task is created. |
| 210 | + |
205 | 211 | After reboot, verify from WSL: |
206 | 212 | |
207 | 213 | ```bash |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。