Files
nexus/wiki/concepts/WSL2.md
2026-04-18 16:02:38 +08:00

33 lines
920 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: WSL2
type: concept
tags: [windows, linux, subsystem]
---
## Definition
Windows Subsystem for Linux 2WSL2是 Microsoft 提供的 Windows 10/11 上的 Linux 兼容层,基于 Hyper-V 虚拟化技术,提供完整的 Linux 内核。
## Core Features
- 真正的 Linux 内核(而非 WSL1 的翻译层)
- 系统调用兼容性大幅提升
- 性能接近原生 Linux
- 与 Windows 文件系统无缝集成
## Key Commands
- `wsl --install` — 快速安装 WSL2含 Ubuntu
- `wsl -l -v` — 查看已安装分发版及状态
- `wsl -d <分发版名称>` — 启动指定 Linux 发行版
- `wsl --shutdown` — 强制停止所有 WSL 实例
## Network Configuration
WSL2 默认使用 NAT 模式,可通过 .wslconfig 启用镜像网络模式解决代理问题。
## Aliases
- Windows Subsystem for Linux
- WSL
- WSL 2
## Related Concepts
- [[镜像网络模式]]
- [[.wslconfig]]
- [[Ubuntu]]