windows家庭版 安装 wsl 2失败,总结

您所在的位置:网站首页 如何看windows内核版本 windows家庭版 安装 wsl 2失败,总结

windows家庭版 安装 wsl 2失败,总结

2023-07-01 08:54| 来源: 网络整理| 查看: 265

背景

windows版本 winver或者ver

Microsoft Windows [版本 10.0.19044.2006]

根据docker文档 https://docs.docker.com/desktop/install/windows-install/ 安装WSL2,但在设置 WSL为WSL 2时失败。原因未知。

错误提示

> wsl --set-version Ubuntu 2 正在进行转换,这可能需要几分钟时间... 有关与 WSL 2 的主要区别的信息,请访问 https://aka.ms/wsl2 请启用虚拟机平台 Windows 功能并确保在 BIOS 中启用虚拟化。 有关信息,请访问 https://aka.ms/wsl2-install

根据提示,虚拟化和安装Linux kernel后,依旧失败。

卸载 wsl --unregister Ubuntu

如果在卸载前设置过wsl --set-default-version 2,那么会重装失败,错误提示

Installing, this may take a few minutes... WslRegisterDistribution failed with error: 0x80370102 Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS. For information please visit https://aka.ms/enablevirtualization Press any key to continue...

所以,将默认的distribution对应的wsl版本改回1,命令:wsl --set-default-version 1 再启动会成功。

以下为安装WSL 2的步骤,仅供参考

Install WSL

参考官方文档:https://learn.microsoft.com/en-us/windows/wsl/install wsl --install

如果弹出help信息,可直接下一步

Install distribution

查看

wsl --list --online

选择一个下载,也可通过Microsoft Store下载。命令行下载不知为何很慢。

wsl --install -d Ubuntu

Upgrade WSL to WSL2

查看WSL,以及安装distribution对应的wsl版本

wsl -l -v

> wsl -l -v NAME STATE VERSION * Ubuntu Running 1 Download the linux kernel

官方文档:https://learn.microsoft.com/en-us/windows/wsl/install-manual

Linux kernal下载地址:the linux kernel download page

下载完毕,安装.msi文件。

Enable virtual machine feature

需要管理员模式下,运行命令

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Restart the computer Set the distribution to WSL 2

运行命令

wsl --set-version Ubuntu 2

参考

https://blog.csdn.net/qq_33540705/article/details/112603137 https://www.ziruchu.com/art/197



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3