Skip to content

core vm

LinuxKit VM management.

LinuxKit VMs are lightweight, immutable VMs built from YAML templates. They run using qemu or hyperkit depending on your system.

Usage

bash
core vm <command> [flags]

Commands

CommandDescription
runRun a LinuxKit image or template
psList running VMs
stopStop a VM
logsView VM logs
execExecute command in VM
templatesManage LinuxKit templates

vm run

Run a LinuxKit image or build from a template.

bash
core vm run <image> [flags]
core vm run --template <name> [flags]

Supported image formats: .iso, .qcow2, .vmdk, .raw

Flags

FlagDescription
--templateRun from a LinuxKit template (build + run)
--varTemplate variable in KEY=VALUE format (repeatable)
--nameName for the container
--memoryMemory in MB (default: 1024)
--cpusCPU count (default: 1)
--ssh-portSSH port for exec commands (default: 2222)
-dRun in detached mode (background)

Examples

bash
# Run from image file
core vm run image.iso

# Run detached with more resources
core vm run -d image.qcow2 --memory 2048 --cpus 4

# Run from template
core vm run --template core-dev --var SSH_KEY="ssh-rsa AAAA..."

# Multiple template variables
core vm run --template server-php --var SSH_KEY="..." --var DOMAIN=example.com

vm ps

List running VMs.

bash
core vm ps [flags]

Flags

FlagDescription
-aShow all (including stopped)

Output

ID        NAME      IMAGE                STATUS    STARTED   PID
abc12345  myvm      ...core-dev.qcow2    running   5m        12345

vm stop

Stop a running VM by ID or name.

bash
core vm stop <id>

Supports partial ID matching.

Examples

bash
# Full ID
core vm stop abc12345678

# Partial ID
core vm stop abc1

vm logs

View VM logs.

bash
core vm logs <id> [flags]

Flags

FlagDescription
-fFollow log output

Examples

bash
# View logs
core vm logs abc12345

# Follow logs
core vm logs -f abc1

vm exec

Execute a command in a running VM via SSH.

bash
core vm exec <id> <command...>

Examples

bash
# List files
core vm exec abc12345 ls -la

# Open shell
core vm exec abc1 /bin/sh

See Also

  • templates - Manage LinuxKit templates
  • build - Build LinuxKit images
  • dev - Dev environment management

Released under the EUPL-1.2 License.