website/content/en/docs/config/environment-variables.md
This page documents the environment variables used in Lima.
LIMA_HOME~/.limaexport LIMA_HOME=~/.lima-custom
lima
LIMA_INSTANCEdefaultexport LIMA_INSTANCE=my-instance
lima uname -a
LIMA_SHELLexport LIMA_SHELL=/bin/bash
lima
LIMA_TEMPLATES_PATHtemplate: URLs.$LIMA_HOME/_templates:/usr/local/share/lima/templatesexport LIMA_TEMPLATES_PATH="$HOME/.config/lima/templates:/usr/local/share/lima/templates"
limactl create --name my-vm template:my-distro
LIMA_WORKDIRexport LIMA_WORKDIR=/home/user/project
lima
LIMA_SHELLENV_ALLOW--preserve-env. When set, only variables matching these patterns will be passed through, completely overriding the default block list behavior. This feature only applies to Lima v2.0.0 or later.--preserve-env, all variables are propagated except those matching the block list patterns)export LIMA_SHELLENV_ALLOW="FPATH,XAUTHORITY,CUSTOM_*"
limactl shell --preserve-env default
--preserve-env: No environment variables are propagated (regardless of this setting)--preserve-env and LIMA_SHELLENV_ALLOW unset: All variables are propagated except those in the block list--preserve-env and LIMA_SHELLENV_ALLOW set: Only variables matching the allow patterns are propagated (block list is ignored)* at the end (e.g., CUSTOM_* matches CUSTOM_VAR, CUSTOM_PATH, etc.).LIMA_SHELLENV_BLOCKDescription: Specifies a comma-separated list of environment variable patterns to block when propagating environment variables to the Lima instance with --preserve-env. Can either replace the default block list or extend it by prefixing with +. This feature only applies to Lima v2.0.0 or later.
Default: A predefined list of system and shell-specific variables that should not be propagated:
BASH*, SHELL, SHLVL, ZSH*, ZDOTDIR, FPATHPATH, PWD, OLDPWD, TMPDIRHOME, USER, LOGNAME, UID, GID, EUID, GROUP, HOSTNAMEDISPLAY, TERM, TERMINFO, XAUTHORITY, XDG_*SSH_*DYLD_*, LD_*_* (variables starting with underscore)See GetDefaultBlockList() for the complete list.
Usage:
# Replace default block list entirely (not recommended)
export LIMA_SHELLENV_BLOCK="SECRET_*,PRIVATE_*"
# Extend default block list (recommended)
export LIMA_SHELLENV_BLOCK="+SECRET_*,PRIVATE_*"
limactl shell --preserve-env default
Note: Patterns support wildcards using * at the end (e.g., SSH_* matches SSH_AUTH_SOCK, SSH_AGENT_PID). Use the + prefix to add to the default block list rather than replacing it entirely. This variable only affects the --preserve-env flag behavior.
LIMACTLlimactl binary.limactl in $PATHexport LIMACTL=/usr/local/bin/limactl
lima
LIMA_SSH_OVER_VSOCKtrue (since v2.0.0)export LIMA_SSH_OVER_VSOCK=true
.ssh.overVsock (since v2.0.2).LIMA_SSH_PORT_FORWARDERfalse (since v1.1.0)export LIMA_SSH_PORT_FORWARDER=false
| Version | Default value |
|---|---|
| v0.1.0 | true, effectively |
| v1.0.0 | false |
| v1.0.1 | true |
| v1.1.0 | false |
LIMA_USERNET_RESOLVE_IP_ADDRESS_TIMEOUTexport LIMA_USERNET_RESOLVE_IP_ADDRESS_TIMEOUT=5
_LIMA_QEMU_UEFI_IN_BIOS-bios instead of pflash drives.false on Unix like hosts and true on Windows hostsexport _LIMA_QEMU_UEFI_IN_BIOS=true
false by default in future
when QEMU supports pflash UEFI for accelerated guests on Windows._LIMA_WINDOWS_EXTRA_PATHlimactl.exe process to search for tools.
It is useful, when there is a need to prevent collisions between binaries available in active shell and ones
used by limactl.exe - injecting them only for the running process w/o altering PATH observed by user shell.
Is is Windows specific and does nothing for other platforms.set _LIMA_WINDOWS_EXTRA_PATH=C:\Program Files\Git\usr\bin
QEMU_SYSTEM_AARCH64qemu-system-aarch64 binary.qemu-system-aarch64 found in $PATHexport QEMU_SYSTEM_AARCH64=/usr/local/bin/qemu-system-aarch64
QEMU_SYSTEM_ARMqemu-system-arm binary.qemu-system-arm found in $PATHexport QEMU_SYSTEM_ARM=/usr/local/bin/qemu-system-arm
QEMU_SYSTEM_PPC64qemu-system-ppc64 binary.qemu-system-ppc64 found in $PATHexport QEMU_SYSTEM_PPC64=/usr/local/bin/qemu-system-ppc64
QEMU_SYSTEM_RISCV64qemu-system-riscv64 binary.qemu-system-riscv64 found in $PATHexport QEMU_SYSTEM_RISCV64=/usr/local/bin/qemu-system-riscv64
QEMU_SYSTEM_S390Xqemu-system-s390x binary.qemu-system-s390x found in $PATHexport QEMU_SYSTEM_S390X=/usr/local/bin/qemu-system-s390x
QEMU_SYSTEM_X86_64qemu-system-x86_64 binary.qemu-system-x86_64 found in $PATHexport QEMU_SYSTEM_X86_64=/usr/local/bin/qemu-system-x86_64