Skip to main content
Frequently asked questions and common issues with BoxLite.

General Questions

BoxLite is a local-first micro-VM sandbox for AI agents — think “SQLite for sandboxing.” It’s a library you embed directly in your application, no daemon or cloud account required. Unlike ephemeral sandboxes that destroy state after each execution, BoxLite Boxes are stateful workspaces — install packages, create files, build up environment state, then come back later and pick up where you left off.
When to use BoxLite:
  • AI agents that need full execution freedom
  • Untrusted code execution
  • Hardware-level isolation required
  • Embedded in applications (no daemon)
When to use Docker:
  • Application deployment
  • Development environments
  • CI/CD pipelines
  • Established Docker workflows
No. BoxLite doesn’t require root privileges.macOS: Hypervisor.framework is available to all users (no special permissions).Linux: Only requires access to /dev/kvm, which can be granted through group membership:
Yes, through WSL2 (Windows Subsystem for Linux).Requirements:
  • Windows 10 version 2004+ or Windows 11
  • WSL2 with a Linux distribution (Ubuntu recommended)
  • KVM support enabled in WSL2
Setup:
Common Issue: If you see “Timeout waiting for guest ready (30s)” errors, your shell cannot open /dev/kvm. This happens when:
  • /dev/kvm is owned by root:kvm with mode 660
  • Your user is not in the kvm group
Run sudo usermod -aG kvm $USER and restart WSL with wsl.exe --shutdown.
Native Windows (without WSL2) is not supported. BoxLite requires KVM (Linux) or Hypervisor.framework (macOS).
Python 3.10 or later.Check your version:
Upgrade if needed:
Yes. BoxLite is stable and used in production.Production considerations:
  • Stable API
  • Hardware-level isolation
  • Resource limits enforced
  • Error handling robust
  • Monitor resource usage
  • Test at expected scale
  • Configure appropriate limits
See the AI Agent Integration guide for production configuration, concurrency, and security patterns.
Apache License 2.0. Free for commercial and non-commercial use.

Technical Questions

macOS: Hypervisor.framework (built into macOS 12+)Linux: KVM (Kernel-based Virtual Machine)How it works:
  • BoxLite uses libkrun as the hypervisor abstraction
  • libkrun provides a unified API over Hypervisor.framework (macOS) and KVM (Linux)
  • Each box runs as a separate microVM with its own kernel
Minimum: 128 MiB (configured via memory_mib)Default: 2048 MiBRange: 128 MiB to 64 GiB (65536 MiB)Overhead:
  • VM overhead: ~50-100 MB per box
  • Guest kernel: ~20-40 MB
  • Container: Depends on image
Example:
Typical: 1-2 secondsFactors:
  • Image size (cached vs first pull)
  • Disk I/O speed
  • Available resources
First run: 5-30 seconds (includes image pull)Subsequent runs: 1-2 seconds (image cached)Optimization:
  • Pre-pull images: runtime.create(boxlite.BoxOptions(image="..."))
  • Reuse boxes instead of creating new ones
  • Use smaller base images (alpine:latest vs ubuntu:latest)
Yes, using persistent disks.Ephemeral (default):
Persistent:
Also:
  • Use volume mounts for host-box data sharing
  • Read-write volumes persist changes to host filesystem
1. Enable debug logging:
2. Check box status:
3. Inspect filesystem:
4. Check hypervisor:
See the macOS Sandbox Debugging guide for comprehensive troubleshooting.

Networking

Yes. All boxes have full internet access by default.Outbound connections:
  • HTTP/HTTPS requests
  • DNS resolution
  • Any protocol (TCP/UDP)
Example:
Use the ports parameter for port forwarding:
Access from host:
See the Architecture: Networking & Storage page for details.
Not directly. Boxes are isolated from each other.Alternatives:
  1. Share data via volumes:
  2. Use host network: Box A exposes a port, and Box B connects to host.docker.internal:port (or localhost on Linux).
  3. External service: Both boxes connect to Redis/database on host or network.

Performance

Common causes:
  1. Insufficient resources:
  2. Disk I/O:
    • Use ephemeral storage (faster than QCOW2)
    • Check host disk speed: dd if=/dev/zero of=test bs=1M count=1024
  3. Too many boxes:
  4. Image size:
    • Use smaller images: alpine:latest (5 MB) vs ubuntu:latest (77 MB)
    • Check image size: docker images
It depends on host resources.Resource calculation:
Best practices:
  • Start small (10 boxes) and scale up
  • Monitor metrics: runtime.metrics().active_boxes
  • Use resource pooling (reuse boxes)
  • Test at expected load
Example:
No hard limit, but practical constraints apply:Memory:
  • Range: 128 MiB to 64 GiB (65536 MiB)
  • Limited by host RAM
Disk:
  • Range: 1 GB to 1 TB
  • Limited by host storage
CPUs:
  • Range: 1 to host CPU count
  • Can oversubscribe (shares-based)
Tested configurations:
  • 64 GiB memory
  • 1 TB disk
  • 16 CPUs

Troubleshooting

Causes:
  1. Network connectivity issues
  2. Invalid image name/tag
  3. Private image requires authentication
  4. Registry not reachable
Solutions:
Debug:
Debug checklist:
  1. Check disk space:
  2. Verify hypervisor:
  3. Check image:
  4. Enable debug logging:
  5. Check permissions:
This is a known issue specific to Ubuntu 24.04. Ubuntu 25.04+ ships the required AppArmor profile by default.
Symptom: Box creation fails with “Timeout waiting for guest ready (30s)” or “VM subprocess exited before guest became ready” on Ubuntu 24.04. Works with sudo or on Ubuntu 25.04+.Root Cause: Ubuntu 24.04 restricts unprivileged user namespaces via AppArmor (kernel.apparmor_restrict_unprivileged_userns=1) but does not ship the bwrap-userns-restrict profile that Ubuntu 25.04+ includes. bwrap (bubblewrap) needs user namespaces for sandbox isolation.Diagnosis:
Fix (Option A — targeted, recommended):Install the bwrap AppArmor profile that Ubuntu 25.04+ ships. Create the file /etc/apparmor.d/bwrap-userns-restrict with the following content, then reload:
Fix (Option B — quick, less secure):Disable the restriction globally:
Fix (Option C — disable jailer):If you don’t need sandbox isolation (e.g., development environment), disable the jailer:
Causes:
  1. Command is waiting for input
  2. Long-running operation
  3. Deadlock or infinite loop
Solutions:
Check if command needs input:
Debug steps:
  1. Check port is not in use:
  2. Verify configuration:
  3. Test from inside box:
  4. Check gvproxy:
Common scenarios:1. ~/.boxlite directory:
2. /dev/kvm (Linux):
3. Volume mounts:
Cause: Box exceeded memory limit.Solutions:
  1. Increase memory limit:
  2. Check actual usage:
  3. Optimize code:
    • Reduce memory footprint of executed code
    • Process data in chunks instead of loading all at once
    • Clear variables when no longer needed
Cause: KVM module not loaded or not accessible.Solutions:
  1. Load KVM module:
  2. Check CPU support:
  3. Enable in BIOS:
    • Reboot and enter BIOS/UEFI
    • Enable “Intel VT-x” or “AMD-V”
    • Save and reboot
  4. Add user to kvm group:
Cause: Running on unsupported macOS version or architecture.Solutions:
  1. Check macOS version:
  2. Check architecture:
  3. Upgrade if needed:
    • BoxLite requires macOS 12+ (Monterey or later)
    • Apple Silicon (M1, M2, M3, M4) only
    • Intel Macs are not supported
If you have an Intel Mac, consider using a Linux VM, deploying to cloud (AWS, GCP, Azure), or using a cloud-based sandboxing service.

Getting Help

Documentation:Community:Before posting:
  1. Check this FAQ
  2. Search existing issues/discussions
  3. Enable debug logging: RUST_LOG=debug
  4. Include BoxLite version, platform, and minimal reproduction
1. Search existing issues: GitHub Issues2. Gather information:
  • BoxLite version: python -c "import boxlite; print(boxlite.__version__)"
  • Platform: uname -a
  • Python version: python --version
  • Error message and stack trace
3. Minimal reproduction:
4. Debug logs:
5. Create issue:
  • Use bug report template
  • Include all gathered information
  • Attach debug logs if relevant
  • Be specific and clear
  1. Check roadmap: Review GitHub Issues with the enhancement label
  2. Search for similar requests: May already be planned or discussed
  3. Create feature request: Use the feature request template, describe your use case, provide examples of desired API/behavior, and explain benefits to other users
  4. Participate in discussion: Respond to questions, refine the proposal based on feedback, and consider implementing it yourself
Quick start:
Areas to contribute:
  • Bug fixes
  • Documentation improvements
  • New examples
  • SDK improvements (Python, Node.js, C)
  • Performance optimizations