Windows (WSL2)

Windows (WSL2)

适用范围

Windows 上的 Moltbot 建议通过 WSL2(Ubuntu)使用。CLI + 网关在 Linux 内运行,这保持运行时一致,并使工具(Node/pnpm、Linux 二进制文件、技能)更加兼容。

原生 Windows 安装未经测试,通常问题更多。

快速路径(WSL2)

  1. 安装 WSL2 + Ubuntu(Microsoft 指南)
  2. 在 WSL 中启用 systemd(服务安装所需)
  3. 在 WSL 内安装并配置
  4. 验证网关健康并打开 UI

分步说明

1) 安装 WSL2 + Ubuntu

在 PowerShell(管理员)中:

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

2) 启用 systemd(必需)

在你的 WSL 终端中:

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

然后回到 PowerShell:

wsl --shutdown

重新打开 Ubuntu 并验证:

systemctl --user status

3) 安装 Moltbot(在 WSL 内)

在 WSL 内使用正常安装流程:

  • 快速入门:/docs/start/getting-started/
  • 安装中心:/docs/install/

4) 安装网关服务并验证

moltbot onboard --install-daemon
moltbot status
moltbot health

高级:通过 LAN 暴露 WSL 服务(portproxy)

WSL 有自己的虚拟网络。如果另一台机器需要到达在 WSL 内运行的服务,请将 Windows 端口转发到当前 WSL IP(重启后会更改)。

示例(以管理员身份运行 PowerShell):

$Distro = "Ubuntu-24.04"
$ListenPort = 18789
$TargetPort = 18789

$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 配套应用;欢迎贡献。

延伸阅读

  • 源路径:platforms/windows.md