Skip to content

Instantly share code, notes, and snippets.

@theronic
Last active February 9, 2026 09:35
Show Gist options
  • Select an option

  • Save theronic/ff7e91b02029a712717653cb687d89d9 to your computer and use it in GitHub Desktop.

Select an option

Save theronic/ff7e91b02029a712717653cb687d89d9 to your computer and use it in GitHub Desktop.
OpenClaw Vagrantfile (please comment on issues and I'll fix)
vm_name = File.basename(Dir.getwd)
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-24.04"
# Sync Documents folder to /agent-workspace
config.vm.synced_folder "~/Documents/agent-workspace", "/agent-workspace", type: "virtualbox"
config.vm.provision "file", source: "~/.claude.json", destination: "/home/vagrant/.claude.json"
config.vm.provision "file", source: "~/.config/gh", destination: "/home/vagrant/.config/gh"
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.cpus = 2
vb.gui = false
vb.name = vm_name
# Fix for VirtualBox 7.2.4 CPU regression
vb.customize ["modifyvm", :id, "--audio", "none"]
vb.customize ["modifyvm", :id, "--usb", "off"]
end
# for Openclaw config link
config.vm.network "forwarded_port", guest: 18789, host: 18789
# System-level provisioning (runs as root)
config.vm.provision "shell", inline: <<-SHELL
export DEBIAN_FRONTEND=noninteractive
# Install dependencies
apt-get update
apt-get install -y docker.io git unzip curl ca-certificates gnupg fish tmux neovim
# Install GitHub CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
apt-get update
apt-get install -y gh
# Install Node.js 22 LTS via NodeSource (supports import attributes)
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
apt-get update
apt-get install -y nodejs
# Install pnpm, Claude Code, and OpenClaw globally
npm install -g pnpm @anthropic-ai/claude-code openclaw@latest --no-audit
npx @realmikekelly/claude-sneakpeek quick --name claudesp
usermod -aG docker vagrant
SHELL
# User-level provisioning (runs as vagrant)
config.vm.provision "shell", privileged: false, inline: <<-SHELL
# Fix permissions for copied credentials
chmod 600 "$HOME/.claude.json" 2>/dev/null || true
# chmod 700 "$HOME/.ssh" && chmod 600 "$HOME/.ssh/id_*" 2>/dev/null || true
chmod 700 "$HOME/.config/gh" && chmod 600 "$HOME/.config/gh/"*.yml 2>/dev/null || true
SHELL
end
@theronic
Copy link
Author

theronic commented Feb 9, 2026

Beware that if you give OpenClaw access to Claude Code, it will have write access to any GH repos you've given Claude Code write access for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment