Documentation Index
Fetch the complete documentation index at: https://mintlify.com/zhcndoc/openclaw/llms.txt
Use this file to discover all available pages before exploring further.
Windows (WSL2)
推荐通过 WSL2(推荐使用 Ubuntu)在 Windows 上运行 OpenClaw。
CLI 和网关运行在 Linux 内部,这既保持了运行时的一致性,也使工具兼容性更好。
原生 Windows 可能会更棘手。WSL2 给你完整的 Linux 体验——只需一条命令安装:wsl --install。
计划推出原生 Windows 伴随应用。
安装 (WSL2)
网关服务安装 (CLI)
在 WSL2 内执行:
openclaw onboard --install-daemon
或者:
或者:
修复/迁移:
网关开机自动启动 (Windows 登录前)
针对无头配置,确保即使无人登录 Windows,整个启动链也能正常运行。
1) 无登录时保持用户服务运行
在 WSL 内执行:
sudo loginctl enable-linger "$(whoami)"
2) 安装 OpenClaw 网关用户服务
3) 在 Windows 启动时自动开始 WSL
以管理员身份打开 PowerShell 执行:
schtasks /create /tn "WSL Boot" /tr "wsl.exe -d Ubuntu --exec /bin/true" /sc onstart /ru SYSTEM
将 Ubuntu 替换成你的发行版名。
验证启动链
重启后,在 WSL 中检查:
systemctl --user is-enabled openclaw-gateway
systemctl --user status openclaw-gateway --no-pager
高级:通过局域网暴露 WSL 服务(端口代理)
WSL 有自己的虚拟网络。如果其他机器需要访问 WSL 内运行的服务,需将 Windows 端口转发到当前 WSL IP。
示例(以管理员身份运行 PowerShell):
$Distro = "Ubuntu-24.04"
$ListenPort = 2222
$TargetPort = 22
$WslIp = (wsl -d $Distro -- hostname -I).Trim().Split(" ")[0]
if (-not $WslIp) { throw "WSL IP 未找到。" }
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=$ListenPort `
connectaddress=$WslIp connectport=$TargetPort
允许此端口通过 Windows 防火墙:
New-NetFirewallRule -DisplayName "WSL SSH $ListenPort" -Direction Inbound `
-Protocol TCP -LocalPort $ListenPort -Action Allow
WSL2 安装分步指南
1) 安装 WSL2 + Ubuntu
以管理员身份打开 PowerShell:
wsl --install
# 或显式选择发行版:
wsl --install -d Ubuntu-24.04
2) 启用 systemd
在 WSL 终端执行:
sudo tee /etc/wsl.conf >/dev/null <<'EOF'
[boot]
systemd=true
EOF
然后在 PowerShell 中执行:
重新打开 Ubuntu,验证:
3) 安装 OpenClaw (WSL 内)
按照 Linux 快速入门流程在 WSL 中执行:
curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard
完整指南见:快速开始
Windows 伴随应用
目前尚无 Windows 伴随应用。如果你有兴趣贡献代码,欢迎参与开发。
相关文档