当前位置:网站首页>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
边栏推荐
- Cartoon: what is MapReduce?
- JSON转MAP前后数据校验 -- 自定义UDF
- How to install MySQL
- 【学术相关】多位博士毕业去了三四流高校,目前惨不忍睹……
- Data Lake (XIV): spark and iceberg integrated query operation
- Hiengine: comparable to the local cloud native memory database engine
- Using graylog alarm function to realize the regular work reminder of nail group robots
- Record a 'very strange' troubleshooting process of cloud security group rules
- 数据访问 - EntityFramework集成
- DenseNet
猜你喜欢

如何将mysql卸载干净

Solution of vant tabbar blocking content

Basic introduction to the control of the row component displaying its children in the horizontal array (tutorial includes source code)

Summary of PHP pseudo protocol of cisp-pte

How was the middle table destroyed?

Accès aux données - intégration du cadre d'entité

Reduce the cost by 40%! Container practice of redis multi tenant cluster

【刷题篇】鹅厂文化衫问题

Summary of methods for finding intersection of ordered linked list sets

【学术相关】多位博士毕业去了三四流高校,目前惨不忍睹……
随机推荐
DenseNet
Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
Summary of PHP pseudo protocol of cisp-pte
Research and development efficiency measurement index composition and efficiency measurement methodology
Flet教程之 09 NavigationRail 基础入门(教程含源码)
Seaborn draws 11 histograms
How can programmers improve their situation?
tf.sequence_mask函数讲解案例
Cartoon: what is MapReduce?
[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details
The memory of a Zhang
自己要有自己的坚持
How to uninstall MySQL cleanly
帮忙看看是什么问题可以吗?[ERROR] Could not execute SQL stateme
清晰还原31年前现场,火山引擎超清修复Beyond经典演唱会
Cs231n notes (bottom) - applicable to 0 Foundation
[深度学习][原创]让yolov6-0.1.0支持yolov5的txt读取数据集模式
Apple 已弃用 NavigationView,使用 NavigationStack 和 NavigationSplitView 实现 SwiftUI 导航
Hiengine: comparable to the local cloud native memory database engine
How to use FRP intranet penetration +teamviewer to quickly connect to the intranet host at home when mobile office