Ubuntu 20.04 容器无法在 Proxmox 中启动

Ubuntu 20.04 容器无法在 Proxmox 中启动

您好,我在 Proxmox 中创建了 Ubuntu 20.04 和 18.04 容器,当我通过 Proxmox GUI 创建容器后尝试启动它们时,两者都返回相同的错误。

它们无法启动并返回以下错误消息:

Job for [email protected] failed because the control process exited with error code.
See "systemctl status [email protected]" and "journalctl -xe" for details.
TASK ERROR: command 'systemctl start pve-container@100' failed: exit code 1

我发现了另一个听起来类似的 serverfault 问题]1,但错误略有不同,我甚至还没有进行任何设置。这些是通过 Proxmox 的官方位置直接下载的干净的 Ubuntu 模板。此外,当我设置 Proxmox I 和容器时,我将所有内容(包括所有存储内容)保留为默认设置。

我有点不清楚接下来要去哪里或做什么。

我还按照错误消息指示的详细信息执行了该journalctl -xe命令systemctl status,结果如下:

# journalctl -xe
-- Support: https://www.debian.org/support
-- 
-- An ExecStart= process belonging to unit [email protected] has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Killing process 14587 (lxc-start) with signal SIGKILL.
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Killing process 14648 (apparmor_parser) with signal SIGKILL.
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit [email protected] has entered the 'failed' state with result 'exit-code'.
May 06 17:53:56 ns500282 systemd[1]: Failed to start PVE LXC Container: 100.
-- Subject: A start job for unit [email protected] has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit [email protected] has finished with a failure.
-- 
-- The job identifier is 173480 and the job result is failed.
May 06 17:54:00 ns500282 systemd[1]: Starting Proxmox VE replication runner...
-- Subject: A start job for unit pvesr.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit pvesr.service has begun execution.
-- 
-- The job identifier is 173490.
May 06 17:54:00 ns500282 systemd[1]: pvesr.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit pvesr.service has successfully entered the 'dead' state.
May 06 17:54:00 ns500282 systemd[1]: Started Proxmox VE replication runner.
-- Subject: A start job for unit pvesr.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit pvesr.service has finished successfully.
-- 
-- The job identifier is 173490.

# systemctl status [email protected][email protected] - PVE LXC Container: 100
   Loaded: loaded (/lib/systemd/system/[email protected]; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2020-05-06 17:53:56 EDT; 2min 19s ago
     Docs: man:lxc-start
           man:lxc
           man:pct
  Process: 14579 ExecStart=/usr/bin/lxc-start -n 100 (code=exited, status=1/FAILURE)

May 06 17:53:54 ns500282 systemd[1]: Starting PVE LXC Container: 100...
May 06 17:53:56 ns500282 lxc-start[14579]: lxc-start: 100: lxccontainer.c: wait_on_daemonized_start: 874 Received container state "ABORTING" instead of "RUNNING"
May 06 17:53:56 ns500282 lxc-start[14579]: lxc-start: 100: tools/lxc_start.c: main: 329 The container failed to start
May 06 17:53:56 ns500282 lxc-start[14579]: lxc-start: 100: tools/lxc_start.c: main: 332 To get more details, run the container in foreground mode
May 06 17:53:56 ns500282 lxc-start[14579]: lxc-start: 100: tools/lxc_start.c: main: 335 Additional information can be obtained by setting the --logfile and --logpriority 
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Control process exited, code=exited, status=1/FAILURE
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Killing process 14587 (lxc-start) with signal SIGKILL.
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Killing process 14648 (apparmor_parser) with signal SIGKILL.
May 06 17:53:56 ns500282 systemd[1]: [email protected]: Failed with result 'exit-code'.
May 06 17:53:56 ns500282 systemd[1]: Failed to start PVE LXC Container: 100.

答案1

我认为您的问题与下一个问题相同: https://github.com/lxc/lxc/issues/2754

可能有两个解决方案。解决方案 1. 使用PIDFile=


[Service]
Type=forking
PIDFile=/run/lxc-%i.pid
ExecStart=/usr/bin/lxc-start -d -p /run/lxc-%i.pid -n %i
...

解决方案 2. 将类型从“forking”更改为“oneshot”

-Type=forking
+Type=oneshot
+RemainAfterExit=yes

相关内容