当前位置:网站首页>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
边栏推荐
- Single merchant v4.4 has the same original intention and strength!
- 一些认知的思考
- Deep learning plus
- 【刷题篇】鹅厂文化衫问题
- Mongodb getting started Tutorial Part 04 mongodb client
- Cartoon: what is MapReduce?
- Facing new challenges and becoming a better self -- attacking technology er
- How to uninstall MySQL cleanly
- Binary tree related OJ problems
- If you can't afford a real cat, you can use code to suck cats -unity particles to draw cats
猜你喜欢

Pspnet | semantic segmentation and scene analysis

Migrate /home partition

中间表是如何被消灭的?

Starkware: to build ZK "universe"

文件操作--I/O

OneForAll安装使用

Jarvis OJ Flag

Cs231n notes (bottom) - applicable to 0 Foundation

Bs-xx-042 implementation of personnel management system based on SSM

Win11提示无法安全下载软件怎么办?Win11无法安全下载软件
随机推荐
Solution of vant tabbar blocking content
Flet教程之 11 Row组件在水平数组中显示其子项的控件 基础入门(教程含源码)
"21 days proficient in typescript-3" - install and build a typescript development environment md
What is the difference between EDI license and ICP business license
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]
How does win11 change icons for applications? Win11 method of changing icons for applications
[es6] add if judgment or ternary operator judgment in the template string
Games101 notes (II)
【刷题篇】有效的数独
Apple has abandoned navigationview and used navigationstack and navigationsplitview to implement swiftui navigation
Jarvis OJ shell traffic analysis
数据访问 - EntityFramework集成
Jarvis OJ Flag
Cartoon: what is the eight queens problem?
《21天精通TypeScript-3》-安装搭建TypeScript开发环境.md
StarkWare:欲构建ZK“宇宙”
Can you help me see what the problem is? [ERROR] Could not execute SQL stateme
Apple 已弃用 NavigationView,使用 NavigationStack 和 NavigationSplitView 实现 SwiftUI 导航
Yarn common commands
Cs231n notes (bottom) - applicable to 0 Foundation