How to Run OpenClaw in a Sandboxed macOS VM
I hate it when a new project clutters my main machine with dependencies and configuration files. Sometimes you just want a clean environment where you can test things, break them, and reset everything in seconds without worrying about your host system.
If you want to keep your host clean or specifically need macOS-only features like iMessage, running OpenClaw in a VM is the way to go. I recommend this approach if you want strict isolation or need to use BlueBubbles for iMessage automation.
What You’ll Need
Section titled “What You’ll Need”- Apple Silicon Mac (M1/M2/M3/M4)
- macOS Sequoia or later on the host
- ~60 GB free disk space per VM
- ~20 minutes
Quick Start
Section titled “Quick Start”- Install Lume.
- Run
lume create openclaw --os macos --ipsw latest. - Complete the Setup Assistant and enable Remote Login (SSH).
- Run
lume run openclaw --no-display. - SSH in, install OpenClaw, and configure your channels.
1. Install Lume
Section titled “1. Install Lume”First, get Lume installed on your host Mac:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trycua/cua/main/libs/lume/scripts/install.sh)"If ~/.local/bin isn’t in your PATH, run this:
echo 'export PATH="$PATH:$HOME/.local/bin"' >> ~/.zshrc && source ~/.zshrcVerify it works:
lume --version2. Create the macOS VM
Section titled “2. Create the macOS VM”This command downloads macOS and sets up the environment. A VNC window will open automatically.
lume create openclaw --os macos --ipsw latest3. Complete Setup Assistant
Section titled “3. Complete Setup Assistant”In the VNC window that popped up:
- Select your language and region.
- Skip Apple ID (unless you need iMessage right away).
- Create your user account.
- Skip the optional features to speed things up.
Once you hit the desktop, enable SSH so you can manage it from your terminal:
- Open System Settings → General → Sharing.
- Turn on Remote Login.
4. Get the VM’s IP and SSH in
Section titled “4. Get the VM’s IP and SSH in”Back on your host terminal, find the VM’s IP:
lume get openclawLook for an IP like 192.168.64.x. Now, SSH into the VM:
ssh youruser@192.168.64.X5. Install OpenClaw
Section titled “5. Install OpenClaw”Now that you are inside the VM, install the OpenClaw CLI and start the onboarding process:
npm install -g openclaw@latestopenclaw onboard --install-daemonFollow the prompts to connect your model provider (like OpenAI or Anthropic).
6. Configure Channels
Section titled “6. Configure Channels”Open your config file:
nano ~/.openclaw/openclaw.jsonAdd your channel settings. For example, to use WhatsApp and Telegram:
{ "channels": { "whatsapp": { "dmPolicy": "allowlist", "allowFrom": ["+15551234567"] }, "telegram": { "botToken": "YOUR_BOT_TOKEN" } }}Then log in to WhatsApp by scanning the QR code:
openclaw channels login7. Run the VM Headlessly
Section titled “7. Run the VM Headlessly”You don’t need the VNC window open all the time. Stop the VM and restart it in the background:
lume stop openclawlume run openclaw --no-displayYou can check if things are running fine via SSH:
ssh youruser@192.168.64.X "openclaw status"Bonus: iMessage Integration
Section titled “Bonus: iMessage Integration”This is the killer feature of using a macOS VM. You can use BlueBubbles to bring iMessage to OpenClaw.
Inside the VM:
- Install BlueBubbles and sign in with your Apple ID.
- Enable the Web API and set a password.
- Point webhooks at your gateway:
https://your-gateway-host:3000/bluebubbles-webhook?password=<password>.
Add this to your openclaw.json:
{ "channels": { "bluebubbles": { "serverUrl": "http://localhost:1234", "password": "your-api-password", "webhookPath": "/bluebubbles-webhook" } }}Save a Golden Image
Section titled “Save a Golden Image”I recommend saving a clean state of your VM so you can reset it instantly if something goes wrong:
lume stop openclawlume clone openclaw openclaw-goldenIf you need to reset:
lume stop openclaw && lume delete openclawlume clone openclaw-golden openclawlume run openclaw --no-displayTroubleshooting
Section titled “Troubleshooting”| Problem | Solution |
|---|---|
| Can’t SSH into VM | Check “Remote Login” is enabled in VM’s System Settings |
| VM IP not showing | Wait for VM to fully boot, run lume get openclaw again |
| Lume command not found | Add ~/.local/bin to your PATH |
| WhatsApp QR not scanning | Ensure you’re logged into the VM (not host) when running openclaw channels login |
Need more help? Check out the AI Setup Assistant.
What’s Next
Section titled “What’s Next”OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.