vm

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: EUPL-1.2 Imports: 13 Imported by: 0

Documentation

Overview

Package vm provides container/VM management commands across the LinuxKit (qemu/hyperkit) and Apple (`container`) runtimes.

Container lifecycle:

  • run: Run from an image (.iso/.qcow2/.vmdk/.raw or OCI ref) or template; supports --publish/--volume/--env
  • ps: List running containers (aggregated across runtimes)
  • stop: Stop a running container
  • kill: Kill a running container (SIGKILL)
  • rm: Remove a container
  • logs: View container logs
  • exec: Execute a command inside a container (add -i/-t for a TTY session)
  • shell: Open an interactive shell in a container (default /bin/sh)
  • inspect: Show detailed container information (JSON)
  • templates: Manage LinuxKit templates (list, show, vars)

Apple image management (requires the macOS `container` runtime):

  • build: Build an OCI image from a Containerfile
  • pull: Pull an image from a registry
  • push: Push a locally-tagged image to a registry
  • images: List images
  • rmi: Remove an image

Apple system management (requires the macOS `container` runtime):

  • system start: Start the apiserver + default kernel (--no-kernel-install to skip)
  • system status: Show system status
  • system stop: Stop the system services

TIM/STIM bundles (Borg format, via forge.lthn.ai/Snider/Borg/pkg/tim):

  • tim pack: pack a directory into a .tim bundle
  • tim encrypt: encrypt a .tim into a .stim (--key-file)
  • tim decrypt: decrypt a .stim back into a .tim (--key-file)
  • tim inspect: show a .tim config / .stim header

kill/rm/inspect dispatch to whichever runtime owns the container id; the image and system commands are Apple-only (LinuxKit has no OCI image management).

Package vm provides LinuxKit VM management commands.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddVMCommands

func AddVMCommands(c *core.Core)

AddVMCommands adds container-related commands under 'vm' to the CLI.

Usage:

AddVMCommands(c)
Example
// AddVMCommands usage is covered by the corresponding triplet tests.

func ParseVarFlags

func ParseVarFlags(varFlags []string) map[string]string

ParseVarFlags parses --var flags into a map. Format: --var KEY=VALUE or --var KEY="VALUE"

Usage:

vars := ParseVarFlags([]string{"SSH_KEY=abc", "PORT=2222"})
Example
// ParseVarFlags usage is covered by the corresponding triplet tests.

func RunFromTemplate

func RunFromTemplate(templateName string, vars map[string]string, runOpts container.RunOptions) (
	err error,
)

RunFromTemplate builds and runs a LinuxKit image from a template.

Usage:

err := RunFromTemplate("core-dev", vars, runOpts)
Example
// RunFromTemplate usage is covered by the corresponding triplet tests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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