Auto-sync: 2026-04-28 16:03

This commit is contained in:
2026-04-28 16:03:03 +08:00
parent f8b421ece6
commit 365caa800a
48 changed files with 1942 additions and 1249 deletions

View File

@@ -1,49 +1,49 @@
---
title: "Install WSL"
type: source
tags: []
tags:
- "clippings"
- "wsl"
- "ubuntu"
- "windows"
date: 2026-04-18
---
## Source File
- [[raw/Home Office/Install WSL.md]]
- [[Home Office/Install WSL]]
## Summary用中文描述
- 核心主题Windows Subsystem for LinuxWSL)的官方安装与配置完整指南
- 问题域Windows 10/11 系统上快速安装 Linux 开发环境,包括单命令安装、多发行版支持、版本管理、离线安装等场景
- 方法/机制: `wsl --install`键安装;② `-d` 参数切换默认发行版;③ `wsl.exe --set-default-version` 切换 WSL 1/2④ MSI 包 + DISM 命令离线安装;⑤ Windows Terminal / 开始菜单 / PowerShell 多入口运行
- 结论/价值:微软官方权威安装文档提供从零到生产可用的完整路径WSL2 为默认版本,支持并行运行多个不同 Linux 发行版
- 核心主题Windows Subsystem for Linux (WSL) 的安装与配置
- 问题域:开发者如何在 Windows 系统上快速安装和使用 Linux 环境
- 方法/机制:通过 `wsl --install`条命令自动启用 WSL 功能并安装 Ubuntu支持更换默认发行版、版本切换WSL 1/WSL 2、多发行版管理
- 结论/价值:开发者可在 Windows 上无缝使用 Linux 工具链,无需虚拟机或双系统,适合跨平台开发
## Key Claims用中文描述
- `wsl --install` 一条命令完成 WSL 全部组件启用和 Ubuntu 默认发行版安装,适用于 Windows 10 version 2004+Build 19041+)和 Windows 11
- WSL2 默认使用 NAT 网络模式,通过 `.wslconfig` 配置 `networkingMode=mirrored` 可实现与 Windows 共享网络堆栈(参考 [[WSL2 启动与网络配置指南]]
- 支持并行安装多个 Linux 发行版Ubuntu/Debian/SUSE/Kali/Fedora 等),可从 Microsoft Store 下载或导入自定义 TAR 分发版
- 新安装的 Linux 发行版默认使用 WSL 2可通过 `wsl.exe --set-version <Distro> 1` 降级到 WSL 1
- 离线安装需从 GitHub releases 下载 MSI 安装包,并通过 DISM 命令启用 Virtual Machine Platform 组件
- 微软通过 `wsl --install` 命令实现一键安装:自动启用 WSL 所需功能 + 安装默认 Ubuntu 发行版
- Windows 10 version 2004+ (Build 19041+) 或 Windows 11 才能使用该命令,旧版本需手动安装
- 新安装的 Linux 发行版默认使用 WSL 2可通过命令在 WSL 1 和 WSL 2 之间切换
- 支持同时运行多个不同 Linux 发行版,可从 Windows Terminal、开始菜单、PowerShell 等多种方式启动
## Key Quotes
> "You can now install everything you need to run WSL with a single command." — 微软官方文档
> "New Linux installations, installed using the `wsl --install` command, will be set to WSL 2 by default." — 微软官方文档
> "Developers can access the power of both Windows and Linux at the same time on a Windows machine." — 官方文档开篇
> "WSL lets developers install a Linux distribution... and use Linux applications, utilities, and Bash command-line tools directly on Windows, unmodified, without the overhead of a traditional virtual machine or dualboot setup." — WSL 核心价值描述
> "New Linux installations, installed using the `wsl --install` command, will be set to WSL 2 by default." — WSL 2 默认设置说明
## Key Concepts
- [[WSL2]]Windows Subsystem for Linux 2Windows 10/11 内置 Linux 虚拟机环境,默认版本,支持完整 Linux 内核
- [[WSL1]]WSL 第一代,基于翻译层,性能较差但兼容性好,新发行版默认不使用
- [[WSL 安装命令]]`wsl --install` 单命令安装,启用所需功能并安装默认 Ubuntu 发行版
- [[多发行版支持]]WSL 支持并行安装运行多个不同 Linux 发行版,可通过 `--distribution` 参数指定运行哪个
- [[离线安装]]:通过 MSI 包 + DISM 命令手动启用 Virtual Machine Platform 组件,适用于无法联网的环境
- [[WSL]]Windows Subsystem for Linux允许在 Windows 上原生运行 Linux 二进制可执行文件
- [[WSL2]]WSL 的第二代架构,使用轻量级虚拟机和支持完整的 Linux 内核,提升文件系统性能和系统调用兼容性
- [[PowerShell]]Windows 命令行 shell用于执行 WSL 安装和管理命令
- [[Windows Terminal]]:微软推荐的终端应用,支持多标签页,可在同一窗口中运行 PowerShell、WSL、命令提示符等
## Key Entities
- [[Microsoft]]WSL 官方文档发布
- [[Microsoft]]WSL 的开发者和发布
- [[Ubuntu]]WSL 默认安装的 Linux 发行版
- [[PowerShell]]Windows 命令行环境,执行 `wsl --install` 的工具(需管理员模式)
- [[Windows Terminal]]:微软官方终端应用,推荐用于运行 WSL支持多标签页
- [[Debian]]WSL 支持的 Linux 发行版之一
- [[Kali Linux]]WSL 支持的安全/渗透测试专用 Linux 发行版
- [[WSL]]OpenSUSE 等其他 WSL 支持的发行版
## Connections
- [[WSL2 启动与网络配置指南]] ← related_to ← [[Install WSL]](安装完成后需参考网络配置指南解决代理问题)
- [[Ubuntu Server]] ← related_to ← [[WSL2]]WSL2 中的 Ubuntu 与 Ubuntu Server 同属 Ubuntu 系 Linux 环境)
- [[Install WSL]] ← extends ← [[WSL2 启动与网络配置指南]]
## Contradictions
- 与 [[WSL2 启动与网络配置指南]] 的侧重点差异:
- 冲突点:本文档聚焦安装过程,未涉及网络配置;[[WSL2 启动与网络配置指南]] 聚焦安装后的网络配置
- 当前观点:先安装(本文档)→ 后配置网络([[WSL2 启动与网络配置指南]]),两篇互补
- 对方观点WSL2 默认 NAT 网络模式下 localhost 代理不可用,需配置镜像模式才能与 Windows 共享代理
- (暂无发现冲突内容)