Frustrated lxc inconsistence: stopping instead of running

Any help appreciated.

Issues:

  • Can only create, start using sudo
  • Containers will no longer start: lxc-start: test2: lxccontainer.c: wait_on_daemonized_start: 834 Received container state “STOPPING” instead of “RUNNING”
    The container failed to start.
  • The container start error above is possibly linked to network failure; error below.
  • Good up to date Mint tutorial? Graber’s page is great but not mint specific and some commands are deprecated.

System: “Linux Mint 18 Sarah”, LXC 3.01

More Information:
Just got lxc to work yesterday. Had to explicitly install apparmor because I was getting security errors but apparmor status tools did not exist. I thought this odd, and it may be relevant. Persevered, was able to debug and run containers. I’ve moved /var/lib/lxc to another drive via symbolic link for space issue reasons (planned number/size of containers). Again still able to run containers.

At some point I shut the machine down and when I came back I could not get containers, existing or new to start. I can still create containers using sudo but can not start them. Initially start errors were due to my own stupidity, -f not -F which gave failed to load rcfile, then due to some hidden change in lxc configuration.

  • systemctl status lxc.service shows active (exited), same status as yesterday. Explicitly starting the service doesn’t change anything.
  • lxc-checkconfig shows all enabled, green. No apparent differences from when containers would start and work.

Network Error in Logfile

$ sudo lxc-start -F -d -n test2 --logfile y.txt
lxc-start: test2: lxccontainer.c: wait_on_daemonized_start: 834 Received container state “STOPPING” instead of “RUNNING”
The container failed to start.
To get more details, run the container in foreground mode.
Additional information can be obtained by setting the --logfile and --logpriority options.

$ cat y.txt
lxc-start test2 20180812140431.766 ERROR lxc_utils - utils.c:run_command:2280 - failed to exec command
lxc-start test2 20180812140431.767 ERROR lxc_network - network.c:lxc_ovs_attach_bridge:1893 - Failed to attach “lxcbr0” to openvswitch bridge “vethFAW5A2”: lxc-start: test2: utils.c: run_command: 2280 failed to exec comman
lxc-start test2 20180812140431.767 ERROR lxc_network - network.c:instantiate_veth:198 - Failed to attach “vethFAW5A2” to bridge “lxcbr0”: Operation not permitted
lxc-start test2 20180812140431.814 ERROR lxc_network - network.c:lxc_create_network_priv:2452 - Failed to create network device
lxc-start test2 20180812140431.814 ERROR lxc_start - start.c:lxc_spawn:1579 - Failed to create the network
lxc-start test2 20180812140431.814 ERROR lxc_start - start.c:__lxc_start:1887 - Failed to spawn container “test2”
lxc-start test2 20180812140431.814 ERROR lxc_container - lxccontainer.c:wait_on_daemonized_start:834 - Received container state “STOPPING” instead of “RUNNING”

I faced similar issue, and it got resolved upon creating the bridge. Following command used to create bridge:

“sudo brctl addbr brs1s2”

where ‘brs1s2’ is the bridge-name in my case.