Docs: add WSL2 boot auto-start guide (#31616)

This commit is contained in:
Mark L
2026-03-03 01:07:15 +08:00
committed by GitHub
parent 7a55a3ca07
commit 67b2dde7c5

View File

@@ -55,6 +55,50 @@ Repair/migrate:
openclaw doctor
```
## Gateway auto-start before Windows login
For headless setups, ensure the full boot chain runs even when no one logs into
Windows.
### 1) Keep user services running without login
Inside WSL:
```bash
sudo loginctl enable-linger "$(whoami)"
```
### 2) Install the OpenClaw gateway user service
Inside WSL:
```bash
openclaw gateway install
```
### 3) Start WSL automatically at Windows boot
In PowerShell as Administrator:
```powershell
schtasks /create /tn "WSL Boot" /tr "wsl.exe -d Ubuntu --exec /bin/true" /sc onstart /ru SYSTEM
```
Replace `Ubuntu` with your distro name from:
```powershell
wsl --list --verbose
```
### Verify startup chain
After a reboot (before Windows sign-in), check from WSL:
```bash
systemctl --user is-enabled openclaw-gateway
systemctl --user status openclaw-gateway --no-pager
```
## Advanced: expose WSL services over LAN (portproxy)
WSL has its own virtual network. If another machine needs to reach a service