zed-industries/zed · error · WslSandboxUnavailable

Windows sandboxing via WSL is unavailable: {}

Error message

Windows sandboxing via WSL is unavailable: {}

What it means

Sentinel error type WslSandboxUnavailable raised by the `unavailable` helper throughout windows_wsl.rs whenever the WSL-based Windows sandbox cannot operate: WSL not installed, no suitable distro, missing zed helper binary, probe failures, or command execution errors. The message carries the specific reason after the WSL_SANDBOX_UNAVAILABLE_PREFIX.

Source

Thrown at crates/sandbox/src/windows_wsl.rs:200

    /// The reason, without the leading [`WSL_SANDBOX_UNAVAILABLE_PREFIX`].
    #[cfg(test)]
    pub fn message(&self) -> &str {
        &self.0
    }
}

impl std::fmt::Display for WslSandboxUnavailable {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{WSL_SANDBOX_UNAVAILABLE_PREFIX}: {}", self.0)
    }
}

impl std::error::Error for WslSandboxUnavailable {}

/// Shorthand for an [`anyhow::Error`] wrapping a [`WslSandboxUnavailable`].
fn unavailable(message: impl Into<String>) -> anyhow::Error {
    anyhow::Error::new(WslSandboxUnavailable::new(message))
}

#[derive(Clone, Debug, Eq, Hash, PartialEq)]
struct WslPath {
    distro: Option<String>,
    path: String,
}

/// A path mapped for use inside WSL.
///
/// WSL UNC and WSL-absolute paths can be mapped structurally up front. Native
/// drive-letter paths depend on the distro's automount configuration
/// (`/etc/wsl.conf` can move the `/mnt` root), so they are translated with
/// `wslpath` inside the distro — but a distro can only be chosen after every
/// path has been parsed (WSL UNC paths pin one), hence this two-stage shape:
/// parse structurally first, then resolve native paths via [`resolve_paths`]
/// once the distro is known.
#[derive(Clone, Debug, Eq, Hash, PartialEq)]

View on GitHub (pinned to f4178619ac)

Solutions

  1. Install WSL (`wsl --install`) and a default Linux distro
  2. Run `wsl --update` to get a compatible kernel
  3. Reinstall or repair the zed WSL helper binary inside the distro
  4. Fall back to running without the Windows sandbox if WSL is unavailable
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/sandbox/src/windows_wsl.rs:200 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/a80930eaf364b861. Report an issue: GitHub.