[Lxc-users] Executing a command inside a container?

Ulli Horlacher framstag at rus.uni-stuttgart.de
Mon Oct 8 08:00:05 UTC 2012


On Thu 2012-08-30 (07:48), Serge Hallyn wrote:
> Quoting Dan Kegel (dank at kegel.com):
> 
> > Man, this has got to be an FAQ.
> > 
> > I'm merrily scripting buildbot setup inside a container, and tried to do
> >   sudo lxc-start -n foo  sh my-existing-setup-script.sh
> 
> The answer to this *will* be lxc-attach.  We're just waiting for the
> final kernel bits to filter upstream.
> 
> So yeah ssh is probably the most robust solution for now.

I do it with "lxc -x", example:


root at zoo:~# lxc -x fex uname -a
Linux fex.uni-stuttgart.de 2.6.38-16-server #67~lucid1-Ubuntu SMP Fri Sep 7 18:36:10 UTC 2012 x86_64 GNU/Linux

root at zoo:~# lxc -h
usage: lxc option
options: -l  list containers
         -L  list containers with disk usage
         -p  list all container processes

usage: lxc [-v] -C container [gateway/net:interface]
options: -v  verbose mode
         -C  create new container clone
example: lxc -C bunny 129.69.8.254/24:br8

usage: lxc [-v] option container
options: -v  verbose mode
         -b  boot container
         -c  connect container console
         -e  edit container configuration
         -x  execute command in container
         -s  shutdown container
         -p  list container processes
         -l  container process list tree


http://fex.rus.uni-stuttgart.de/lxc.html


-- 
Ullrich Horlacher              Informationssysteme und Serverbetrieb
Rechenzentrum IZUS/TIK         E-Mail: horlacher at rus.uni-stuttgart.de
Universitaet Stuttgart         Tel:    ++49-711-68565868
Allmandring 30a                Fax:    ++49-711-682357
70550 Stuttgart (Germany)      WWW:    http://www.rus.uni-stuttgart.de/
REF: <20120830124825.GA8474 at amd1>




More information about the lxc-users mailing list