wsl问题
修改wsl的所占硬盘/安装目录
1.查看版本
wsl -l -v
2.导出分发版为tar文件到d盘
wsl --export 版本 地址\ubuntu.tar
3.注销当前分发版
wsl --unregister 版本
4.重新导入并安装分发版在d:\ubuntu
wsl --import 版本 安装地址 导出的文件 --version 2
5.设置默认登陆用户为安装时用户名
版本 config --default-user Username
6.可以删掉导出的tar但是不能卸载c盘的ubuntu,不要问我怎么知道的,因为我卸载后报错了,得重新安装了。
使用 root 用户
WSL 默认是没有设置 root 密码的
设置 root 用户密码, 这样要输三次命令, 第一次当前用户密码, 后两次就是设置密码以及确认密码
sudo passwd root
System has not been booted with systemd as init system (PID 1).
System has not been booted with systemd as init system (PID 1). Can’t operate. Failed to connect to bus: Host is down
没有安装systemlctl
windows访问wsl没有权限
修改默认登录用户
ubuntu config --default-user root