macOS VM
在 macOS VM 上執行 OpenClaw(沙盒化)
Section titled “在 macOS VM 上執行 OpenClaw(沙盒化)”推薦預設選項(適合大多數使用者)
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 中執行 OpenClaw。
這為您提供:
- 完全隔離的 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 openclaw --os macos --ipsw latest- 完成設定助理,啟用遠端登入 (SSH)
lume run openclaw --no-display- SSH 登入,安裝 OpenClaw,設定頻道
- 完成
您需要的項目 (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 openclaw --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 openclaw尋找 IP 位址(通常是 192.168.64.x)。
5) SSH 進入 VM
Section titled “5) SSH 進入 VM”將 youruser 替換為您建立的帳號,並將 IP 替換為您 VM 的 IP。
6) 安裝 OpenClaw
Section titled “6) 安裝 OpenClaw”在 VM 內部:
npm install -g openclaw@latestopenclaw onboard --install-daemon依照上架提示設定您的模型提供者(Anthropic、OpenAI 等)。
7) 設定頻道
Section titled “7) 設定頻道”編輯配置檔案:
nano ~/.openclaw/openclaw.json新增您的頻道:
{ "channels": { "whatsapp": { "dmPolicy": "allowlist", "allowFrom": ["+15551234567"] }, "telegram": { "botToken": "YOUR_BOT_TOKEN" } }}然後登入 WhatsApp(掃描 QR 碼):
openclaw channels login8) 無介面執行 VM
Section titled “8) 無介面執行 VM”停止 VM 並在不顯示畫面的情況下重新啟動:
lume stop openclawlume run openclaw --no-displayVM 會在背景執行。OpenClaw 的守護程序會保持閘道執行。
檢查狀態:
額外功能:iMessage 整合
Section titled “額外功能:iMessage 整合”這是在 macOS 上執行的殺手級功能。使用 BlueBubbles 將 iMessage 新增至 OpenClaw。
在 VM 內部:
- 從 bluebubbles.app 下載 BlueBubbles
- 使用您的 Apple ID 登入
- 啟用 Web API 並設定密碼
- 將 BlueBubbles webhooks 指向您的閘道(例如:
https://your-gateway-host:3000/bluebubbles-webhook?password=<password>)
新增至您的 OpenClaw 配置:
{ "channels": { "bluebubbles": { "serverUrl": "http://localhost:1234", "password": "your-api-password", "webhookPath": "/bluebubbles-webhook" } }}重新啟動閘道。現在您的 Agent 可以傳送和接收 iMessages。
完整設定詳情:BlueBubbles channel
儲存黃金映像
Section titled “儲存黃金映像”在進一步客製化之前,對您的乾淨狀態進行快照:
lume stop openclawlume clone openclaw openclaw-golden隨時重置:
lume stop openclaw && lume delete openclawlume clone openclaw-golden openclawlume run openclaw --no-display24/7 執行
Section titled “24/7 執行”透過以下方式讓 VM 保持執行:
- 讓您的 Mac 保持插電
- 在系統設定 → 省電中關閉睡眠
- 如有需要,使用
caffeinate
若要真正實現隨時運作,請考慮使用專用的 Mac mini 或小型 VPS。請參閱 VPS hosting。
| 問題 | 解決方案 |
|---|---|
| 無法 SSH 進入 VM | 檢查 VM 的系統設定中是否已啟用「遠端登入」 |
| VM IP 未顯示 | 等待 VM 完全開機,再次執行 lume get openclaw |
| 找不到 Lume 指令 | 將 ~/.local/bin 加入您的 PATH |
| WhatsApp QR 無法掃描 | 確保您在執行 openclaw channels login 時已登入 VM(而非主機) |
- VPS hosting
- 節點
- 遠端閘道
- BlueBubbles 頻道
- Lume 快速開始
- Lume CLI 參考
- 無人值守 VM 設定 (進階)
- Docker 沙箱隔離 (替代隔離方案)