zed-industries/zed · error

WSL shares a network interface with the host

Error message

WSL shares a network interface with the host

What it means

In WslRemoteConnection::build_forward_ports_command: port forwarding is unconditionally rejected because WSL2 shares the host's network interface — forwarded ports on the host already reach WSL, so no forwarding command is built.

Source

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

                working_dir,
                "--".to_string(),
                command,
            ]
        };
        wsl_args.extend(args);

        Ok(CommandTemplate {
            program: "wsl.exe".to_string(),
            args: wsl_args,
            env: HashMap::default(),
        })
    }

    fn build_forward_ports_command(
        &self,
        _: Vec<(u16, String, u16)>,
    ) -> anyhow::Result<CommandTemplate> {
        Err(anyhow!("WSL shares a network interface with the host"))
    }

    fn connection_options(&self) -> RemoteConnectionOptions {
        RemoteConnectionOptions::Wsl(self.connection_options.clone())
    }

    fn path_style(&self) -> PathStyle {
        PathStyle::Unix
    }

    fn remote_platform(&self) -> RemotePlatform {
        self.platform
    }

    fn remote_os_version(&self) -> Option<String> {
        self.os_version.clone()
    }

View on GitHub (pinned to f4178619ac)

Solutions

  1. Connect to services directly on localhost — no forwarding needed in WSL
Defensive patterns

Strategy: validation

When it happens

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