zed-industries/zed · error

WSL shares the network interface with the host system

Error message

WSL shares the network interface with the host system

What it means

Capability guard in the WSL transport's build_command: a port forward was requested, but WSL's loopback is shared with the Windows host, so explicit port forwarding setup is unnecessary and unsupported here. The command is rejected rather than silently ignoring the forward.

Source

Thrown at crates/remote/src/transport/wsl.rs:536

    fn has_been_killed(&self) -> bool {
        false
    }

    fn shares_network_interface(&self) -> bool {
        true
    }

    fn build_command(
        &self,
        program: Option<String>,
        args: &[String],
        env: &HashMap<String, String>,
        working_dir: Option<String>,
        port_forward: Option<(u16, String, u16)>,
        _interactive: Interactive,
    ) -> Result<CommandTemplate> {
        if port_forward.is_some() {
            bail!("WSL shares the network interface with the host system");
        }

        let shell_kind = self.shell_kind;
        let working_dir = working_dir
            .map(|working_dir| RemotePathBuf::new(working_dir, PathStyle::Unix).to_string())
            .unwrap_or("~".to_string());

        let mut exec = String::from("exec env ");

        for (key, value) in env.iter() {
            let assignment = format!("{key}={value}");
            let assignment = shell_kind.try_quote(&assignment).context("shell quoting")?;
            write!(exec, "{assignment} ")?;
        }

        if let Some(program) = program {
            write!(
                exec,

View on GitHub (pinned to f4178619ac)

Solutions

  1. Remove the port-forward option when using WSL remoting
  2. Access services via localhost directly, since WSL shares the host network interface
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/remote/src/transport/wsl.rs:536 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/cf762a814546b217. Report an issue: GitHub.