在Windows11中安装WSL的记录


一、WSL简易安装

win+r打开运行,输入cmd并回车

> wsl --install %安装wsl,默认是Ubuntu发行版%
请求的操作需要提升。
正在安装: 虚拟机平台
已安装 虚拟机平台。
正在安装: 适用于 Linux 的 Windows 子系统
已安装 适用于 Linux 的 Windows 子系统。
正在安装: Ubuntu
已安装 Ubuntu。
请求的操作成功。直到重新启动系统前更改将不会生效。

重启以后,再次执行安装命令

> wsl --install %安装wsl,默认是Ubuntu发行版%
Ubuntu 已安装。
正在启动 Ubuntu...
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80370114
Error: 0x80370114 ??????????????????

Press any key to continue...

设置应用可选功能更多Windows功能,启用适用于Linux的Windows子系统
第三次执行安装命令,并设置用户名(小写开头)与密码,成功!!!

> wsl --install
Ubuntu 已安装。
正在启动 Ubuntu...
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: Rick
adduser: Please enter a username matching the regular expression configured
via the NAME_REGEX[_SYSTEM] configuration variable.  Use the `--force-badname'
option to relax this check or reconfigure NAME_REGEX.
Enter new UNIX username: rick
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage


This message is shown once a day. To disable it please create the
/home/rick/.hushlogin file.
rick@DESKTOP-4FVEAKU:~$ #自动进入Linux的命令行

二、检查正在运行的WSL版本

> wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Running         2

默认是WSL2

三、运行WSL

> ubuntu  # 运行已安装的发行版名称

或者

> wsl   # 运行默认的Linux发行版

引用

如何使用 WSL 在 Windows 上安装 Linux

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值