Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

AI Sandbox

A Lima-based development VM setup for creating isolated, reproducible development environments. This sandbox comes pre-configured with essential development tools, Docker, and version managers.

Features

  • Ubuntu 24.04 LTS base image (ARM64)
  • Docker with Docker Compose
  • mise version manager with configurable tools (Python, Node.js, etc.)
  • OpenCode AI coding assistant
  • Rosetta 2 support for x86 compatibility on Apple Silicon
  • Shared directory mounting for seamless file access

Prerequisites

Install Lima

macOS (Homebrew)

brew install lima

macOS (MacPorts)

sudo port install lima

Linux (Homebrew)

brew install lima

Linux (Manual Installation)

# Download the latest release
VERSION=$(curl -fsSL https://api.github.com/repos/lima-vm/lima/releases/latest | jq -r .tag_name)
curl -fsSL "https://github.com/lima-vm/lima/releases/download/${VERSION}/lima-${VERSION:1}-$(uname -s)-$(uname -m).tar.gz" | sudo tar Cxzf /usr/local -

# Verify installation
limactl --version

Verify Installation

limactl --version
lima --version

Configuration

VM Resources

Edit sandbox.yaml to adjust resources:

cpus: 8           # Number of CPU cores
memory: "16GiB"   # RAM allocation
disk: "120GiB"    # Disk size

Git Configuration

Update the provision section in sandbox.yaml with your git credentials:

provision:
- mode: user
  script: |
    #!/bin/bash
    GIT_NAME="Your Name"
    GIT_EMAIL="your@email.com"
    WORKING_DIR="/home/ciphercell/projects"
    
    bash /home/ciphercell/projects/ai_sandbox/setup-vm.sh "$GIT_NAME" "$GIT_EMAIL" "$WORKING_DIR"

Shared Directories

Configure mount points in sandbox.yaml:

mounts:
- location: "~/Code/ciphercell"           # Host directory
  mountPoint: "/home/ciphercell/projects" # Guest directory
  writable: true

Development Tools (mise)

Edit mise-tools.conf to specify which tools to install:

python@latest
node@lts
go@latest
rust@stable

Usage

Create and Start the VM

# Create the VM from the sandbox configuration
limactl create --name=sandbox sandbox.yaml

# Start the VM
limactl start --progress sandbox

Connect to the VM

# Open a shell in the VM
limactl shell sandbox

# Or use the lima shortcut (if sandbox is the default)
lima

Common Commands

# List all VMs
limactl list

# Stop the VM
limactl stop sandbox

# Start a stopped VM
limactl start sandbox

# Restart the VM
limactl stop sandbox && limactl start sandbox

# Delete the VM (destructive!)
limactl delete sandbox

# Delete with force (if VM is running)
limactl delete --force sandbox

Run Commands Directly

# Run a single command in the VM
limactl shell sandbox -- docker ps
limactl shell sandbox -- python --version

# Or with lima shortcut
lima docker ps

File Structure

ai_sandbox/
├── README.md           # This file
├── sandbox.yaml        # Lima VM configuration
├── setup-vm.sh         # Provisioning script (runs on first boot)
└── mise-tools.conf     # Development tools configuration

Troubleshooting

VM fails to start

# Check VM status and logs
limactl list
limactl logs sandbox

Docker permission denied

Log out and back in to the VM for docker group membership to take effect:

limactl stop sandbox
limactl start sandbox
limactl shell sandbox

Reset the VM

limactl delete --force sandbox
limactl start --name=sandbox sandbox.yaml

Check provisioning logs

limactl shell sandbox
cat /var/log/cloud-init-output.log

Port Forwarding

Uncomment and configure in sandbox.yaml to expose ports:

portForwards:
  - guestPort: 8080
    hostPort: 8080
  - guestPort: 3000
    hostPort: 3000

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages