早上在使用WSL的时候报错了:
root@PC0:/home/zhang# systemctl start ssh.service
System has not been booted with systemd as init system (PID 1). Can't operate.
这个报错比较好解决,解决方法是使用service:
root@PC0:/home/zhang# service ssh status
* sshd is running
然后我尝试关机:
root@sidanzhang-PC0:/home/zhang# poweroff
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to talk to init daemon.
真坑,关机都报错。
根据这个回答:Rebooting Ubuntu on Windows without rebooting Windows? - Super User
解决方法是新开一个powershell的窗口,运行命令:
wsl --shutdown
如果你的win10系统还没更新,管理员权限运行命令:
net stop LxssManager

在使用Windows Subsystem for Linux(WSL)时遇到'Failed to talk to init daemon.'错误。通过运行'wsl --shutdown'命令尝试关闭WSL,但即使这样也出现关机错误。参考Super User上的答案,解决方案是在新的PowerShell窗口中以管理员权限运行'restart-wsl'命令,或者在未更新的Win10系统中运行带有管理员权限的'sudo wsl --shutdown'来重启WSL。
590

被折叠的 条评论
为什么被折叠?



