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).
Asked
Active
Viewed 270 times
3

Joshua D. Boyd
- 185
- 8
1 Answers
1
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.

Xavi Ivars
- 126
- 3