[lxc-devel] Regarding lxc-attach and lxc-device commands

Dwight Engen dwight.engen at oracle.com
Mon Jun 23 13:44:05 UTC 2014


On Mon, 23 Jun 2014 12:30:05 +0530
vinish ramachandran <vinishr at gmail.com> wrote:

> Hi All,
> 
> I have installed the latest lxc version (1.0.3-2) from 'Rawhide' and
> created a new container with default template on my fedora-21 machine
>     [root at localhost ~]# lxc-ls
>     test1
> 
> When i try to run "ifconfig" command in my container bash shell it
> throws the error
>    [root at test1 ~]# ifconfig
>    -bash: ifconfig: command not found

Newer versions of Fedora don't install ifconfig by default. If you want
to use ifconfig instead of ip

  yum -y install net-tools

>    [root at test1 ~]#
> 
> so i run the attach command from host machine and again got the
> following error
>     [root at localhost ~]# lxc-attach -n test1 -- ifconfig
>     lxc_container: No such file or directory - failed to exec
> 'ifconfig'
> 
> but "ip link" command works with lxc-attach command.
> 
> [root at localhost ~]# lxc-attach -n test1 -- ip link
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
> mode DEFAULT group default
>     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> 8: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
> state UP mode DEFAULT group default qlen 1000
>     link/ether 1a:d2:4f:5d:bd:7c brd ff:ff:ff:ff:ff:ff
> 
> 
> Should i do anything extra to get the ifconfig comand to work in
> container ??
> 
> Regarding lxc-device:
> 
> From man page i can see that lxc-device curently supports just "add"
> device option.Is the remove option a "work under progress" or the
> only way to remove device is to stop the container.
> 
> 
> Thanks
> Vinish



More information about the lxc-devel mailing list