{"record":{"id":"cf762a814546b217","repo":"zed-industries/zed","slug":"wsl-shares-the-network-interface-with-the-host-sys","errorCode":null,"errorMessage":"WSL shares the network interface with the host system","messagePattern":"WSL shares the network interface with the host system","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/remote/src/transport/wsl.rs","lineNumber":536,"sourceCode":"    fn has_been_killed(&self) -> bool {\n        false\n    }\n\n    fn shares_network_interface(&self) -> bool {\n        true\n    }\n\n    fn build_command(\n        &self,\n        program: Option<String>,\n        args: &[String],\n        env: &HashMap<String, String>,\n        working_dir: Option<String>,\n        port_forward: Option<(u16, String, u16)>,\n        _interactive: Interactive,\n    ) -> Result<CommandTemplate> {\n        if port_forward.is_some() {\n            bail!(\"WSL shares the network interface with the host system\");\n        }\n\n        let shell_kind = self.shell_kind;\n        let working_dir = working_dir\n            .map(|working_dir| RemotePathBuf::new(working_dir, PathStyle::Unix).to_string())\n            .unwrap_or(\"~\".to_string());\n\n        let mut exec = String::from(\"exec env \");\n\n        for (key, value) in env.iter() {\n            let assignment = format!(\"{key}={value}\");\n            let assignment = shell_kind.try_quote(&assignment).context(\"shell quoting\")?;\n            write!(exec, \"{assignment} \")?;\n        }\n\n        if let Some(program) = program {\n            write!(\n                exec,","sourceCodeStart":518,"sourceCodeEnd":554,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/remote/src/transport/wsl.rs#L518-L554","documentation":"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.","triggerScenarios":"Thrown at crates/remote/src/transport/wsl.rs:536 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the port-forward option when using WSL remoting","Access services via localhost directly, since WSL shares the host network interface"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}