[libvirt-users] How can a user process be automatically started after the container is started?

Daniel P. Berrange berrange at redhat.com
Thu Oct 23 08:11:29 UTC 2014

On Thu, Oct 23, 2014 at 05:09:50AM +0000, WANG Cheng D wrote:
> Dear All,
> I want to start my application automatically after I start the container with a virsh command " virsh -c lxc:/// start mycontainer"
> How can I achieve this?

Whatever you specify as the <init>....</init> binary in the container
XML file is started when the container is created. If you only want
1 application to run, then this is straightforward. If you want to
run multiple applications either point the "init" binary to a shell
script to run the many things, or better yet use a real init system
like systemd to spawn off the things you need.

|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

More information about the libvirt-users mailing list