vm

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Create(ctx context.Context, config *VMConfig) (Machine, error)
	Name() string
}

type InteractiveMachine

type InteractiveMachine interface {
	Machine
	ExecInteractive(ctx context.Context, command string, opts *api.ExecOptions, rows, cols uint16, stdin io.Reader, stdout io.Writer, resizeCh <-chan [2]uint16) (int, error)
}

type Machine

type Machine interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	Wait(ctx context.Context) error
	Exec(ctx context.Context, command string, opts *api.ExecOptions) (*api.ExecResult, error)
	NetworkFD() (int, error)
	VsockFD() (int, error)
	PID() int
	Close() error
	RootfsPath() string // Returns the path to the VM's rootfs (may be a temp copy)
}

type VMConfig

type VMConfig struct {
	ID              string
	KernelPath      string
	InitramfsPath   string // Optional initramfs/initrd path
	RootfsPath      string
	CPUs            int
	MemoryMB        int
	NetworkFD       int
	VsockCID        uint32
	VsockPath       string
	SocketPath      string
	LogPath         string
	KernelArgs      string
	Env             map[string]string
	GatewayIP       string // Host TAP IP (e.g., 192.168.100.1)
	GuestIP         string // Guest IP (e.g., 192.168.100.2)
	SubnetCIDR      string // CIDR notation (e.g., 192.168.100.1/24)
	Workspace       string // Guest VFS mount point (default: /workspace)
	UseInterception bool   // Use network interception (MITM proxy)
	PrebuiltRootfs  string // Pre-prepared rootfs path (skips internal copy if set)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL