macOS 虚拟机
在 macOS 虚拟机上运行 CoderClaw(沙箱隔离)
Section titled “在 macOS 虚拟机上运行 CoderClaw(沙箱隔离)”推荐默认方案(大多数用户)
Section titled “推荐默认方案(大多数用户)”- 小型 Linux VPS 用于永久在线的 Gateway 网关,成本低。参见 VPS 托管。
- 专用硬件(Mac mini 或 Linux 机器)如果你想要完全控制和住宅 IP 用于浏览器自动化。许多网站会屏蔽数据中心 IP,所以本地浏览通常效果更好。
- 混合方案: 将 Gateway 网关保持在廉价 VPS 上,当你需要浏览器/UI 自动化时,将你的 Mac 作为节点连接。参见节点和 Gateway 网关远程。
当你特别需要 macOS 独有功能(iMessage/BlueBubbles)或想要与日常 Mac 严格隔离时,使用 macOS VM。
macOS VM 选项
Section titled “macOS VM 选项”在你的 Apple Silicon Mac 上运行本地 VM(Lume)
Section titled “在你的 Apple Silicon Mac 上运行本地 VM(Lume)”使用 Lume 在你现有的 Apple Silicon Mac 上的沙箱 macOS VM 中运行 CoderClaw。
这为你提供:
- 隔离的完整 macOS 环境(你的主机保持干净)
- 通过 BlueBubbles 支持 iMessage(在 Linux/Windows 上不可能)
- 通过克隆 VM 即时重置
- 无需额外硬件或云成本
托管 Mac 提供商(云)
Section titled “托管 Mac 提供商(云)”如果你想要云端的 macOS,托管 Mac 提供商也可以:
- MacStadium(托管 Mac)
- 其他托管 Mac 供应商也可以;按照他们的 VM + SSH 文档操作
一旦你有了 macOS VM 的 SSH 访问权限,继续下面的步骤 6。
快速路径(Lume,有经验的用户)
Section titled “快速路径(Lume,有经验的用户)”- 安装 Lume
lume create coderclaw --os macos --ipsw latest- 完成设置助手,启用远程登录(SSH)
lume run coderclaw --no-display- SSH 进入,安装 CoderClaw,配置渠道
- 完成
你需要什么(Lume)
Section titled “你需要什么(Lume)”- Apple Silicon Mac(M1/M2/M3/M4)
- 主机上安装 macOS Sequoia 或更高版本
- 每个 VM 约 60 GB 可用磁盘空间
- 约 20 分钟
1) 安装 Lume
Section titled “1) 安装 Lume”/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"如果 ~/.local/bin 不在你的 PATH 中:
echo 'export PATH="$PATH:$HOME/.local/bin"' >> ~/.zshrc && source ~/.zshrc验证:
lume --version文档:Lume 安装
2) 创建 macOS VM
Section titled “2) 创建 macOS VM”lume create coderclaw --os macos --ipsw latest这会下载 macOS 并创建 VM。VNC 窗口会自动打开。
注意:下载可能需要一段时间,取决于你的网络连接。
3) 完成设置助手
Section titled “3) 完成设置助手”在 VNC 窗口中:
- 选择语言和地区
- 跳过 Apple ID(或者如果你以后想要 iMessage 就登录)
- 创建用户账户(记住用户名和密码)
- 跳过所有可选功能
设置完成后,启用 SSH:
- 打开系统设置 → 通用 → 共享
- 启用”远程登录”
4) 获取 VM 的 IP 地址
Section titled “4) 获取 VM 的 IP 地址”lume get coderclaw查找 IP 地址(通常是 192.168.64.x)。
5) SSH 进入 VM
Section titled “5) SSH 进入 VM”将 youruser 替换为你创建的账户,IP 替换为你 VM 的 IP。
6) 安装 CoderClaw
Section titled “6) 安装 CoderClaw”在 VM 内:
npm install -g coderclaw@latestcoderclaw onboard --install-daemon按照新手引导提示设置你的模型提供商(Anthropic、OpenAI 等)。
7) 配置渠道
Section titled “7) 配置渠道”编辑配置文件:
nano ~/.coderclaw/coderclaw.json添加你的渠道:
{ "channels": { "whatsapp": { "dmPolicy": "allowlist", "allowFrom": ["+15551234567"] }, "telegram": { "botToken": "YOUR_BOT_TOKEN" } }}然后登录 WhatsApp(扫描二维码):
coderclaw channels login8) 无头运行 VM
Section titled “8) 无头运行 VM”停止 VM 并在无显示器模式下重启:
lume stop coderclawlume run coderclaw --no-displayVM 在后台运行。CoderClaw 的守护进程保持 Gateway 网关运行。
检查状态:
额外:iMessage 集成
Section titled “额外:iMessage 集成”这是在 macOS 上运行的杀手级功能。使用 BlueBubbles 将 iMessage 添加到 CoderClaw。
在 VM 内:
- 从 bluebubbles.app 下载 BlueBubbles
- 用你的 Apple ID 登录
- 启用 Web API 并设置密码
- 将 BlueBubbles webhooks 指向你的 Gateway 网关(示例:
https://your-gateway-host:3000/bluebubbles-webhook?password=<password>)
添加到你的 CoderClaw 配置:
{ "channels": { "bluebubbles": { "serverUrl": "http://localhost:1234", "password": "your-api-password", "webhookPath": "/bluebubbles-webhook" } }}重启 Gateway 网关。现在你的智能体可以发送和接收 iMessage 了。
完整设置详情:BlueBubbles 渠道
保存黄金镜像
Section titled “保存黄金镜像”在进一步自定义之前,快照你的干净状态:
lume stop coderclawlume clone coderclaw coderclaw-golden随时重置:
lume stop coderclaw && lume delete coderclawlume clone coderclaw-golden coderclawlume run coderclaw --no-display24/7 运行
Section titled “24/7 运行”通过以下方式保持 VM 运行:
- 保持你的 Mac 插电
- 在系统设置 → 节能中禁用睡眠
- 如需要使用
caffeinate
对于真正的永久在线,考虑专用 Mac mini 或小型 VPS。参见 VPS 托管。
| 问题 | 解决方案 |
|---|---|
| 无法 SSH 进入 VM | 检查 VM 的系统设置中是否启用了”远程登录” |
| VM IP 未显示 | 等待 VM 完全启动,再次运行 lume get coderclaw |
| 找不到 Lume 命令 | 将 ~/.local/bin 添加到你的 PATH |
| WhatsApp 二维码扫描失败 | 确保运行 coderclaw channels login 时你是登录到 VM(而不是主机) |
- VPS 托管
- 节点
- Gateway 网关远程
- BlueBubbles 渠道
- Lume 快速入门
- Lume CLI 参考
- 无人值守 VM 设置(高级)
- Docker 沙箱隔离(替代隔离方案)