wsl配置ubuntu

https://learn.microsoft.com/zh-cn/windows/wsl/

D:\ProgramData\ubuntu>wsl --list --online
以下是可安装的有效分发的列表。
请使用“wsl --install -d <分发>”安装。

NAME            FRIENDLY NAME
Ubuntu          Ubuntu
Debian          Debian GNU/Linux
kali-linux      Kali Linux Rolling
openSUSE-42     openSUSE Leap 42
SLES-12         SUSE Linux Enterprise Server v12
Ubuntu-16.04    Ubuntu 16.04 LTS
Ubuntu-18.04    Ubuntu 18.04 LTS
Ubuntu-20.04    Ubuntu 20.04 LTS

D:\ProgramData\ubuntu>wsl --list --verbose
适用于 Linux 的 Windows 子系统没有已安装的分发版。
可以通过访问 Microsoft Store 来安装分发版:
https://aka.ms/wslstore

D:\ProgramData\ubuntu>wsl --set-default-version 2
操作成功完成。

D:\ProgramData\ubuntu>wsl --install -d Ubuntu-20.04
Ubuntu 20.04 LTS 已安装。
正在启动 Ubuntu 20.04 LTS…

D:\ProgramData\ubuntu>wsl --set-version Ubuntu-20.04 2
正在进行转换,这可能需要几分钟时间...
有关与 WSL 2 的主要区别的信息,请访问 https://aka.ms/wsl2
WSL 2 需要更新其内核组件。有关信息,请访问 https://aka.ms/wsl2kernel

更改阿里源
https://developer.aliyun.com/article/753753
写入阿里源部分为

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

移动文件路径
https://blog.csdn.net/WENGPJ/article/details/108520867
下载https://github.com/pxlrbt/move-wsl.git
安装shift右键,用powershell打开

虚拟机位置
\\wsl$

如果一开始就是用root登陆的,
则需要su wanghaoyue(用户名)回车,退出root

posted @ 2022-11-07 14:24  榴红八色鸫  阅读(187)  评论(0)    收藏  举报