[SOLVED] LXC Container didn't start

BJ78945

Well-Known Member
Apr 15, 2015
75
16
48
Hi,

I updated a few openvz container to lxc. One of them didn't start. I get the following message:

Code:
lxc-start -lDEBUG -o 151024082_start.log -F -n 151024082
close (rename) atomic file '/etc/hosts' failed: Die Operation ist nicht erlaubt
error in setup task PVE::LXC::Setup::pre_start_hook
lxc-start: conf.c: run_buffer: 342 Script exited with status 1
lxc-start: start.c: lxc_init: 436 failed to run pre-start hooks for container '151024082'.
lxc-start: start.c: __lxc_start: 1170 failed to initialize the container
lxc-start: lxc_start.c: main: 344 The container failed to start.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained by setting the --logfile and --logpriority options.

Logfile:
Code:
      lxc-start 1463469678.783 INFO     lxc_start_ui - lxc_start.c:main:264 - using rcfile /var/lib/lxc/151024082/config
      lxc-start 1463469678.783 WARN     lxc_confile - confile.c:config_pivotdir:1817 - lxc.pivotdir is ignored.  It will soon become an error.
      lxc-start 1463469678.784 WARN     lxc_cgmanager - cgmanager.c:cgm_get:994 - do_cgm_get exited with error
      lxc-start 1463469678.784 INFO     lxc_lsm - lsm/lsm.c:lsm_init:48 - LSM security driver AppArmor
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:324 - processing: .reject_force_umount  # comment this to allow umount -f;  not recommended.
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:426 - Adding native rule for reject_force_umount action 0
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:do_resolve_add_rule:216 - Setting seccomp rule to reject force umounts

      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:429 - Adding compat rule for reject_force_umount action 0
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:do_resolve_add_rule:216 - Setting seccomp rule to reject force umounts

      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:324 - processing: .[all].
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:324 - processing: .kexec_load errno 1.
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:426 - Adding native rule for kexec_load action 327681
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:429 - Adding compat rule for kexec_load action 327681
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:324 - processing: .open_by_handle_at errno 1.
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:426 - Adding native rule for open_by_handle_at action 327681
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:429 - Adding compat rule for open_by_handle_at action 327681
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:324 - processing: .init_module errno 1.
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:426 - Adding native rule for init_module action 327681
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:429 - Adding compat rule for init_module action 327681
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:324 - processing: .finit_module errno 1.
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:426 - Adding native rule for finit_module action 327681
      lxc-start 1463469678.784 WARN     lxc_seccomp - seccomp.c:do_resolve_add_rule:233 - Seccomp: got negative # for syscall: finit_module
      lxc-start 1463469678.784 WARN     lxc_seccomp - seccomp.c:do_resolve_add_rule:234 - This syscall will NOT be blacklisted
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:429 - Adding compat rule for finit_module action 327681
      lxc-start 1463469678.784 WARN     lxc_seccomp - seccomp.c:do_resolve_add_rule:233 - Seccomp: got negative # for syscall: finit_module
      lxc-start 1463469678.784 WARN     lxc_seccomp - seccomp.c:do_resolve_add_rule:234 - This syscall will NOT be blacklisted
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:324 - processing: .delete_module errno 1.
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:426 - Adding native rule for delete_module action 327681
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:429 - Adding compat rule for delete_module action 327681
      lxc-start 1463469678.784 INFO     lxc_seccomp - seccomp.c:parse_config_v2:436 - Merging in the compat seccomp ctx into the main one
      lxc-start 1463469678.784 INFO     lxc_conf - conf.c:run_script_argv:362 - Executing script '/usr/share/lxc/hooks/lxc-pve-prestart-hook' for container '151024082', config section 'lxc'
      lxc-start 1463469679.179 ERROR    lxc_conf - conf.c:run_buffer:342 - Script exited with status 1
      lxc-start 1463469679.179 ERROR    lxc_start - start.c:lxc_init:436 - failed to run pre-start hooks for container '151024082'.
      lxc-start 1463469679.179 ERROR    lxc_start - start.c:__lxc_start:1170 - failed to initialize the container
      lxc-start 1463469679.179 ERROR    lxc_start_ui - lxc_start.c:main:344 - The container failed to start.
      lxc-start 1463469679.179 ERROR    lxc_start_ui - lxc_start.c:main:348 - Additional information can be obtained by setting the --logfile and --logpriority options.
 
A little update. In the container runs a software which controles "/etc/hosts, /etc/hostname, /etc/resolv.conf". It is important that this files didn't change. Perhaps the software manufactor has changes something in the vm that this files cannot be changes. This could be the problem because on start up I get an error about "/etc/hosts" file.

Is there a way to say lxc to not touch this three files?
 
A little update. In the container runs a software which controles "/etc/hosts, /etc/hostname, /etc/resolv.conf". It is important that this files didn't change. Perhaps the software manufactor has changes something in the vm that this files cannot be changes. This could be the problem because on start up I get an error about "/etc/hosts" file.

Is there a way to say lxc to not touch this three files?

You can tell Proxmox to not change these files by creating a file with the same name, but prefixed with ".pve-ignore.". For eaxmple, if you want Proxmox to leave "/etc/hosts" alone, simply use "touch /etc/.pve-ignore.hosts" inside the container.
 
Ok, thank you. But I cannot start the VM. Is there an other way to start my vm?
 
I solved this now. I mounted the raw image with (mount -o loop image.raw /mount/point/) and then add this "pve-ignore" files. Now the vm starts. Thank you!
 
you can use "pct mount" to mount the file systems of a currently stopped container (don't forget to "pct unmount" after you are done), or "pct pull" / "pct push" to copy files from/to a running container.
 
I had a similar problem and it turned out one of the drives filled its quota (ran out of disk space). I gave it more space and it started right away.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!