当前位置:网站首页>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
边栏推荐
- yarn 常用命令
- Global Data Center released DC brain system, enabling intelligent operation and management through science and technology
- 为季前卡牌游戏 MotoGP Ignition Champions 做好准备!
- OneForAll安装使用
- File operation --i/o
- 极坐标扇图使用场景与功能详解
- 详解SQL中Groupings Sets 语句的功能和底层实现逻辑
- 关于new Map( )还有哪些是你不知道的
- 麻烦问下,DMS中使用Redis语法是以云数据库Redis社区版的命令为参考的嘛
- tf. sequence_ Mask function explanation case
猜你喜欢

Enter a command with the keyboard

Global Data Center released DC brain system, enabling intelligent operation and management through science and technology

如何将mysql卸载干净

数据访问 - EntityFramework集成

用键盘输入一条命令
![[brush title] goose factory shirt problem](/img/c8/44496c767a778101cf3982bd911933.png)
[brush title] goose factory shirt problem

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

How to uninstall MySQL cleanly

Data Lake (XIV): spark and iceberg integrated query operation

Jarvis OJ webshell analysis
随机推荐
Binary tree related OJ problems
如何安装mysql
Cartoon: what is blue-green deployment?
Deep learning plus
搜索 正排索引 和 倒排索引 区别
Basic introduction to the control of the row component displaying its children in the horizontal array (tutorial includes source code)
[61dctf]fm
2020-2022两周年创作纪念日
Get ready for the pre-season card game MotoGP ignition champions!
Can you help me see what the problem is? [ERROR] Could not execute SQL stateme
PHP strict mode
[brush title] goose factory shirt problem
详解SQL中Groupings Sets 语句的功能和底层实现逻辑
BS-XX-042 基于SSM实现人事管理系统
Migrate /home partition
Detailed explanation of use scenarios and functions of polar coordinate sector diagram
How to use FRP intranet penetration +teamviewer to quickly connect to the intranet host at home when mobile office
Jarvis OJ 远程登录协议
Combined use of vant popup+ other components and pit avoidance Guide
Cheer yourself up