LXC container with Edge (3.2.3+) networking fails to start
-
Create container + fix it up so it will actually run lxc-create -t alpine-latest -n dev-alpine -- --release edge printf "\n# allow container to start\nlxc.aa_allow_incomplete = 1" >> /var/lib/lxc/dev-alpine/config printf "nameserver 127.0.0.1\nnameserver 8.8.8.8\nnameserver 8.8.4.4\n" > /var/lib/lxc/dev-alpine/rootfs/etc/resolv.conf chroot /var/lib/lxc/dev-alpine/rootfs passwd
-
lxc-start -n dev-alpine -F
OpenRC 0.17.c3aa1460 is starting up Linux 3.19.8-031908-generic (x86_64) [LXC]
- /proc is already mounted
- /run/openrc: creating directory
- /run/lock: creating directory
- /run/lock: correcting owner
- Caching service dependencies ... [ ok ]
- Migrating /var/lock to /run/lock ... [ ok ]
- Migrating /var/run to /run ... [ ok ]
- Creating user login records ... [ ok ]
- Wiping /tmp directory ... [ ok ]
- Starting busybox syslog ... [ ok ]
Welcome to Alpine Linux 3.2 Kernel 3.19.8-031908-generic on an x86_64 (/dev/console)
dev-alpine login:
- No networking appears to start by default. Test networking to make sure it never started.
lxc-attach -n dev-alpine ping google.com ping: bad address 'google.com'
- Try to start networking.
lxc-attach -n dev-alpine /etc/init.d/networking start
- Starting networking ...
- lo ... [ !! ]
- eth0 ... [ !! ]
- ERROR: networking failed to start
- Contents of interfaces... cat /var/lib/lxc/dev-alpine/rootfs/etc/network/interfaces auto lo iface lo inet loopback
auto eth0 iface eth0 inet dhcp
- Processes running, which include no dhcp related daemon...
lxc-attach -n dev-alpine ps auxww PID USER TIME COMMAND 1 root 0:00 init 172 root 0:00 /sbin/syslogd 178 root 0:00 /sbin/getty 38400 console 179 root 0:00 /sbin/getty 38400 tty1 180 root 0:00 /sbin/getty 38400 tty2 181 root 0:00 /sbin/getty 38400 tty3 182 root 0:00 /sbin/getty 38400 tty4 197 root 0:00 ps auxww
I'm unsure if the fix for this bug should be rolled into the LXC Alpine template or placed into http://wiki.alpinelinux.org/wiki/Configure_Networking in an LXC section.
Someone let me know the correct way to...
-
Get networking to start inside an LXC container, including any changes to /etc/network/interfaces that may be required.
-
Acquire IP inside guest container from host, which is usually done via dhclient, which doesn't exist in the Alpine LXC base install.
Thanks.
-
(from redmine: issue id 4617, created on 2015-09-06, closed on 2015-10-27)