Skip to the content.

CRC Install

Guided install, upgrade, repair and uninstall of CRC (OpenShift Local). The agent and the user do it together: scripts automate every step they can, and the user decides at two gates. CRC has no in-place upgrade. A new version means a new binary, a new bundle and a recreated cluster VM. The old cluster is deleted with its data, and the old binary, bundles and downloads must be cleaned up. This skill does that in a fixed order: assess β†’ plan β†’ πŸ‘€ confirm deletion β†’ teardown β†’ download β†’ πŸ‘€ setup β†’ start β†’ verify β†’ prune. Day-2 start/stop belongs to crc-cmd / crc-ctl. Cluster tuning and operators come after this skill.

Overview

Property Value
Version 1.0.0
Trigger install crc, upgrade crc, uninstall crc, crc install status, log into crc vm
Default version latest on the mirror (2.65.0 = OpenShift 5.0.0 when written); --version pins one
Source https://mirror.openshift.com/pub/openshift-v4/clients/crc/<ver>/ (release-info.json, sha256sum.txt, crc-linux-amd64.tar.xz)
Dependencies crc-cmd (crcstart/crcstop), libvirt group membership, ~/.crc/crc.json + pull secret
Follow-ups crc-status, crc-post-setup-config, operator skills, skupper-model-provider (CRC site)

Specification

ID Capability Verifiable By
S1 Assess without changes β†’ MODE status.sh prints MODE=FRESH\|RESUME\|CONVERGED\|UPGRADE\|REPAIR
S2 Preview every action install.sh --dry-run β†’ plan + DRY_RUN_RESULT=PENDING\|CONVERGED
S3 Never delete without consent (Gate A) UPGRADE/REPAIR/--uninstall without --confirm-delete β†’ exit 4, nothing deleted
S4 Save a rebuild list before an upgrade ~/.local/share/crc-install/upgrade-notes-<old>-to-<new>-<ts>.txt
S5 Tear down with the wrappers crcstop β†’ lingering-process cleanup β†’ crc delete -f with the OLD binary β†’ virsh undefine --nvram / pool-undefine fallback
S6 Install only a verified binary sha256 vs mirror sha256sum.txt; mismatch β†’ exit 1, binary unchanged; old binary kept as crc-<old>
S7 Gate crc setup on sudo (Gate B) sudo -n works β†’ runs it; else exit 3 with the exact command
S8 Start + verify crcstart β†’ crc status Running + target OpenShift version β†’ verified-<ver> marker
S9 Prune only after verify prune.sh refuses without the marker; removes old bundles, crc-<old>, downloads

Rules

Do NOT fabricate, generate, or invent data. Every version, state and size in your output MUST come from script output. If information is unavailable, say so.

Do NOT run crc start or crc stop directly. Use crcstart / crcstop (the scripts do). The libvirt driver (crc-org/machine-driver-libvirt Driver.Stop()) sends one ACPI shutdown, waits 120 s, then force-kills. A large RHCOS guest needs 2.5–6 min to shut down. See crc-cmd Background.

Do NOT pass --confirm-delete until the user has said yes to the Gate A list in this conversation. The request β€œupgrade crc” is not that yes.

Do NOT run prune.sh before install.sh has verified the new cluster. Until prune, install.sh --version <old> can roll back.

Do NOT edit ~/.crc/crc.json or the pull secret. Sizing is the user’s call.

Prerequisites

Workflow

Step 1 β€” Assess

bash ~/.agents/skills/crc-install/scripts/status.sh [--version X.Y.Z]

Show the full output. MODE=CONVERGED β†’ report and stop.

Step 2 β€” Plan

bash ~/.agents/skills/crc-install/scripts/install.sh --dry-run [--version X.Y.Z]

DRY_RUN_RESULT=CONVERGED β†’ stop. PENDING β†’ show the plan and wait for approval. For an upgrade, name the data loss and point to the notes file (S4).

Step 3 β€” Run, and handle the gates

bash ~/.agents/skills/crc-install/scripts/install.sh [--version X.Y.Z] [--no-start]

Run with timeout_secs β‰₯ 3300 (crcstart may take up to 45 min). Exit codes:

Exit Meaning Agent action
0 Installed, started, verified Step 4
4 πŸ‘€ Gate A: deletion list printed Show the list. Ask. Only on an explicit yes, re-run with --confirm-delete.
3 πŸ”’ Gate B: crc setup needs sudo Give the user the printed command for their own terminal (prompts for sudo, downloads the bundle). After they confirm, re-run Step 3. The script resumes (MODE=RESUME).
1 Failure Match Troubleshooting. Nothing past the failed phase ran.

Step 4 β€” Prune

bash ~/.agents/skills/crc-install/scripts/prune.sh --dry-run
bash ~/.agents/skills/crc-install/scripts/prune.sh

Show the candidate list and wait for approval before the real run.

Step 5 β€” Hand off

Check the oc PATH line of status.sh. On ⚠️, give the user the printed line for ~/.bashrc (their file β€” do not write it). Current shell: eval $(crc oc-env). crc is in ~/.local/bin. Bash completion for oc and crc needs no setup.

Point to, in order: crc-status β†’ crc-post-setup-config β†’ operator skills (use the upgrade notes as the to-do list) β†’ skupper-model-provider CRC site. Check that each operator channel exists on the new OpenShift version first.

Uninstall

install.sh --uninstall --dry-run β†’ Gate A β†’ install.sh --uninstall --confirm-delete. It removes the VM, binaries, ~/.crc/{cache,bin,machines} and the downloads, then runs crc cleanup. It keeps crc.json, the pull secret, the notes and the wrappers.

Output Contract

status.sh prints βœ…/⚠️/❌/ℹ️ lines (Target, Binary, VM, Pool, Machine, Cluster, Setup, Bundle, Downloads, Config, Pull secret, Free disk, Wrapper, oc PATH, virt-manager) and ends with exactly one MODE=<mode> β€” <reason> line. install.sh --dry-run and prune.sh --dry-run end with one DRY_RUN_RESULT= line. install.sh prints ── Phase N: <name> ── per phase and ends with βœ… crc <ver> running OpenShift <ocp> or one ❌ / πŸ”’ / πŸ‘€ line.

Tests

Test Spec Command Expected
T1 β€” crc <cmd> --help on the target binary version -o json, delete -f, setup --check-only (exit 2 when not set up), cleanup, status -o json exist
T2 S1 status.sh on a clean host MODE=FRESH
T3 S2 install.sh --dry-run on a clean host plan + DRY_RUN_RESULT=PENDING
T4 S1, S3 sandbox CRC_HOME with machines/crc, install.sh MODE=REPAIR, Gate A list, exit 4, dir kept
T5 S3 sandbox fake crc 2.64.0, install.sh MODE=UPGRADE, exit 4, binary unchanged
T6 S6 CRC_MIRROR=file://… with a wrong sha256 exit 1, tarball removed, no binary installed
T7 S9 prune.sh without, then with, the marker exit 1 refused β†’ lists only old bundles/binaries/downloads
T8 S5–S8 real fresh install β†’ Gate B β†’ start β†’ verify β†’ prune βœ… crc <ver> running OpenShift <ocp>
T9 S1 status.sh on this host, then with HOME=<empty sandbox> βœ… oc PATH: … (via ~/.bashrc) β†’ ⚠️ oc PATH: not set for new shells β€” add to ~/.bashrc: …

Sandbox variables: CRC_BIN_DIR, CRC_HOME, CRC_STATE_DIR, CRC_STAGE_DIR, CRC_MIRROR. The full upgrade path (S4/S5 with a live cluster) can be tested only when a newer CRC than the installed one exists.

Error Handling

Script Idempotent On Failure
status.sh βœ… read-only Exit 1 = mirror unreachable or unknown --version
install.sh --dry-run βœ… read-only Exit 1 = mirror or disk check failed
install.sh βœ… re-run resumes (MODE recomputed; done phases are skipped) Exit 1 β†’ Troubleshooting; exit 3/4 β†’ gates
prune.sh βœ… Exit 1 = not verified (expected before Step 3 ends)

Troubleshooting

Symptom Cause Fix
cannot undefine domain with nvram UEFI domain (OVMF NVRAM) virsh -c qemu:///system undefine crc --nvram (install.sh does this)
release 'X' not found Offline or no such version Check https://mirror.openshift.com/pub/openshift-v4/clients/crc/
sha256 mismatch Corrupt or partial download Re-run; nothing was installed
crcstart exceeded …s Slow first start / operators settling crc status; tail ~/.crc/crc.log; re-run Step 3 (RESUME)
OpenShift X running, want Y Cluster created by another crc version status.sh (Bundle lines); re-run as UPGRADE with --confirm-delete after Gate A
Host swaps during start crc.json memory too high for the host User lowers memory in crc.json; re-run
oc whoami failed kubeconfig not set eval $(crc oc-env); oc login -u kubeadmin https://api.crc.testing:6443

Gotchas

CRC VM Access (SSH)

Node-level access to the VM β€” systemd, journalctl, disk, VM networking β€” and the only way in when the cluster API is down. oc debug node/crc is a privileged pod on the node, not a VM login, and needs a healthy API server to schedule it. Kept here (not in crc-cmd) because the key and forwards share this skill’s lifecycle: created by the install, removed by --uninstall.

crc status                     # VM must be Running
ss -tln | grep ':2222'         # user networking: 127.0.0.1:2222 -> VM:22
ssh -i ~/.crc/machines/crc/id_ed25519 -p 2222 core@127.0.0.1
sudo -i                        # root inside the VM (passwordless)

Changelog

See CHANGELOG.md for version history.