Custom VM

abox.Options on the one SDK, pkg/abox.

Sets vCPU, RAM, boot timeout, and VMMPath. Lists files (no model).

CLI

No --vcpu / --ram flags. Edit ~/.abox/config.yaml (ABOX_HOME overrides the home):

resources:
  vcpu: 1
  ram_mib: 768
runtime:
  isolation: microvm
  backend: libkrun
  network: deny-by-default
  # image: /path/to/abox-guest-linux-amd64.raw
  # vmm_path: /path/to/abox-vmm

Then:

abox --probe-vm

CLI boot timeout is 45s (not a flag). SDK Options.BootTimeout / VCPU / RAMMiB / Image / VMMPath override the file for that process. The image needs an adjacent .manifest.json matching its architecture, protocol, and SHA-256.

SDK

package main

import (
	"context"
	"fmt"
	"os"
	"path/filepath"
	"time"

	"github.com/AdminTurnedDevOps/ABox/pkg/abox"
)

func main() {
	ctx := context.Background()
	wd, _ := os.Getwd()
	exe, _ := os.Executable()
	vmm := filepath.Join(filepath.Dir(exe), "abox-vmm")
	if _, err := os.Stat(vmm); err != nil {
		vmm = "abox-vmm"
	}
	sess, err := abox.Open(ctx, abox.Options{
		RepoPath:    wd,
		VCPU:        1,
		RAMMiB:      768,
		BootTimeout: 60 * time.Second,
		VMMPath:     vmm,
	})
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	defer sess.Close()
	fmt.Println("session", sess.ID())
	paths, err := sess.ListFiles(ctx, ".", 2, 20)
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	for _, p := range paths {
		fmt.Println(p)
	}
}