Windows安装WSL2+Ubuntu 22.04

系统要求

  • Windows 10 版本 2004 及以上(内部版本 19041 及以上)
  • 或 Windows 11
  • 64位系统
  • 已开启虚拟化功能(BIOS中启用)

🚀 安装步骤

1. 以管理员身份打开PowerShell
  • 右键点击开始菜单
  • 选择"Windows PowerShell(管理员)"或"终端(管理员)"
2. 启用WSL功能
powershell 复制代码
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
3. 重启电脑
powershell 复制代码
Restart-Computer
4. 设置WSL2

重启后,在管理员PowerShell中执行:

powershell 复制代码
# 设置WSL2为默认版本
wsl --set-default-version 2
5. 下载Ubuntu 22.04

https://mirrors.ustc.edu.cn/ubuntu-cloud-images/wsl/jammy/current/ubuntu-jammy-wsl-amd64-ubuntu22.04lts.rootfs.tar.gz

6. 更新WSL2内核组件
powershell 复制代码
wsl --update
7. 安装Ubuntu 22.04

D:\Ubuntu22.04是系统要放置的盘,放在C盘后续容器出问题

在ubuntu-jammy-wsl-arm64-ubuntu22.04lts.rootfs.tar.gz文件所在目录下执行

powershell 复制代码
wsl --import Ubuntu-22.04 D:\Ubuntu22.04 D:\Downloads\ubuntu-jammy-wsl-amd64-ubuntu22.04lts.rootfs.tar.gz --version 2

执行后会显示操作成功完成。

7. 进入系统
powershell 复制代码
wsl -d Ubuntu-22.04

会显示

powershell 复制代码
PS D:\Downloads> wsl -d Ubuntu-22.04
Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 6.6.87.2-microsoft-standard-WSL2 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro

 System information as of Thu Mar 19 18:02:24 CST 2026

  System load:  0.22                Processes:             30
  Usage of /:   0.1% of 1006.85GB   Users logged in:       0
  Memory usage: 6%                  IPv4 address for eth0: 172.26.38.244
  Swap usage:   0%


This message is shown once a day. To disable it please create the
/root/.hushlogin file.
root@PC-20260318UDBG:/mnt/d/Downloads#
相关推荐
x²+(y-√³x²)²=11 小时前
Linux打包文件到Windows,文件/文件类型丢失
linux·运维·windows
柒号华仔1 小时前
「速通Shell」聚砖成墙,Shell函数封装之道
linux·ssh·bash
程序员与背包客_CoderZ1 小时前
Linux D-Bus通信协议详解:从入门到C/C++编码实战
linux·服务器·c语言·c++·嵌入式硬件·嵌入式软件·dbus
Android系统攻城狮1 小时前
Linux PipeWire深度解析之pw_properties_iterate调用流程与实战(六十五)
linux·运维·服务器·音频进阶·pipewire音频进阶
Rudon滨海渔村3 小时前
windows10如何删除多余的输入法 - 仅保留English+拼音
windows·输入法
YCOSA20254 小时前
雨晨 Windows 11 IoT 企业版 LTSC 26H1 特制 28000.2796
windows·物联网
jason.zeng@15022074 小时前
linux的top命令
java·linux·服务器
Huangjin007_4 小时前
【Linux 系统篇(十五)】进程 (三) :进程状态深度详解
linux·运维
RisunJan4 小时前
Linux命令-talk(终端实时对话)
linux·运维·服务器
Jay-r5 小时前
DeepSeek Harness 极简上手:装好、玩熟、让它自己长新能力
人工智能·windows·ai·github·ai编程·deepseek·harness