{"id":207,"date":"2026-03-21T22:47:22","date_gmt":"2026-03-21T14:47:22","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/platforms-windows\/"},"modified":"2026-03-21T23:08:54","modified_gmt":"2026-03-21T15:08:54","slug":"platforms-windows","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/platforms-windows\/","title":{"rendered":"Windows\uff08WSL2\uff09"},"content":{"rendered":"<h1>Windows\uff08WSL2\uff09<\/h1>\n<p>\u63a8\u8350\u5728 Windows \u4e0a<strong>\u901a\u8fc7 WSL2<\/strong> \u8fd0\u884c OpenClaw\uff08\u63a8\u8350 Ubuntu\uff09\u3002CLI + Gateway \u7f51\u5173\u5728 Linux \u5185\u8fd0\u884c\uff0c\u8fd9\u80fd\u4fdd\u6301\u8fd0\u884c\u65f6\u4e00\u81f4\uff0c\u5e76\u4f7f<br \/>\n\u5de5\u5177\u94fe\u517c\u5bb9\u6027\u9ad8\u5f97\u591a\uff08Node\/Bun\/pnpm\u3001Linux \u4e8c\u8fdb\u5236\u6587\u4ef6\u3001Skills\uff09\u3002\u539f\u751f<br \/>\nWindows \u53ef\u80fd\u4f1a\u66f4\u68d8\u624b\u3002WSL2 \u53ef\u63d0\u4f9b\u5b8c\u6574\u7684 Linux \u4f53\u9a8c \u2014\u2014 \u53ea\u9700\u4e00\u6761\u547d\u4ee4<br \/>\n\u5373\u53ef\u5b89\u88c5\uff1a<code>wsl --install<\/code>\u3002<\/p>\n<p>\u539f\u751f Windows \u914d\u5957\u5e94\u7528\u5df2\u5728\u89c4\u5212\u4e2d\u3002<\/p>\n<h2>\u5b89\u88c5\uff08WSL2\uff09<\/h2>\n<ul>\n<li><a href=\"\/start\/getting-started\">\u5165\u95e8\u6307\u5357<\/a>\uff08\u8bf7\u5728 WSL \u5185\u4f7f\u7528\uff09<\/li>\n<li><a href=\"\/install\/updating\">\u5b89\u88c5\u4e0e\u66f4\u65b0<\/a><\/li>\n<li>\u5b98\u65b9 WSL2 \u6307\u5357\uff08Microsoft\uff09\uff1a<a href=\"https:\/\/learn.microsoft.com\/windows\/wsl\/install\">https:\/\/learn.microsoft.com\/windows\/wsl\/install<\/a><\/li>\n<\/ul>\n<h2>\u539f\u751f Windows \u72b6\u6001<\/h2>\n<p>\u539f\u751f Windows CLI \u6d41\u7a0b\u6b63\u5728\u6539\u8fdb\uff0c\u4f46 WSL2 \u4ecd\u7136\u662f\u63a8\u8350\u8def\u5f84\u3002<\/p>\n<p>\u5f53\u524d\u5728\u539f\u751f Windows \u4e0a\u8fd0\u884c\u826f\u597d\u7684\u5185\u5bb9\uff1a<\/p>\n<ul>\n<li>\u901a\u8fc7 <code>install.ps1<\/code> \u4f7f\u7528\u7f51\u7ad9\u5b89\u88c5\u5668<\/li>\n<li>\u672c\u5730 CLI \u7528\u6cd5\uff0c\u4f8b\u5982 <code>openclaw --version<\/code>\u3001<code>openclaw doctor<\/code> \u548c <code>openclaw plugins list --json<\/code><\/li>\n<li>\u5d4c\u5165\u5f0f local-agent\/provider \u5192\u70df\u6d4b\u8bd5\uff0c\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n<p>&#8220;`powershell  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw agent &#8211;local &#8211;agent main &#8211;thinking low -m &#8220;Reply with exactly WINDOWS-HATCH-OK.&#8221;<\/p>\n<pre><code>\n\u5f53\u524d\u6ce8\u610f\u4e8b\u9879\uff1a\n\n* \u9664\u975e\u4f60\u4f20\u9012 `--skip-health`\uff0c\u5426\u5219 `openclaw onboard --non-interactive` \u4ecd\u7136\u8981\u6c42\u672c\u5730 Gateway \u7f51\u5173\u53ef\u8bbf\u95ee\n* `openclaw onboard --non-interactive --install-daemon` \u548c `openclaw gateway install` \u4f1a\u4f18\u5148\u5c1d\u8bd5 Windows Scheduled Tasks\n* \u5982\u679c\u62d2\u7edd\u521b\u5efa Scheduled Task\uff0cOpenClaw \u4f1a\u56de\u9000\u5230\u6bcf\u7528\u6237 Startup \u6587\u4ef6\u5939\u767b\u5f55\u9879\uff0c\u5e76\u7acb\u5373\u542f\u52a8 Gateway \u7f51\u5173\n* \u5982\u679c `schtasks` \u672c\u8eab\u5361\u4f4f\u6216\u505c\u6b62\u54cd\u5e94\uff0cOpenClaw \u73b0\u5728\u4f1a\u5feb\u901f\u4e2d\u6b62\u8be5\u8def\u5f84\u5e76\u56de\u9000\uff0c\u800c\u4e0d\u662f\u65e0\u9650\u6302\u8d77\n* \u5728\u53ef\u7528\u65f6\u4ecd\u4f18\u5148\u4f7f\u7528 Scheduled Tasks\uff0c\u56e0\u4e3a\u5b83\u4eec\u80fd\u63d0\u4f9b\u66f4\u597d\u7684 supervisor \u72b6\u6001\n\n\u5982\u679c\u4f60\u53ea\u60f3\u4f7f\u7528\u539f\u751f CLI\uff0c\u800c\u4e0d\u5b89\u88c5 Gateway \u7f51\u5173\u670d\u52a1\uff0c\u53ef\u4f7f\u7528\u4ee5\u4e0b\u4efb\u4e00\u65b9\u5f0f\uff1a\n\n```powershell  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nopenclaw onboard --non-interactive --skip-health\nopenclaw gateway run\n<\/code><\/pre>\n<p>\u5982\u679c\u4f60\u786e\u5b9e\u60f3\u5728\u539f\u751f Windows \u4e0a\u4f7f\u7528\u53d7\u7ba1\u542f\u52a8\uff1a<\/p>\n<p>&#8220;`powershell  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw gateway install<br \/>\nopenclaw gateway status &#8211;json<\/p>\n<pre><code>\n\u5982\u679c\u65e0\u6cd5\u521b\u5efa Scheduled Task\uff0c\u56de\u9000\u670d\u52a1\u6a21\u5f0f\u4ecd\u4f1a\u901a\u8fc7\u5f53\u524d\u7528\u6237\u7684 Startup \u6587\u4ef6\u5939\u5728\u767b\u5f55\u540e\u81ea\u52a8\u542f\u52a8\u3002\n\n## Gateway \u7f51\u5173\n\n* [Gateway \u7f51\u5173\u8fd0\u884c\u624b\u518c](\/gateway)\n* [\u914d\u7f6e](\/gateway\/configuration)\n\n## Gateway \u7f51\u5173\u670d\u52a1\u5b89\u88c5\uff08CLI\uff09\n\n\u5728 WSL2 \u5185\uff1a\n\n<\/code><\/pre>\n<p>openclaw onboard &#8211;install-daemon<\/p>\n<pre><code>\n\u6216\u8005\uff1a\n\n<\/code><\/pre>\n<p>openclaw gateway install<\/p>\n<pre><code>\n\u6216\u8005\uff1a\n\n<\/code><\/pre>\n<p>openclaw configure<\/p>\n<pre><code>\n\u51fa\u73b0\u63d0\u793a\u65f6\uff0c\u9009\u62e9 **Gateway \u670d\u52a1**\u3002\n\n\u4fee\u590d\/\u8fc1\u79fb\uff1a\n\n<\/code><\/pre>\n<p>openclaw doctor<\/p>\n<pre><code>\n## \u5728 Windows \u767b\u5f55\u524d\u81ea\u52a8\u542f\u52a8 Gateway \u7f51\u5173\n\n\u5bf9\u4e8e\u65e0\u5934\u8bbe\u7f6e\uff0c\u8bf7\u786e\u4fdd\u5b8c\u6574\u7684\u542f\u52a8\u94fe\u5373\u4f7f\u5728\u65e0\u4eba\u767b\u5f55\nWindows \u65f6\u4e5f\u80fd\u8fd0\u884c\u3002\n\n### 1\uff09\u5728\u672a\u767b\u5f55\u65f6\u4fdd\u6301\u7528\u6237\u670d\u52a1\u8fd0\u884c\n\n\u5728 WSL \u5185\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nsudo loginctl enable-linger &quot;$(whoami)&quot;\n<\/code><\/pre>\n<h3>2\uff09\u5b89\u88c5 OpenClaw Gateway \u7f51\u5173\u7528\u6237\u670d\u52a1<\/h3>\n<p>\u5728 WSL \u5185\uff1a<\/p>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw gateway install<\/p>\n<pre><code>\n### 3\uff09\u5728 Windows \u542f\u52a8\u65f6\u81ea\u52a8\u542f\u52a8 WSL\n\n\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u6253\u5f00 PowerShell\uff1a\n\n```powershell  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nschtasks \/create \/tn &quot;WSL Boot&quot; \/tr &quot;wsl.exe -d Ubuntu --exec \/bin\/true&quot; \/sc onstart \/ru SYSTEM\n<\/code><\/pre>\n<p>\u5c06 <code>Ubuntu<\/code> \u66ff\u6362\u4e3a\u4ee5\u4e0b\u547d\u4ee4\u8f93\u51fa\u4e2d\u7684\u53d1\u884c\u7248\u540d\u79f0\uff1a<\/p>\n<p>&#8220;`powershell  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nwsl &#8211;list &#8211;verbose<\/p>\n<pre><code>\n### \u9a8c\u8bc1\u542f\u52a8\u94fe\n\n\u91cd\u542f\u540e\uff08\u5728 Windows \u767b\u5f55\u524d\uff09\uff0c\u5728 WSL \u4e2d\u68c0\u67e5\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nsystemctl --user is-enabled openclaw-gateway\nsystemctl --user status openclaw-gateway --no-pager\n<\/code><\/pre>\n<h2>\u9ad8\u7ea7\uff1a\u901a\u8fc7\u5c40\u57df\u7f51\u66b4\u9732 WSL \u670d\u52a1\uff08portproxy\uff09<\/h2>\n<p>WSL \u6709\u81ea\u5df1\u7684\u865a\u62df\u7f51\u7edc\u3002\u5982\u679c\u53e6\u4e00\u53f0\u673a\u5668\u9700\u8981\u8bbf\u95ee<br \/>\n<strong>\u5728 WSL \u5185\u8fd0\u884c<\/strong>\u7684\u670d\u52a1\uff08SSH\u3001\u672c\u5730 TTS \u670d\u52a1\u5668\u6216 Gateway \u7f51\u5173\uff09\uff0c\u4f60\u5fc5\u987b<br \/>\n\u5c06 Windows \u7aef\u53e3\u8f6c\u53d1\u5230\u5f53\u524d\u7684 WSL IP\u3002WSL IP \u4f1a\u5728\u91cd\u542f\u540e\u53d8\u5316\uff0c<br \/>\n\u56e0\u6b64\u4f60\u53ef\u80fd\u9700\u8981\u5237\u65b0\u8f6c\u53d1\u89c4\u5219\u3002<\/p>\n<p>\u793a\u4f8b\uff08<strong>\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd<\/strong>\u6253\u5f00 PowerShell\uff09\uff1a<\/p>\n<p>&#8220;`powershell  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\n$Distro = &#8220;Ubuntu-24.04&#8221;<br \/>\n$ListenPort = 2222<br \/>\n$TargetPort = 22<\/p>\n<p>$WslIp = (wsl -d $Distro &#8212; hostname -I).Trim().Split(&#8221; &#8220;)[0]<br \/>\nif (-not $WslIp) { throw &#8220;WSL IP not found.&#8221; }<\/p>\n<p>netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=$ListenPort `<br \/>\n  connectaddress=$WslIp connectport=$TargetPort<\/p>\n<pre><code>\n\u5141\u8bb8\u8be5\u7aef\u53e3\u901a\u8fc7 Windows \u9632\u706b\u5899\uff08\u4e00\u6b21\u6027\uff09\uff1a\n\n```powershell  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nNew-NetFirewallRule -DisplayName &quot;WSL SSH $ListenPort&quot; -Direction Inbound `\n  -Protocol TCP -LocalPort $ListenPort -Action Allow\n<\/code><\/pre>\n<p>\u5728 WSL \u91cd\u542f\u540e\u5237\u65b0 portproxy\uff1a<\/p>\n<p><code>``powershell  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}<br \/>\nnetsh interface portproxy delete v4tov4 listenport=$ListenPort listenaddress=0.0.0.0 | Out-Null<br \/>\nnetsh interface portproxy add v4tov4 listenport=$ListenPort listenaddress=0.0.0.0<\/code><br \/>\n  connectaddress=$WslIp connectport=$TargetPort | Out-Null<\/p>\n<pre><code>\n\u8bf4\u660e\uff1a\n\n* \u6765\u81ea\u53e6\u4e00\u53f0\u673a\u5668\u7684 SSH \u5e94\u6307\u5411**Windows \u4e3b\u673a IP**\uff08\u4f8b\u5982\uff1a`ssh user@windows-host -p 2222`\uff09\u3002\n* \u8fdc\u7a0b\u8282\u70b9\u5fc5\u987b\u6307\u5411**\u53ef\u8bbf\u95ee\u7684** Gateway \u7f51\u5173 URL\uff08\u800c\u4e0d\u662f `127.0.0.1`\uff09\uff1b\u8bf7\u4f7f\u7528\n  `openclaw status --all` \u8fdb\u884c\u786e\u8ba4\u3002\n* \u4f7f\u7528 `listenaddress=0.0.0.0` \u53ef\u4f9b\u5c40\u57df\u7f51\u8bbf\u95ee\uff1b`127.0.0.1` \u5219\u4ec5\u9650\u672c\u5730\u3002\n* \u5982\u679c\u4f60\u5e0c\u671b\u81ea\u52a8\u6267\u884c\u6b64\u64cd\u4f5c\uff0c\u8bf7\u6ce8\u518c\u4e00\u4e2a Scheduled Task\uff0c\u5728\u767b\u5f55\u65f6\u8fd0\u884c\u5237\u65b0\n  \u6b65\u9aa4\u3002\n\n## \u5206\u6b65 WSL2 \u5b89\u88c5\n\n### 1\uff09\u5b89\u88c5 WSL2 + Ubuntu\n\n\u6253\u5f00 PowerShell\uff08\u7ba1\u7406\u5458\uff09\uff1a\n\n```powershell  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nwsl --install\n# \u6216\u663e\u5f0f\u9009\u62e9\u4e00\u4e2a\u53d1\u884c\u7248\uff1a\nwsl --list --online\nwsl --install -d Ubuntu-24.04\n<\/code><\/pre>\n<p>\u5982\u679c Windows \u63d0\u793a\uff0c\u8bf7\u91cd\u542f\u3002<\/p>\n<h3>2\uff09\u542f\u7528 systemd\uff08Gateway \u7f51\u5173\u5b89\u88c5\u6240\u5fc5\u9700\uff09<\/h3>\n<p>\u5728\u4f60\u7684 WSL \u7ec8\u7aef\u4e2d\uff1a<\/p>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nsudo tee \/etc\/wsl.conf &gt;\/dev\/null &lt;&lt;&#8216;EOF&#8217;<br \/>\n[boot]<br \/>\nsystemd=true<br \/>\nEOF<\/p>\n<pre><code>\n\u7136\u540e\u5728 PowerShell \u4e2d\u8fd0\u884c\uff1a\n\n```powershell  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nwsl --shutdown\n<\/code><\/pre>\n<p>\u91cd\u65b0\u6253\u5f00 Ubuntu\uff0c\u7136\u540e\u9a8c\u8bc1\uff1a<\/p>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nsystemctl &#8211;user status<\/p>\n<pre><code>\n### 3\uff09\u5b89\u88c5 OpenClaw\uff08\u5728 WSL \u5185\uff09\n\n\u5728 WSL \u5185\u6309\u7167 Linux \u5165\u95e8\u6307\u5357\u6d41\u7a0b\u64cd\u4f5c\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\ngit clone https:\/\/github.com\/openclaw\/openclaw.git\ncd openclaw\npnpm install\npnpm ui:build # \u9996\u6b21\u8fd0\u884c\u65f6\u4f1a\u81ea\u52a8\u5b89\u88c5 UI \u4f9d\u8d56\npnpm build\nopenclaw onboard\n<\/code><\/pre>\n<p>\u5b8c\u6574\u6307\u5357\uff1a<a href=\"\/start\/getting-started\">\u5165\u95e8\u6307\u5357<\/a><\/p>\n<h2>Windows \u914d\u5957\u5e94\u7528<\/h2>\n<p>\u6211\u4eec\u8fd8\u6ca1\u6709 Windows \u914d\u5957\u5e94\u7528\u3002\u5982\u679c\u4f60\u60f3\u63a8\u52a8\u8fd9\u4ef6\u4e8b\u53d1\u751f\uff0c\u6b22\u8fce<br \/>\n\u8d21\u732e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows\uff08WSL2\uff09 \u63a8\u8350\u5728 Windows \u4e0a\u901a\u8fc7 WSL2 \u8fd0\u884c OpenClaw\uff08\u63a8\u8350 Ubunt [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-207","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=207"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/207\/revisions"}],"predecessor-version":[{"id":502,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/207\/revisions\/502"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}