Loading

windows WSL安装

这里依据的是微软自己的教程
https://docs.microsoft.com/en-us/windows/wsl/install-win10#manual-installation-steps
以WSL2为例

他有简单安装和手动安装两个方式

这里选择手动安装

第一步

启动Linux子系统
用管理员身份打开powershell,然后输入命令

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

第二步

检查win10版本,WSL2对版本有要求,如果只想安装WSL1,可以快进到第六步

To update to WSL 2, you must be running Windows 10.

  • For x64 systems: Version 1903 or higher, with Build 18362 or higher.
  • For ARM64 systems: Version 2004 or higher, with Build 19041 or higher.
  • Builds lower than 18362 do not support WSL 2. Use the Windows Update Assistant to update your version of Windows.

使用win+R ,打开winver
![在这里插入图片描述]( https://img-blog.csdnimg.cn/20210118173801229.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxNzU0NzcyNjYx,size_16,color_FFFFFF,t_70)

第三步

启用虚拟机功能
用powershell执行

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

然后重启电脑

第四步

安装Linux 内核更新包
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

第五步

将 WSL 2 设置为默认版本
用powershell执行

wsl --set-default-version 2

第六步

在微软应用商城安装Linux 发行版

![在这里插入图片描述]( https://img-blog.csdnimg.cn/20210118185518760.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxNzU0NzcyNjYx,size_16,color_FFFFFF,t_70)

第七步

安装完了启动之,然后需要设定初始的账号和密码
![在这里插入图片描述]( https://img-blog.csdnimg.cn/20210118185928930.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxNzU0NzcyNjYx,size_16,color_FFFFFF,t_70)
然后就安装完成了

posted @ 2021-03-27 09:46  克豪  阅读(490)  评论(0)    收藏  举报