On Sat 2010-01-30 (14:20), Dominik Schulz wrote: > I'm fairly new to LXC and I am looking for a way to execute a command inside > a > running container (a full blow one with its own rootfs and full isolation). > lxc-execute doesn't seem to do the trick and lxc-console requires credential > to login.
It is not lxc-console which needs authentifcation, but it is login spawned from the getty on the virtual console. I found it useless to enter username/password via lxc-console, so I changed the tty daemon process inside the Ubuntu container to: root@vms2:/lxc# cat /lxc/ubuntu/etc/init/tty1.conf # tty1 - root shell # # This service opens root shell on tty1 start on stopped rc RUNLEVEL=[2345] stop on runlevel [!2345] respawn exec /bin/openvt -elfc 1 -- su -l But you cannot give an command argument to lxc-console. It is for interactive use only. Therefore I have written lxc (*) which talks to lxc-cmdd inside the container which then executes the command. Example: root@vms2:/lxc# uname -a Linux vms2 2.6.32-31-server #61-Ubuntu SMP Fri Apr 8 19:44:42 UTC 2011 x86_64 GNU/Linux root@vms2:/lxc# lxc -x vmtest8 uname -a Linux vmtest8 2.6.32-31-server #61-Ubuntu SMP Fri Apr 8 19:44:42 UTC 2011 x86_64 GNU/Linux (*) http://fex.rus.uni-stuttgart.de/download/lxc -- Ullrich Horlacher Server- und Arbeitsplatzsysteme Rechenzentrum E-Mail: horlac...@rus.uni-stuttgart.de Universitaet Stuttgart Tel: ++49-711-685-65868 Allmandring 30 Fax: ++49-711-682357 70550 Stuttgart (Germany) WWW: http://www.rus.uni-stuttgart.de/ ------------------------------------------------------------------------------ What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users