Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KernelDNSParam ¶ added in v0.1.7
KernelDNSParam returns a comma-separated DNS list for the matchlock.dns= cmdline param.
func KernelIPDNSSuffix ¶ added in v0.1.7
KernelIPDNSSuffix returns the DNS portion of the kernel ip= parameter. The ip= format only supports up to 2 DNS servers (`:dns0:dns1`).
Types ¶
type DiskConfig ¶ added in v0.1.6
type DiskConfig struct {
HostPath string // Path to the ext4 image on the host
GuestMount string // Mount point inside the guest (e.g., "/var/lib/buildkit")
ReadOnly bool
}
DiskConfig describes an additional block device to attach to the VM.
type InteractiveMachine ¶
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)
WriteFile(ctx context.Context, path string, content []byte, mode uint32) error
ReadFile(ctx context.Context, path string) ([]byte, error)
ListFiles(ctx context.Context, path string) ([]api.FileInfo, error)
NetworkFD() (int, error)
VsockFD() (int, error)
PID() int
Close(ctx context.Context) 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
RootfsPath string
OverlayEnabled bool // Boot via overlay root assembly in guest-init
OverlayLowerPaths []string // Host paths to read-only lower images attached as extra disks
OverlayLowerFSTypes []string // Filesystem type per lower image (erofs)
OverlayUpperPath string // Host path to writable upper image attached as extra disk
CPUs float64
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 (empty when VFS is disabled)
UseInterception bool // Use network interception (MITM proxy)
Privileged bool // Skip in-guest security restrictions (seccomp, cap drop, no_new_privs)
DNSServers []string // DNS servers for the guest (default: 8.8.8.8, 8.8.4.4)
Hostname string // Hostname for the guest (default: vm's ID)
AddHosts []api.HostIPMapping // Additional /etc/hosts entries injected at boot
MTU int // Guest interface/network stack MTU (default: 1500)
NoNetwork bool // Disable guest network interface entirely
PrebuiltRootfs string // Pre-prepared rootfs path (skips internal copy if set)
ExtraDisks []DiskConfig // Additional block devices to attach
}
Click to show internal directories.
Click to hide internal directories.