[Lxc-users] Launch multiple apps in exactly on container

Daniel Lezcano dlezcano at fr.ibm.com
Thu Sep 16 08:24:17 UTC 2010


On 09/16/2010 09:36 AM, Jue Hong wrote:
> As I understand, running one application with the command lxc-execute
> will create a container instance. E.g., by running lxc-execute -n foo
> /bin/bash, a container named foo will be created, and I can find a foo
> directory under the mounted cgroup directory, like /dev/cgroup/foo.
> While retype lxc-execute -n foo /bin/bash, I'm told that:lxc-execute:
> Device or resource busy.
>
> Does it mean I cannot run multiple apps within exactly the same
> container foo via using lxc-execute or lxc-start? Or what should I do
> if it's possible?

The name is unique for the container. You can not start a container if 
it is already running. In your case you should do:

lxc-execute -n foo /bin/bash
lxc-execute -n bar /bin/bash

If you want to use the same configuration for both, you can supply these 
to the command line with the -f option.

lxc-execute -n foo -f lxc.conf /bin/bash
lxc-execute -n bar -f lxc.conf /bin/bash

You can also pass the configuration parameters with:

lxc-execute -n foo -s lxc.utsname=foo /bin/bash
lxc-execute -n bar -s lxc.utsname=bar /bin/bash

Cheers
   -- Daniel




More information about the lxc-users mailing list