mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 15:59:30 +00:00
docs(windows): fix WSL gateway-autostart recipe for WSL ≥ 2.6.1.0 idle-termination (#90992)
* docs(windows): fix WSL gateway-autostart recipe for WSL ≥ 2.6.1.0 Replace /bin/true with dbus-launch true to work around the WSL ≥ 2.6.1.0 idle-termination regression (microsoft/WSL #13416): the distro exits 15-20 s after the last wsl.exe client detaches even with loginctl linger and an active user service. dbus-launch true keeps a child-of-init process alive (workaround from microsoft/WSL discussion #9245, validated on WSL 2.7.3.0). Also replace /ru SYSTEM with /ru "$env:USERNAME". Per-user WSL distros (the default setup) are not enumerable by the SYSTEM account — the task runs silently without starting the distro. Running as the installing user account fixes this; Windows prompts for the password at task creation time. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> * docs(windows): add dbus-x11 prerequisite for WSL keepalive dbus-launch is provided by dbus-x11, which is not installed by default on fresh Ubuntu WSL distros. Without it the scheduled task hits command-not-found silently. Add the apt-get install step before the linger and gateway-install steps so the recipe is self-contained. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6451550cd7
commit
95da644f6d
1 changed files with 7 additions and 1 deletions
|
|
@ -186,6 +186,7 @@ into Windows.
|
|||
Inside WSL:
|
||||
|
||||
```bash
|
||||
sudo apt-get install -y dbus-x11
|
||||
sudo loginctl enable-linger "$(whoami)"
|
||||
openclaw gateway install
|
||||
```
|
||||
|
|
@ -193,7 +194,7 @@ openclaw gateway install
|
|||
In PowerShell as Administrator:
|
||||
|
||||
```powershell
|
||||
schtasks /create /tn "WSL Boot" /tr "wsl.exe -d Ubuntu --exec /bin/true" /sc onstart /ru SYSTEM
|
||||
schtasks /create /tn "WSL Boot" /tr "wsl.exe -d Ubuntu --exec dbus-launch true" /sc onstart /ru "$env:USERNAME"
|
||||
```
|
||||
|
||||
Replace `Ubuntu` with your distro name from:
|
||||
|
|
@ -202,6 +203,11 @@ Replace `Ubuntu` with your distro name from:
|
|||
wsl --list --verbose
|
||||
```
|
||||
|
||||
> **Note:** Two changes from older recipes:
|
||||
>
|
||||
> - **`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)).
|
||||
> - **`/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.
|
||||
|
||||
After reboot, verify from WSL:
|
||||
|
||||
```bash
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue