Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.