Documentation
¶
Overview ¶
Package vbox wraps the VBoxManage CLI. Every VirtualBox interaction in the server flows through Client.Run so that error formatting, dry-run handling, debug logging and CRLF normalisation happen in exactly one place.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatError ¶
FormatError renders any error for return to the MCP caller. VBoxErrors are prefixed with their code; other errors return their message. Raw VBoxManage stderr never leaks unformatted.
func ParseMachineReadable ¶
ParseMachineReadable parses `--machinereadable` output (key="value" lines) into a map. Surrounding quotes are stripped and escaped backslashes ("\\") are unescaped, matching VBoxManage's Windows path encoding.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client executes VBoxManage commands using a shared Config.
type Config ¶
type Config struct {
// VBoxManagePath is the path to the VBoxManage executable.
VBoxManagePath string
// ScreenshotDir is where transient screenshot PNGs are written before being
// read back and returned to the caller.
ScreenshotDir string
// DefaultTimeout bounds helper operations (e.g. the mouse web-service call).
DefaultTimeout time.Duration
// DryRun, when true, logs VBoxManage commands instead of executing them.
DryRun bool
// Debug, when true, logs every VBoxManage invocation to stderr.
Debug bool
// ReadOnly, when true, disables every tool that can modify a VM or its
// guest (create/delete/modify/start/stop/input/exec/...), leaving only
// observation tools. A safety valve for pointing an agent at real VMs.
ReadOnly bool
}
Config holds runtime configuration for the VirtualBox MCP server. Values are resolved from environment variables with sensible cross-platform defaults.
type VBoxError ¶
type VBoxError struct {
// Code is the parsed VBOX_E_* code, or "UNKNOWN".
Code string
// Command is the VBoxManage subcommand that failed (e.g. "startvm").
Command string
// Message is the human-readable error, including VBoxManage stderr.
Message string
}
VBoxError represents a failed VBoxManage invocation.