wsl2 windows 安装

依赖环境

启用WSL及虚拟机

复制代码
# 启用WSL功能
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
 
# 启用虚拟机平台(WSL2依赖)
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

或者在程序和功能中开启

确保上面三个都开启

2.更新

使用下面命令更新

复制代码
wsl --update

我电脑更新会有问题,也可以直接下载最新程序进行安装https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

如果还有问题,可尝试重置 winsock

复制代码
netsh winsock reset

版本操作及发行版本安装

设置版本

复制代码
wsl --set-default-version 2

下载离线包

https://cloud.tencent.com/developer/tools/blog-entry?target=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fwindows%2Fwsl%2Finstall-manual%23downloading-distributions&objectId=2487510&objectType=1&contentType=undefined

AppStore 中的会默认安装到c盘 推荐下载离线包

.AppxBundle安装包改名为zip文件,解压,找到文件名包含x64的.appx文件,再次改名为.zip文件, 解压到D盘比较好找的目录,如D:\Ubuntu 点击ubuntu.exe安装.

参考链接

https://blog.csdn.net/micreat/article/details/154502968

https://blog.csdn.net/qq_34459334/article/details/154983984

相关推荐
sz4972385991 天前
WSL2+VSCode搭建ESP-IDF 开发环境
ide·vscode·编辑器·esp32·wsl
*星星之火*2 天前
【AI工具篇】Windows 安装 WSL 全攻略:wsl --install 一键部署 + VSCode 搭配使用好处详解
windows·vscode·wsl
吴烦恼的博客6 天前
WSL迁移指南
ubuntu·wsl·系统移植
Irene199110 天前
前端开发中,WSL和本地开发的区别(本地项目,PowerShell和Bash均可执行npm命令,推荐使用 PowerShell)
wsl·本地开发
cuckooman12 天前
如何升级wsl1到wsl2
wsl·wsl2
无巧不成书021812 天前
保姆级教程:解决DISM错误0x800f0915,成功开启虚拟机平台(2026年最新版)
wsl·windows11·系统修复·dism错误·虚拟机平台
Irene199112 天前
Cursor/VSCode 连接 WSL 频繁掉线问题完整排查记录(AI总结版)
编辑器·wsl
goto199714 天前
Ubuntu调整路径--从C盘调整到D盘
ubuntu·wsl·c盘·d盘
comedate15 天前
【WSL】【OpenClaw】WSL 中配置 SearXNG 指南
wsl·searxng·openclaw·搜索引擎部署