Files
openclaw/docs/zh-CN/platforms/windows.md
Josh Palmer 5676a6b38d Docs: normalize zh-CN terminology + tone
What: switch to 你/你的 tone; standardize Skills/Gateway网关/local loopback/私信 wording
Why: align zh-CN docs with issue 6995 feedback + idiomatic tech style
Tests: pnpm docs:build
2026-02-02 16:38:25 +01:00

4.0 KiB
Raw Blame History

read_when, summary, title, x-i18n
read_when summary title x-i18n
在 Windows 上安装 OpenClaw
了解 Windows 伴侣应用的状态
Windows (WSL2) 支持 + 伴侣应用状态 Windows (WSL2)
generated_at model provider source_hash source_path workflow
2026-02-01T21:34:13Z claude-opus-4-5 pi c93d2263b4e5b60cb6fbe9adcb1a0ca95b70cd6feb6e63cfc4459cb18b229da0 platforms/windows.md 15

Windows (WSL2)

推荐通过 WSL2 在 Windows 上使用 OpenClaw建议使用 Ubuntu。CLI + Gateway网关在 Linux 内运行这样可以保持运行时一致性并使工具链兼容性更好Node/Bun/pnpm、Linux 二进制文件、Skills。原生 Windows 可能会更麻烦。WSL2 为你提供完整的 Linux 体验——一条命令即可安装:wsl --install

原生 Windows 伴侣应用已在计划中。

安装WSL2

Gateway网关

Gateway网关服务安装CLI

在 WSL2 内:

openclaw onboard --install-daemon

或:

openclaw gateway install

或:

openclaw configure

出现提示时选择 Gateway网关服务

修复/迁移:

openclaw doctor

进阶:通过局域网暴露 WSL 服务portproxy

WSL 拥有自己的虚拟网络。如果另一台机器需要访问 WSL 内部 运行的服务SSH、本地 TTS 服务器或 Gateway网关你必须将 Windows 端口转发到当前 WSL IP。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 not found." }

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

WSL 重启后刷新 portproxy

netsh interface portproxy delete v4tov4 listenport=$ListenPort listenaddress=0.0.0.0 | Out-Null
netsh interface portproxy add v4tov4 listenport=$ListenPort listenaddress=0.0.0.0 `
  connectaddress=$WslIp connectport=$TargetPort | Out-Null

注意事项:

  • 从另一台机器通过 SSH 连接时,目标是 Windows 主机 IP(例如:ssh user@windows-host -p 2222)。
  • 远程节点必须指向一个可达的 Gateway网关 URL而非 127.0.0.1);使用 openclaw status --all 来确认。
  • 使用 listenaddress=0.0.0.0 进行局域网访问;127.0.0.1 仅限本地访问。
  • 如果你希望自动执行,可以注册一个计划任务,在登录时运行刷新步骤。

分步 WSL2 安装指南

1) 安装 WSL2 + Ubuntu

打开 PowerShell管理员

wsl --install
# 或明确选择一个发行版:
wsl --list --online
wsl --install -d Ubuntu-24.04

如果 Windows 提示,请重启。

2) 启用 systemdGateway网关安装所需

在你的 WSL 终端中:

sudo tee /etc/wsl.conf >/dev/null <<'EOF'
[boot]
systemd=true
EOF

然后在 PowerShell 中:

wsl --shutdown

重新打开 Ubuntu然后验证

systemctl --user status

3) 安装 OpenClaw在 WSL 内)

在 WSL 内按照 Linux 快速开始流程操作:

git clone https://github.com/openclaw/openclaw.git
cd openclaw
pnpm install
pnpm ui:build # 首次运行时自动安装 UI 依赖
pnpm build
openclaw onboard

完整指南:快速开始

Windows 伴侣应用

我们目前还没有 Windows 伴侣应用。如果你希望推动此功能的实现,欢迎贡献代码。