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'm switching from OpenVZ to lxc. The one thing that is really bugging me is that I can't find a lxc alternative to vzctl exec. Before on OpenVZ I could do vzctl exec 1033 restart nginx. Now, all I can figure out to do is either run sshd in every container or use lxc-console, and I don't like either option (the first is too much management overhead, the second is too much of a hassle).

share|improve this question
up vote 1 down vote accepted

Have you tried lxc-attach instead? According the documentation,

lxc-attach - start a process inside a running container.

Example to list all folders inside home of the container

lxc-attach -n myContainer -- ls -lh /home

If no process is defined, it creates a new shell inside the container.

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.