macOS VM
建議預設(大多數使用者)
Section titled “建議預設(大多數使用者)”- 小型 Linux VPS 適合用於全年運作的 Gateway 和低成本。請參閱 VPS hosting。
- 專屬硬體(Mac mini 或 Linux 主機),如果您想要完全控制權和用於瀏覽器自動化的 住宅 IP。許多網站會阻擋資料中心 IP,因此本機瀏覽通常效果更好。
- 混合模式: 將 Gateway 保留在廉價 VPS 上,並在需要瀏覽器/UI 自動化時將您的 Mac 作為 節點 連接。請參閱 Nodes 和 Gateway remote。
當您特別需要僅限 macOS 的功能(如 iMessage)或想要與您日常使用的 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 環境(您的主機保持乾淨)
- 透過
imsg支援 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 --version2) 建立 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 code):
openclaw channels login8) 以無介面模式執行 VM
Section titled “8) 以無介面模式執行 VM”停止 VM 並在無顯示模式下重新啟動:
lume stop openclawlume run openclaw --no-displayVM 將在背景執行。OpenClaw 的 daemon 會保持閘道運作。
若要檢查狀態:
額外功能:iMessage 整合
Section titled “額外功能:iMessage 整合”這是在 macOS 上執行的絕佳功能。使用 iMessage 搭配 imsg 將 Messages 加入 OpenClaw。
在 VM 內:
- 登入 Messages。
- 安裝
imsg。 - 授予執行 OpenClaw/
imsg的程序「完全磁碟存取權」和「自動化」權限。 - 使用
imsg rpc --help驗證 RPC 支援。
加入您的 OpenClaw 設定:
{ channels: { imessage: { enabled: true, cliPath: "imsg", dbPath: "~/Library/Messages/chat.db", }, },}重新啟動閘道。現在您的 Agent 可以傳送和接收 iMessage。
完整設定細節:iMessage 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 code 無法掃描 | 確保在執行 openclaw channels login 時,您是登入 VM(而非主機) |
- VPS hosting
- Nodes
- Gateway remote
- iMessage 頻道
- Lume 快速開始
- Lume CLI 參考
- 無人值守 VM 設定 (進階)
- Docker 沙箱 (另一種隔離方法)