--- title: "WSL2" type: entity tags: [] sources: ["wsl2-启动与网络配置指南", "install-wsl"] last_updated: 2026-04-17 --- ## 基本信息 - **全称**:Windows Subsystem for Linux 2 - **类型**:产品 / 开发工具 - **官方文档**:https://docs.microsoft.com/windows/wsl/ ## 说明 WSL2 是 Microsoft 官方提供的 Windows 内置 Linux 运行环境,基于完整 Linux 内核(WSL1 为翻译层),默认使用 NAT 网络模式。Windows 10/11 Build 19041+ 可通过 `wsl --install` 一键安装。 ## 核心特性 - **完整 Linux 内核**:WSL2 使用真实 Linux 内核,支持系统调用兼容 - **NAT 网络模式(默认)**:WSL2 有独立 IP,与 Windows 主机网络隔离 - **镜像网络模式(推荐)**:通过 `.wslconfig` 配置 `networkingMode=mirrored` + `dnsTunneling=true` 使 WSL2 与 Windows 共享网络堆栈 - **跨文件系统**:Windows 驱动器挂载在 `/mnt/c/` 下 ## 相关工具 - **[[uv]]**:Python 包管理工具,可通过 `ghproxy.com` 镜像加速安装 - **[[Hermes Agent]]**:可通过 `ghproxy.com` 镜像地址安装 ## 来源 - [[wsl2-启动与网络配置指南]] - [[install-wsl]] ## Connections - [[WSL2]] ← depends_on ← [[Install WSL]](先安装后配置) - [[WSL2]] ← uses ← [[ghproxy]](通过反向代理加速下载) - [[WSL2]] ← related_to ← [[Ubuntu Server]](均为 Linux 环境,WSL2 面向桌面开发,Ubuntu Server 面向无头服务器)