Synopsis
Description
Theenv command group provides subcommands for managing environment variables on running VMs. Variables are persisted in /etc/profile.d/smolvm_env.sh and automatically loaded for new SSH sessions.
Environment variable changes apply to new SSH sessions. Existing sessions require running
source /etc/profile.d/smolvm_env.sh to pick up changes.Subcommands
set
Set one or more environment variables on a VM. Variables are merged with existing ones.Arguments
string
required
VM identifier
string[]
required
One or more
KEY=VALUE pairs to setOptions
string
default:"~/.smolvm/keys/id_ed25519"
SSH private key path for connecting to the VM
string
default:"root"
SSH user to connect as
Examples
Set a single variable:unset
Remove one or more environment variables from a VM.Arguments
string
required
VM identifier
string[]
required
One or more variable names to remove
Options
string
default:"~/.smolvm/keys/id_ed25519"
SSH private key path for connecting to the VM
string
default:"root"
SSH user to connect as
Examples
Remove a single variable:list
List all SmolVM-managed environment variables on a VM.Arguments
string
required
VM identifier
Options
flag
default:"false"
Show variable values (masked by default for security)
string
default:"~/.smolvm/keys/id_ed25519"
SSH private key path for connecting to the VM
string
default:"root"
SSH user to connect as
Examples
List variables (values masked):Environment Variable Validation
When setting variables, keys must follow these rules:- Must not be empty
- Must follow shell variable naming conventions
- Values can be any string (including empty strings)
Persistence
Environment variables are stored in/etc/profile.d/smolvm_env.sh on the VM. This file:
- Is sourced automatically for new login shells
- Persists across VM restarts (if using persistent storage)
- Can be manually sourced in existing sessions:
source /etc/profile.d/smolvm_env.sh