Installation and configuration¶
This guide covers supported platforms, installation methods, required setup steps, how vc-env discovers configuration, and common troubleshooting.
Supported platforms¶
Prebuilt binaries are currently produced for:
darwin/amd64darwin/arm64linux/amd64linux/arm64
If your platform is not listed, install from source.
Prerequisites¶
- A POSIX-like shell (e.g.
bashorzsh). - Permission to create and write files in your chosen
VCENV_ROOTdirectory. - Network access to GitHub:
vc-env install,vc-env latest, andvc-env list-remotefetch information from GitHub.
No existing vcluster installation is required; vc-env manages the vcluster binaries it installs.
Install methods¶
- Download the binary for your platform from the project's GitHub releases.
- Make it executable and move it into a directory on your
PATH.
Example (Linux x86_64):
The binary will be available at build/vc-env.
Initial setup¶
1) Choose and export VCENV_ROOT¶
VCENV_ROOT is required. It defines where vc-env stores installed versions, the shim, and the global version file.
Add this to your shell profile (e.g. ~/.bashrc or ~/.zshrc):
Required permissions:
vc-env initcreates directories under$VCENV_ROOT.vc-env installwritesvclusterbinaries under$VCENV_ROOT/versions/<version>/vcluster.vc-env globalwrites$VCENV_ROOT/version.
2) Initialize shell integration¶
Add this after the VCENV_ROOT export to your shell profile
(e.g. ~/.bashrc or ~/.zshrc):
What this does:
- Prepends
$VCENV_ROOT/shimsto yourPATHsovclusterresolves to the shim. - Defines a
vc-envshell function that enablesvc-env shellto affect the current shell environment.
Why eval and not just a source
vc-env init prints shell code to stdout. The eval applies it to
the current shell, which is what makes vc-env shell <version>
able to export VCENV_VERSION for your interactive session.
3) Install a vcluster version¶
Or install the latest stable version:
4) Configure which version to use¶
Pick one of:
How configuration is discovered/loaded¶
When the vcluster shim runs, it selects a version using this priority order:
VCENV_VERSION(shell version).vcluster-versionin the current directory or any parent directory (local version)$VCENV_ROOT/version(global version)
flowchart TD
start(["vcluster <args>"]) --> shell{"VCENV_VERSION<br/>set?"}
shell -- yes --> use["use that version"]
shell -- no --> local{".vcluster-version<br/>found walking up?"}
local -- yes --> use
local -- no --> global{"$VCENV_ROOT/version<br/>exists?"}
global -- yes --> use
global -- no --> err(["error:<br/>no vcluster version configured"])
use --> exec(["exec $VCENV_ROOT/versions/<v>/vcluster"])
Notes:
- The
.vcluster-versionlookup walks upward until the filesystem root. - All version values are treated as strings and trimmed for whitespace.
- A value may be an alias (
latest,latest-stable,latest-prerelease,MAJOR.MINOR,~MAJOR.MINOR.PATCH) which the shim re-resolves on every call. See the CLI reference "Version aliases" section.
Auto-install for teammates¶
Set VCENV_AUTO_INSTALL=1 in your shell profile to have the vcluster shim
install any missing version on demand (via vc-env resolve --install). This is the
smoothest onboarding experience when a repository ships a
.vcluster-version file.
Without this variable, the shim still resolves aliases to installed concrete versions when possible, and otherwise prints a helpful error that tells you how to install the missing version or enable auto-install.
Air-gapped installs¶
If GitHub is not reachable, download the vcluster binary ahead of time and install it from the local path. Supply the checksum you obtained out-of-band so vc-env verifies integrity:
--from-file always requires a concrete <version> argument and never
touches the network. If --sha256 is omitted, vc-env proceeds but prints a
warning that integrity was not verified.
Common troubleshooting¶
VCENV_ROOT not set¶
Symptom
vc-env init prints instructions and exits with an error.
Fix
Export VCENV_ROOT and wire the shim into your current shell:
Then add both lines to your ~/.bashrc or ~/.zshrc so they survive new shells.
vc-env: no vcluster version configured¶
Symptom
The vcluster shim fails because none of the three version sources is set.
Fix
Pick the scope you want and set a version with the matching command:
version <X> not installed¶
Symptom
vc-env validates that a version is installed before setting it via global, local, or shell, and the shim also verifies the installed binary is present.
GitHub API rate limit exceeded¶
Symptom
Some commands query GitHub releases. If GitHub returns 403, vc-env reports a rate limit error.
Fix
Export a GitHub token so requests use the authenticated 5000/h quota instead of the anonymous 60/h/IP one:
export VCENV_GITHUB_TOKEN="<personal access token>"
# or, in CI, rely on the runner-injected GITHUB_TOKEN
VCENV_GITHUB_TOKEN takes precedence over GITHUB_TOKEN. See the
environment variables
section for the full list.