guestagent

package
v0.1.22 Latest Latest
Warning

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

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

Documentation

Overview

Guest agent runs inside the Firecracker VM and handles: 1. Command execution requests from the host 2. Ready signal to indicate VM is ready 3. VFS client connection to host for FUSE

Index

Constants

View Source
const (
	AF_VSOCK        = 40
	VMADDR_CID_HOST = 2

	VsockPortExec  = 5000
	VsockPortVFS   = 5001
	VsockPortReady = 5002

	MsgTypeExec        uint8 = 1
	MsgTypeExecResult  uint8 = 2
	MsgTypeStdout      uint8 = 3
	MsgTypeStderr      uint8 = 4
	MsgTypeSignal      uint8 = 5
	MsgTypeReady       uint8 = 6
	MsgTypeStdin       uint8 = 7
	MsgTypeResize      uint8 = 8
	MsgTypeExecTTY     uint8 = 9
	MsgTypeExit        uint8 = 10
	MsgTypeExecStream  uint8 = 11
	MsgTypeExecPipe    uint8 = 12
	MsgTypePortForward uint8 = 13
)

Variables

View Source
var (
	// Vsock errors
	ErrSocket  = errors.New("socket")
	ErrBind    = errors.New("bind")
	ErrListen  = errors.New("listen")
	ErrConnect = errors.New("connect")
	ErrEOF     = errors.New("EOF")

	// User resolution errors
	ErrResolveUID    = errors.New("resolve uid")
	ErrResolveGID    = errors.New("resolve gid")
	ErrUserNotFound  = errors.New("user not found")
	ErrGroupNotFound = errors.New("group not found")
)

Functions

func Run

func Run()

Types

type ExecRequest

type ExecRequest struct {
	Command    string            `json:"command"`
	Args       []string          `json:"args"`
	WorkingDir string            `json:"working_dir"`
	Env        map[string]string `json:"env"`
	Stdin      []byte            `json:"stdin"`
	User       string            `json:"user,omitempty"`
}

type ExecResponse

type ExecResponse struct {
	ExitCode int    `json:"exit_code"`
	Stdout   []byte `json:"stdout"`
	Stderr   []byte `json:"stderr"`
	Error    string `json:"error"`
}

type ExecTTYRequest

type ExecTTYRequest struct {
	Command    string            `json:"command"`
	Args       []string          `json:"args"`
	WorkingDir string            `json:"working_dir"`
	Env        map[string]string `json:"env"`
	Rows       uint16            `json:"rows"`
	Cols       uint16            `json:"cols"`
	User       string            `json:"user,omitempty"`
}

type PortForwardRequest

type PortForwardRequest struct {
	Host string `json:"host,omitempty"`
	Port uint16 `json:"port"`
}

type VFSClient

type VFSClient struct {
	// contains filtered or unexported fields
}

VFS client for FUSE daemon (placeholder - would need full FUSE implementation)

func NewVFSClient

func NewVFSClient() (*VFSClient, error)

func (*VFSClient) Close

func (c *VFSClient) Close() error

Jump to

Keyboard shortcuts

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