LXC: Failed to talk to init daemon and other errors
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
LXC: Failed to talk to init daemon and other errors
Hello!
I have an issue with LXC. I create under root a new container with command "lxc-create -n c7 -t download", then choose centos-7-amd64. It installs it. After that, if I do not setup network settings, I can lunch it with "lxc-start -d -n c7" command and even attach to it, but I cannot almost do anything.
For example, if I try reboot:
Quote:
root@c7:~# reboot
Failed to talk to init daemon.
If I set up network settings in the config file, than it doesn't start after that:
Quote:
lxc-start 20180225183041.667 ERROR lxc_network - network.c:setup_hw_addr:2680 - Failed to perform ioctl: Cannot assign requested address
lxc-start 20180225183041.667 ERROR lxc_network - network.c:lxc_setup_netdev_in_child_namespaces:2821 - Failed to setup hw address for network device "eth0"
lxc-start 20180225183041.667 ERROR lxc_network - network.c:lxc_setup_network_in_child_namespaces:2963 - failed to setup netdev
lxc-start 20180225183041.667 ERROR lxc_conf - conf.c:lxc_setup:3097 - failed to setup the network for 'c7'
lxc-start 20180225183041.667 ERROR lxc_start - start.c:do_start:1020 - Failed to setup container "c7".
lxc-start 20180225183041.667 ERROR lxc_sync - sync.c:__sync_wait:57 - An error occurred in another process (expected sequence number 5)
lxc-start 20180225183041.692 ERROR lxc_container - lxccontainer.c:wait_on_daemonized_start:754 - Received container state "ABORTING" instead of "RUNNING"
lxc-start 20180225183041.692 ERROR lxc_start - start.c:__lxc_start:1530 - Failed to spawn container "c7".
lxc-start 20180225183041.692 ERROR lxc_start_ui - tools/lxc_start.c:main:368 - The container failed to start.
lxc-start 20180225183041.692 ERROR lxc_start_ui - tools/lxc_start.c:main:370 - To get more details, run the container in foreground mode.
lxc-start 20180225183041.692 ERROR lxc_start_ui - tools/lxc_start.c:main:372 - Additional information can be obtained by setting the --logfile and --logpriority options.
My host system is Slackware64-current.
Container config file:
Quote:
root@lion:/var/lib/lxc/c7# cat config
# Template used to create this container: /usr/share/lxc/templates/lxc-download
# Parameters passed to the template: --flush-cache
# Template script checksum (SHA-1): 01d100d3f1129082777c82a0e3a66adcaeb5c37f
# For additional config options, please look at lxc.container.conf(5)
# Uncomment the following line to support nesting containers:
#lxc.include = /usr/share/lxc/config/nesting.conf
# (Be aware this has security implications)
# Distribution configuration
lxc.include = /usr/share/lxc/config/centos.common.conf
lxc.arch = x86_64
# Container specific configuration
lxc.rootfs = /var/lib/lxc/c7/rootfs
lxc.rootfs.backend = dir
lxc.utsname = c7
I have an issue with LXC. I create under root a new container with command "lxc-create -n c7 -t download", then choose centos-7-amd64. It installs it. After that, if I do not setup network settings, I can lunch it with "lxc-start -d -n c7" command and even attach to it, but I cannot almost do anything.
What do you mean by
Quote:
if I do not setup network settings
The network seems already set up and when I executed similar commands, it all ran as expected:
I just remembered that I already had some host side network preparation already done so that networking for new containers just works. Have a look at http://www.darlo.tv/lxc-14.2/network...slackware.html - set and forget (I did). The article mentions unprivileged containers but that's just because it's part of a series - it works for privileged containers too.
That (or similar) is what I have in my configuration. I didn't set it up explicitly; it was derived, when the container was first created, from settings I've made in /etc/lxc/default.conf. It has:
The main difference is the name of the nertwork.link (the host network interface to attach to) which is lxcbr0 in my case, br0 in your case. Either is OK provided it exists in the host.
BTW an alternative location for that configuration is ~/.config/lxc/default.conf
I did everything according to your article and now I can run container with user privileges. But I still cannot do anything in my guest system (just like when I run lxc containers under root) and get messages like:
Quote:
bash-4.4$ lxc-start -n m4
bash-4.4$ lxc-attach -n m4
bash-4.2# su -
[root@m4 ~]# export LC_ALL=en_US
[root@m4 ~]# reboot
Failed to talk to init daemon.
[root@m4 ~]# systemctl status httpd
Failed to get D-Bus connection: No such file or directory
I did everything according to your article and now I can run container with user privileges. But I still cannot do anything in my guest system (just like when I run lxc containers under root) and get messages like:
The reason to point to that article was to suggest a networking setup rather than all the stuff about creating unprivileged containers (although good to know that part of it still works).
Since you have the same problem with a second container, suspicion next falls on the host system - is it a stock 14.2 system (all packages installed, no funny business in /etc/rc.d/* files, etc.)?
In the meantime you could try running the lxc-start in the foreground e.g.
Code:
sudo lxc-start -n c7 -F
or even with a log file e.g.
Code:
sudo lxc-start -n c7 -F -o /tmp/c7.log
My resulting log file was empty - I presume because there were no errors in my case. Running the container in the foreground shows lots more extra stuff as the container starts up. This mode ends with a login prompt which won't work unless you previously set up a root password for the container, so use lxc-attach as before from a different terminal.
Hopefully one of these options may give some indication of what's going on.
My log is also empty, but output of your command is
Quote:
root@lion:~# lxc-start -n m7 -F
Failed to mount cgroup at /sys/fs/cgroup/systemd: Operation not permitted
[!!!!!!] Failed to mount API filesystems, freezing.
Freezing execution.
I use Slackware-current.
It (seems) started to work under root and under user after I've done:
But it worked without entering those commands earlier. So, do you know where those commands should be placed? I am not sure if the last command is necessary here.
Interesting. I don't see that error in 14.2 where there is no /sys/fs/cgroup/systemd directory.
In 14.2, lxc is at version 2.0.1 whereas current has lxc-2.0.9 - maybe it's just a version issue ...
Perhaps it's worth raising this issue in the "Requests for -current" thread to raise awareness there, just in case Pat & crew stopped watching this thread?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.