[Lxc-users] LXC no connectivity after first "boot" of the guest

Klemens Rauch klemens.rauch at rolmail.net
Fri Aug 10 08:23:23 UTC 2012


Hi,

I'm a beginner with lxc and and have been making my way thru the 
documentation and several mailing lists.

Now I have problem which I can't resolve by myself.
First of all some general Information about my Infrastructure:
I'm running a Debian Squeeze Server with a (3.2.0-0.bpo.2-amd64) Kernel,
running lxc (0.8.0~rc1-8) from testing repositories.
cgroups mounted, bridge-utils installed and configured, debootstrap and 
libvirt-bin too.

I made 4 wheezy guests via:
lxc-create -n xxx -t debian

Went thru the process everything was fine than I updated/modified the
/etc/network/interface file,
the /etc/hosts file,
reconfigured the openssh-server
modified the /etc/inittab
added the hostname
and fixed the /etc/mtab
installed and configured shorewall.

Than I started the container with the folowing output:
INIT: version 2.88 booting
[info] Using makefile-style concurrent boot in runlevel S.
hostname: you must be root to change the host name
mount: permission denied
mount: permission denied
mount: permission denied
mount: permission denied
[ ok ] Activating swap...done.
mount: permission denied
mount: permission denied
mount: permission denied
mount: permission denied
[warn] Mount point '/dev/console' does not exist. Skipping mount. ... 
(warning).
[warn] Mount point '/dev/ptmx' does not exist. Skipping mount. ... 
(warning).
[ ok ] Activating lvm and md swap...done.
[....] Checking file systems...fsck from util-linux 2.20.1
done.
[ ok ] Mounting local filesystems...done.
[ ok ] Activating swapfile swap...done.
[ ok ] Cleaning up temporary files....
[ ok ] Configuring network interfaces...done.
[ ok ] Cleaning up temporary files....
[ ok ] Setting kernel variables ...done.
Starting "Shorewall firewall": done.
Starting "Shorewall6 firewall": done.
[FAIL] startpar: service(s) returned failure: hostname.sh hwclock.sh ... 
failed!
INIT: Entering runlevel: 2
[info] Using makefile-style concurrent boot in runlevel 2.
[ ok ] Starting enhanced syslogd: rsyslogd.
[ ok ] Starting periodic command scheduler: cron.
[ ok ] Starting MTA: exim4.
[ ok ] Starting OpenBSD Secure Shell server: sshd.

and following config:
## Container
lxc.utsname                             = srv
lxc.rootfs                              = /var/lib/lxc/srv/rootfs
lxc.arch                                = x86_64
#lxc.console                            = /var/log/lxc/srv.console
lxc.tty                                 = 6
lxc.pts                                 = 1024

## Capabilities
lxc.cap.drop                            = mac_admin
lxc.cap.drop                            = mac_override
lxc.cap.drop                            = sys_admin
lxc.cap.drop                            = sys_module

lxc.cgroup.devices.deny                 = a

lxc.cgroup.devices.allow                = c *:* m
lxc.cgroup.devices.allow                = b *:* m

lxc.cgroup.devices.allow                = c 5:1 rwm
lxc.cgroup.devices.allow                = c 10:229 rwm
lxc.cgroup.devices.allow                = c 1:3 rwm
lxc.cgroup.devices.allow                = c 5:2 rwm
lxc.cgroup.devices.allow                = c 136:* rwm
lxc.cgroup.devices.allow                = c 1:8 rwm
lxc.cgroup.devices.allow                = c 254:0 rwm
lxc.cgroup.devices.allow                = c 5:0 rwm
lxc.cgroup.devices.allow                = c 1:9 rwm
lxc.cgroup.devices.allow                = c 1:5 rwm

## Filesystem
lxc.mount.entry                         = proc 
/var/lib/lxc/srv/rootfs/proc proc nodev,noexec,nosuid 0 0
lxc.mount.entry                         = sysfs 
/var/lib/lxc/srv/rootfs/sys sysfs defaults,ro 0 0

lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.hwaddr = 00:50:56:00:1A:BA
lxc.network.ipv4 = 176.9.xxx.xxx/24
lxc.network.name = eth0



lxc-console -n xxx worked and I came to the login mask, so did SSH.

Now comes the strange thing. I stopped the guest via:
lxc-stop -n xxx
Guest goes down... now I restarted it, it went up with the same
output, but this time I'm not able to access the Internet.
SSH outputs only: cannot connect to host.
Login via lxc-console works I'm on the guest but cannot make a ping or
anything else.
Same behaviour with the other 3 guests. First boot everything works like
a charm than after the first time no connectivity to the rest of the world.
ip a output:
11: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast 
state UP qlen 1000
     link/ether 00:50:56:00:1a:ba brd ff:ff:ff:ff:ff:ff
     inet 176.9.xxx.xxx/24 brd 176.9.xxx.255 scope global eth0
     inet6 fe80::250:56ff:fe00:1ab7/64 scope link
     valid_lft forever preferred_lft forever
13: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
     inet 127.0.0.1/8 scope host lo
     inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever

In Kernel Log, Syslog and dmesg Log nothing strange...

I don't have a clue what else to do.
Did I forgot something?
I hope someone can help...

If you need any further information don't hesitate to ask.

Greets
Klemens







More information about the lxc-users mailing list