Errors
abox.ErrGuestTooOld on the one SDK, pkg/abox.
Demonstrates a missing golden image, then ErrGuestTooOld when Open hits a guest older than protocol 4.
CLI
Missing golden image:
abox --probe-vm
# guest image missing … (run: make image)
Old session disk (guest older than protocol 4):
abox --resume <id>
# guest protocol N cannot enforce brokered MCP and command approvals; rebuild the guest image and start a new session
make build && make image-update
abox # new session; do not resume the old id
--probe-vm can still list files on that old disk. Troubleshooting.
SDK
package main
import (
"context"
"errors"
"fmt"
"os"
"time"
"github.com/AdminTurnedDevOps/ABox/pkg/abox"
)
func main() {
ctx := context.Background()
_, err := abox.Open(ctx, abox.Options{
Image: "/nonexistent/abox-guest.raw",
BootTimeout: 5 * time.Second,
})
if err == nil {
fmt.Fprintln(os.Stderr, "expected missing image error")
os.Exit(1)
}
fmt.Println("missing image:", err)
sess, err := abox.Open(ctx, abox.Options{})
if errors.Is(err, abox.ErrGuestTooOld) {
fmt.Println("rebuild guest: make build && make image-update, then Open a new session")
fmt.Println(err)
return
}
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
defer sess.Close()
fmt.Printf("guest is protocol %d; Open already rejected older disks\n", sess.Capabilities().Protocol)
}