Skip to content

Fix vm start silently deleting provisioned WSL distros#2

Merged
qwatts-dev merged 1 commit intomasterfrom
qwatts/fix/provisioned-check-safety
Apr 7, 2026
Merged

Fix vm start silently deleting provisioned WSL distros#2
qwatts-dev merged 1 commit intomasterfrom
qwatts/fix/provisioned-check-safety

Conversation

@qwatts-dev
Copy link
Copy Markdown
Owner

Problem

vm start relied solely on an external .provisioned marker file to determine
if a WSL distro was fully set up. Distros provisioned before the marker system
was introduced were incorrectly flagged as unprovisioned and silently deleted.

Fix

pkg/wsl/manager.goisProvisioned() now has a two-tier check:

  1. Check .provisioned marker file on Windows (fast, existing behavior)
  2. Fallback: check for /etc/trellis-project-root breadcrumb inside the distro
    (written during bootstrap). If found, self-heal the marker so future checks
    are instant.

cmd/vm_start.go — If both checks fail, prompt the user for confirmation
before deleting. Never silently destroy a distro.

The isProvisioned check relied solely on an external .provisioned marker file. Distros provisioned before the marker system was introduced (or whose marker was lost) were incorrectly identified as unprovisioned and silently deleted on the next vm start.

Changes:

- isProvisioned() now has a two-tier check: marker file first, then falls back to checking /etc/trellis-project-root (breadcrumb written during bootstrap) inside the distro. Self-heals the marker on success.

- vm start now prompts for confirmation before deleting a distro that appears unprovisioned, instead of silently deleting it.
@qwatts-dev qwatts-dev self-assigned this Apr 7, 2026
@qwatts-dev qwatts-dev merged commit 37b9c34 into master Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant