Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a question about LXC Containers.

I have some containers, if I lxc-start them, they come up with networking fine, but I want to just be able to run commands against them using lxc-execute, without starting the whole thing. However, when I do this, there is no connectivity? - I guess as doesnt run init. How can I fix this?

share|improve this question

You're right, the network is not setup because lxc-execute just creates the container and runs your application. lxc-start runs /sbin/init, which takes care of the nitty-gritty.

You can use a script that sets up networking and then executes whatever you give it as the first parameter, something like:

ifup -a
if [ -x "$1" ]; then
    exec "$1"
echo "Something went wrong."

You could also configure the network parameters in the container configuration. In this case LXC will set up the network before it runs your application.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.