OpenClaw on macOS VMs(Sandboxing)
推荐默认方案(多数用户)
- 小型 Linux VPS:常驻 Gateway、成本低。见 VPS hosting。
- 专用硬件(Mac mini 或 Linux 盒子):若你需要完整控制权,且希望浏览器自动化使用住宅 IP。很多网站会屏蔽机房 IP,本地浏览更稳定。
- 混合方案: Gateway 放在便宜 VPS,需要浏览器/UI 自动化时让 Mac 作为 node 连接。见 Nodes 与 Gateway remote。
macOS VM 选项
在 Apple Silicon Mac 上的本地 VM(Lume)
用 Lume 在 Apple Silicon Mac 上运行沙盒化 macOS VM。 你将获得:- 完整隔离的 macOS 环境(宿主机保持干净)
- 通过 BlueBubbles 支持 iMessage(Linux/Windows 无法实现)
- 通过克隆快速重置 VM
- 无需额外硬件或云成本
托管 Mac 提供商(云)
若你想在云上运行 macOS,可选择托管 Mac:- MacStadium(托管 Mac)
- 其它托管 Mac 供应商也可用;遵循其 VM + SSH 文档
快速路径(Lume,熟练用户)
- 安装 Lume
lume create openclaw --os macos --ipsw latest- 完成 Setup Assistant,启用 Remote Login(SSH)
lume run openclaw --no-display- SSH 进入,安装 OpenClaw,配置频道
- 完成
你需要什么(Lume)
- Apple Silicon Mac(M1/M2/M3/M4)
- 宿主机 macOS Sequoia 或更高版本
- 每个 VM 约 60 GB 可用磁盘
- ~20 分钟
1) 安装 Lume
~/.local/bin 不在 PATH:
2) 创建 macOS VM
3) 完成 Setup Assistant
在 VNC 窗口中:- 选择语言与区域
- 跳过 Apple ID(若后续需要 iMessage 可登录)
- 创建用户账号(记住用户名/密码)
- 跳过所有可选功能
- 打开 System Settings → General → Sharing
- 启用 “Remote Login”
4) 获取 VM 的 IP
192.168.64.x)。
5) SSH 进入 VM
youruser 替换为你创建的账号,IP 替换为 VM IP。
6) 安装 OpenClaw
在 VM 内:7) 配置频道
编辑配置文件:8) 无界面运行 VM
先停止 VM,然后无显示重启:Bonus:iMessage 集成
这是在 macOS 上运行的杀手级功能。使用 BlueBubbles 为 OpenClaw 添加 iMessage。 在 VM 内:- 从 bluebubbles.app 下载 BlueBubbles
- 使用 Apple ID 登录
- 启用 Web API 并设置密码
- 将 BlueBubbles webhook 指向 gateway(示例:
https://your-gateway-host:3000/bluebubbles-webhook?password=<password>)
保存黄金镜像
在进一步自定义前,先做干净快照:24/7 运行
保持 VM 常驻:- Mac 保持接电
- 在 System Settings → Energy Saver 中禁用睡眠
- 필요时使用
caffeinate
Troubleshooting
| Problem | Solution |
|---|---|
| 无法 SSH 进入 VM | 确认 VM 的 System Settings 中启用了 “Remote Login” |
| VM IP 未显示 | 等 VM 完全启动后再运行 lume get openclaw |
| 找不到 lume 命令 | 将 ~/.local/bin 加入 PATH |
| WhatsApp QR 无法扫码 | 运行 openclaw channels login 时确保在 VM 内登录(不是宿主机) |