当前位置:网站首页>WSL2.0安装
WSL2.0安装
2022-07-05 16:14:00 【赫本赫0】
WSL是windows子系统,可以运行Linux,WSL2.0对比1.0具备完整的Linux内核、托管VM和完全的系统调用兼容性
安装条件:
win+r输入winver检查windows版本,需要windows10 18917或更高版本

安装步骤:
- 启用适用于liunx的windows系统,打开Powershell输入:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart


- 启用虚拟化
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
- 下载64x的linux内核升级包并安装
- 设置wsl默认版本
wsl --set-default-version 2
- 安装Ubuntu20.04LTS,打开Microsoft Store,找到Ubuntu 20.04LTS点击安装即可,安装完成后打开设置初始用户名和密码

- 更换linux子系统的软件源并更新
因为默认的软件源是 Ubuntu 的官网地址,需要设置成国内阿里的镜像以提高速度
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
常见问题解决
- WslRegisterDistribution 失败并出现错误 0x8007019e

原因:未安装Windows子系统支持
解决:
方法一:powershell中输入
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
回车Y,自动重启电脑
方法二:未启用“适用于 Linux 的 Windows 子系统”可选组件:
打开“控制面板” -> “程序和功能” -> “打开或关闭 Windows 功能”-> 选中“适用于 Linux 的 Windows 子系统”,或使用本文开头所述的 PowerShell cmdlet。
- WslRegisterDistribution failed with error: 0x800701bc

原因:wsl1升级到wsl2之后,内核却没有升级,所以会出现这种错误提示,前往微软WSL官网下载安装适用于 x64 计算机的最新 WSL2 Linux 内核更新包即可
解决:
下载最新的wsl安装包
下载地址:https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
边栏推荐
- 一些認知的思考
- 今日睡眠质量记录79分
- How to set the WiFi password of the router on the computer
- Jarvis OJ Flag
- 【刷题篇】有效的数独
- How to install MySQL
- Clear restore the scene 31 years ago, volcanic engine ultra clear repair beyond classic concert
- Hiengine: comparable to the local cloud native memory database engine
- Solve the Hanoi Tower problem [modified version]
- Reduce the cost by 40%! Container practice of redis multi tenant cluster
猜你喜欢

2020-2022两周年创作纪念日

详解SQL中Groupings Sets 语句的功能和底层实现逻辑

清晰还原31年前现场,火山引擎超清修复Beyond经典演唱会

为季前卡牌游戏 MotoGP Ignition Champions 做好准备!

Jarvis OJ Webshell分析

Win11提示无法安全下载软件怎么办?Win11无法安全下载软件
![[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details

极坐标扇图使用场景与功能详解

DeSci:去中心化科学是Web3.0的新趋势?

Scratch colorful candied haws Electronic Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
随机推荐
Mongodb getting started Tutorial Part 04 mongodb client
DenseNet
清晰还原31年前现场,火山引擎超清修复Beyond经典演唱会
Android privacy sandbox developer preview 3: privacy, security and personalized experience
树莓派4b安装Pytorch1.11
Enterprise backup software Veritas NetBackup (NBU) 8.1.1 installation and deployment of server
Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
Starkware: to build ZK "universe"
Migrate /home partition
SQL injection of cisp-pte (Application of secondary injection)
中间表是如何被消灭的?
帮忙看看是什么问题可以吗?[ERROR] Could not execute SQL stateme
Jarvis OJ webshell analysis
Basic introduction to the control of the row component displaying its children in the horizontal array (tutorial includes source code)
scratch五彩糖葫芦 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
StarkWare:欲构建ZK“宇宙”
The database of the server is not connected to 200310060 "unknown error" [the service is up, the firewall is off, the port is on, and the netlent port is not connected]
Solve the Hanoi Tower problem [modified version]
Using graylog alarm function to realize the regular work reminder of nail group robots
关于new Map( )还有哪些是你不知道的