(使用 WSL ubuntu 应用程序)系统尚未以系统作为初始系统 (PID 1) 启动。无法操作
(using WSL ubuntu app) system has not been booted with system as init system (PID 1). Can't operate
我是 Ubuntu 的第一个用户。我在wmware中安装Ubuntu失败,所以我在Microsoft app store中安装了Ubuntu应用程序,一切正常。
但是当我插入 shutdown 或 halt 命令来关闭我的 ubuntu 电源时,我一直收到“系统尚未以系统作为初始系统(PID 1)启动”。无法操作'错误信息。
我尝试在 link (https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/) 之后使用 docker,但我多次进入第 2 个过程后失败了。我不确定我的失败是因为安装 docker 收费站而不是普通收费站。 (我的电脑只是 windows 10。不是 windows pro)
我想我必须尝试其他的东西。如果你不介意我问,我该如何解决这个问题?
(还有一个。如果我只单击右侧顶部的 'X' 按钮,与使用 'halt' 或 'shutdown' 关闭 Ubuntu 有什么不同命令?
谢谢
首先,通过 MS Store 安装的 Ubuntu 使用 WSL(Windows Linux 的子系统)技术。它只是意味着没有虚拟化,Windows 和 Linux 内核并存(Linux 内核尚未完全实现)。
因此,如果您尝试“关闭您的 Ubuntu”,您将像 Windows 那样关闭整个计算机。但在这种情况下,WSL 显然无权这样做。
换句话说,您可以像查看任何其他终端一样查看您的 Ubuntu bash window,例如CMD 或 PowerShell。
当您在 WSL (Ubuntu) 中启动程序时,您也可以在 Windows 任务管理器中看到它 - 这只是一个证明,没有虚拟化。
关于docker:
如果我没记错的话 Windows 10 Home 不提供 Hyper-V 虚拟化。这意味着你必须使用不同的,例如通过使用 VirtualBox。为了让它发挥作用,我可以推荐你关注this tutorial and especially for VirtualBox please check this answer here
希望对您有所帮助:)
我发现这很有用:https://linuxhandbook.com/system-has-not-been-booted-with-systemd/
就我而言
# start docker using systemctl
sudo systemctl docker start
# returns:
#
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
基本建议是:
# check if your system is using `systemd` or `sysvinit`
ps -p 1 -o comm=
如果命令没有 return systemd
,在我的例子中,WSL 上的 Ubuntu-20.04,命令 returned init
, 然后使用命令 pattern
# start services using sysvinit
service docker start
这对我有用。
我是 Ubuntu 的第一个用户。我在wmware中安装Ubuntu失败,所以我在Microsoft app store中安装了Ubuntu应用程序,一切正常。 但是当我插入 shutdown 或 halt 命令来关闭我的 ubuntu 电源时,我一直收到“系统尚未以系统作为初始系统(PID 1)启动”。无法操作'错误信息。
我尝试在 link (https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/) 之后使用 docker,但我多次进入第 2 个过程后失败了。我不确定我的失败是因为安装 docker 收费站而不是普通收费站。 (我的电脑只是 windows 10。不是 windows pro)
我想我必须尝试其他的东西。如果你不介意我问,我该如何解决这个问题?
(还有一个。如果我只单击右侧顶部的 'X' 按钮,与使用 'halt' 或 'shutdown' 关闭 Ubuntu 有什么不同命令?
谢谢
首先,通过 MS Store 安装的 Ubuntu 使用 WSL(Windows Linux 的子系统)技术。它只是意味着没有虚拟化,Windows 和 Linux 内核并存(Linux 内核尚未完全实现)。
因此,如果您尝试“关闭您的 Ubuntu”,您将像 Windows 那样关闭整个计算机。但在这种情况下,WSL 显然无权这样做。
换句话说,您可以像查看任何其他终端一样查看您的 Ubuntu bash window,例如CMD 或 PowerShell。
当您在 WSL (Ubuntu) 中启动程序时,您也可以在 Windows 任务管理器中看到它 - 这只是一个证明,没有虚拟化。
关于docker: 如果我没记错的话 Windows 10 Home 不提供 Hyper-V 虚拟化。这意味着你必须使用不同的,例如通过使用 VirtualBox。为了让它发挥作用,我可以推荐你关注this tutorial and especially for VirtualBox please check this answer here
希望对您有所帮助:)
我发现这很有用:https://linuxhandbook.com/system-has-not-been-booted-with-systemd/
就我而言
# start docker using systemctl
sudo systemctl docker start
# returns:
#
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
基本建议是:
# check if your system is using `systemd` or `sysvinit`
ps -p 1 -o comm=
如果命令没有 return systemd
,在我的例子中,WSL 上的 Ubuntu-20.04,命令 returned init
, 然后使用命令 pattern
# start services using sysvinit
service docker start
这对我有用。