[Lxc-users] how to execute shell command in container ?

Sebastien Pahl seb at dotcloud.com
Fri Mar 18 18:59:30 UTC 2011


There is a command call lxc-attach which does just what you want.
However you need these patches:
http://lxc.sourceforge.net/patches/linux/2.6.35/2.6.35-lxc1/

They don't apply on newer kernels:-(

Is there a newer version of the patches somewhere? How far along is
the process of getting them into the kernel?

On Fri, Mar 18, 2011 at 11:52, Andrian Nord <nightnord at gmail.com> wrote:
> On Fri, Mar 18, 2011 at 12:26:32PM +0300, Vladimir Laskov wrote:
>> # lxc-execute --name vm1  /bin/bash
>> lxc-execute: failed to create veth1-vethAmmjfi : File exists
>> lxc-execute: failed to create netdev
>> lxc-execute: failed to create the network
>> lxc-execute: failed to spawn 'vm1'
>> lxc-execute: Device or resource busy - failed to remove cgroup '/cgroup/vm1'
>
> lxc-execute is some kind of wrapper around lxc-start that allows you to
> start single program in separate namespace, without starting full
> distribution. See manpage for more information.
>
> AFAIK, there is no way to interact with container except ssh or
> lxc-console, yet. You may use ssh with not encrypted key for scripting
> purposes.
>
> ------------------------------------------------------------------------------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
>
>



-- 
Sebastien Pahl
http://www.dotcloud.com
@sebp, @dot_cloud




More information about the lxc-users mailing list