提示:基于WSL 的Ubuntu 20.04 LTS 可以参考
前言
提示:我会一直补充,初级入门指令
提示:下面案例可供参考
一、Ubuntu 20.04 LTS
WSL 安装的 Ubuntu 下 验证的指令,与其它方式的Ubuntu安装的指令有所不同,仅供参考
二、列表
1.修改密码
一般情况下,刚安装完Linux会需要设置密码
root@Frank-PC-Company:~# passwd
New password:
Retype new password:
passwd: password updated successfully
2.查看Ubuntu系统下ip
每次重启Ubuntu,IP会变,后面会单独发一下,固定WSL下ip的探索文章,此处先动态获取ip使用
root@Frank-PC-Company:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 96:41:be:88:2f:ba brd ff:ff:ff:ff:ff:ff
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 06:92:a5:83:04:f4 brd ff:ff:ff:ff:ff:ff
4: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
link/ipip 0.0.0.0 brd 0.0.0.0
5: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
link/sit 0.0.0.0 brd 0.0.0.0
6: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:f3:b3:c0 brd ff:ff:ff:ff:ff:ff
inet 172.27.94.197/20 brd 172.27.95.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::215:5dff:fef3:b3c0/64 scope link
valid_lft forever preferred_lft forever
3.重启系统
WSL 下的linux子系统,reboot指令是失效的
root@Frank-PC-Company:~# reboot
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
Failed to talk to init daemon.
root@Frank-PC-Company:~# sudo reboot
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
Failed to talk to init daemon.
解决办法 回Windows,用 CMD 执行 (注意:用管理员权限启动CMD)
C:\WINDOWS\system32>net stop LxssManager
LxssManager 服务正在停止.
LxssManager 服务已成功停止。
C:\WINDOWS\system32>net start LxssManager
LxssManager 服务正在启动 .
LxssManager 服务已经启动成功。
总结
简简单单用Ubuntu 20.04