{“content”:”---\nname: chrome-remote-desktop-headless-setup\ndescription: 在 Windows PC 上通过 SSH 命令行完成 Chrome Remote Desktop host 绑定,无需物理接触 PC\ntriggers:\n - chrome remote desktop headless setup\n - crd oauth windows\n - remotedesktop.google.com/headless\n---\n\n# Chrome Remote Desktop Headless Setup (Windows)\n\n## 目标\n在 Windows PC 上通过 SSH 命令行完成 CRD host 绑定,无需物理接触 PC。\n\n## 前置条件\n- PC 上 CRD host 已安装(chromoting 服务在运行)\n- PC Chrome 已登录 Google 账号\n- 知道 PC 的 SSH 访问方式\n\n## 步骤\n\n### 1. 在 PC Chrome 访问\n\nhttps://remotedesktop.google.com/headless\n\n登录 [email protected],页面会生成一段命令,格式如:\n\nDISPLAY= /opt/google/chrome-remote-desktop/start-host --code=\"...\" --redirect-url=\"https://remotedesktop.google.com/_/chrome_remote_desktop/frame/authverify\" ...\n\n\n### 2. 提取关键参数\n从页面命令中提取:\n- --code= 后面的值(一次性 auth code)\n- --redirect-url= 的值\n\n### 3. 在 PC 上执行(通过 SSH)\npowershell\n\"C:\\Program Files (x86)\\Google\\Chrome Remote Desktop\\148.0.7778.23\\remoting_start_host.exe\" --code=\"<auth_code>\" --redirect-url=\"https://remotedesktop.google.com/_/chrome_remote_desktop/frame/authverify\" --pin=<6位PIN> --display-name=\"Sozo-PC\"\n\n\n### 4. 验证\n访问 https://remotedesktop.google.com/access 应该能看到 PC 列表。\n\n## 常见坑\n\n| 问题 | 原因 | 解决 |\n|------|------|------|\n| 页面显示 Linux wget/apt 指令 | 访问的是 Linux 机器的 headless 页面 | 换 Windows Chrome 访问 |\n| remoting_start_host.exe 找不到 | 版本号不同 | 先 Get-ChildItem 找到实际路径 |\n| --code 已过期 | auth code 只能一次性,几秒内有效 | 重新刷新页面获取新 code |\n| 服务在跑但 host.json 不存在 | 未完成 OAuth 绑定 | 需要完成 --code 流程 |\n\n## CRD 服务管理命令(Windows)\npowershell\n# 查看服务状态\nGet-Service chromoting\n\n# 重启服务\nRestart-Service chromoting\n\n# 查看日志\nGet-Content \"C:\\Program Files (x86)\\Google\\Chrome Remote Desktop\\148.0.7778.23\\debug.log\"\n\n\n## 重要区分\n- remotedesktop.google.com/headless → 设置 host(需要 --code 流程)\n- remotedesktop.google.com/access/session/xxx → 临时支持会话(一次性,不可用于永久控制)\n\n## 验证:host.json 存在 = 绑定成功\npowershell\nTest-Path \"C:\\Program Files (x86)\\Google\\Chrome Remote Desktop\\host\\host.json\"\n\n返回 True 表示已完成 OAuth 绑定。\n”}