Installation
Prerequisites
- macOS
- Linux
- macOS 12+ (Monterey or later)
- Xcode Command Line Tools:
xcode-select --install - GCC or Clang
Building the SDK
1
Clone the repository
2
Initialize submodules
3
Build C SDK
4
Verify build
Simple API (Easiest)
1
Create a file hello.c
2
Build and run
- macOS
- Linux
- BoxLite pulls the
python:slimOCI image (first run only) - Creates a lightweight VM with the image
- Executes the Python command inside the VM
- Buffers stdout/stderr and returns the result
- Automatically cleans up when
boxlite_simple_free()is called
Native API (Full Control)
For advanced use cases with streaming output and custom configuration.1
Create a file native.c
2
Build and run
Build and run using the same commands as the Simple API above.
Running Examples
BoxLite includes 8 comprehensive C examples:Error Handling
The C SDK uses structured error handling:
See C SDK API Reference for the complete list.
Next Steps
Core concepts
Understand the different box types, lifecycle, images, and resource configuration.
C SDK Reference
Complete SDK documentation covering Simple API and Native API details, JSON configuration schema, Memory management rules, Threading and safety, and Troubleshooting guide.
C API Reference
Function signatures and parameters for the C SDK.
C Examples
Working code examples on GitHub.

