[Lxc-users] starting container requires re-login?
Fajar A. Nugraha
list at fajar.net
Thu May 10 01:20:40 UTC 2012
On Thu, May 10, 2012 at 8:17 AM, 张章 <zhang_zhang at live.com> wrote:
> Many thanks
>
> I switch to Ubuntu 12.04 and use lxc-ubuntu to prepare my filesystem. Then I
> add the network part to config file like:
>
> lxc.utsname = amd64
> lxc.tty = 4
> lxc.pts = 1024
>
> lxc.rootfs = /lxc/rootfs
> lxc.mount = /lxc/fstab
> lxc.network.type = veth
> lxc.network.flags = up
> lxc.network.link = br0
> lxc.network.name = eth0
> lxc.network.ipv4 = 10.5.0.122/24
>
> lxc.cgroup.devices.deny = a
> # /dev/null and zero
> lxc.cgroup.devices.allow = c 1:3 rwm
> lxc.cgroup.devices.allow = c 1:5 rwm
> # consoles
> lxc.cgroup.devices.allow = c 5:1 rwm
> lxc.cgroup.devices.allow = c 5:0 rwm
> #lxc.cgroup.devices.allow = c 4:0 rwm
> #lxc.cgroup.devices.allow = c 4:1 rwm
> # /dev/{,u}random
> lxc.cgroup.devices.allow = c 1:9 rwm
> lxc.cgroup.devices.allow = c 1:8 rwm
> lxc.cgroup.devices.allow = c 136:* rwm
> lxc.cgroup.devices.allow = c 5:2 rwm
> # rtc
> lxc.cgroup.devices.allow = c 254:0 rwm
> #fuse
> lxc.cgroup.devices.allow = c 10:229 rwm
>
> And now container can start , but the network fails to be configured with
> the ip i assigned.
> After i login to container, and get the ip like "inet addr:69.69.69.23 "
>
> Do i miss something?
First of all, make sure you've configured br0 bridge properly.
Second, the ip address configured in lxc config file can be overide
inside the container (e.g. when you have static ip in
/etc/network/interfaces), so I think that's what happened.
--
Fajar
More information about the lxc-users
mailing list