0

If tried creating both a armhf and a arm64/aarch64 lxc containers on my intel 64bit system.

I copied the relevant qemu file before starting the container. /usr/bin/qemu-arm-static for arm and /usr/bin/qemu-aarch64-static for arm64.

When I create other intel based ubuntu container my eth0 has an ipv4 address. (using bridged networking)

I create the arm64 container like this:

lxc launch ubuntu:15.04/arm64 arm64
cp /usr/bin/qemu-aarch64-static /usr/lib/lxd/containers/arm64/rootfs/usr/bin
lxc start arm64

I've made no other modifications.

In the arm64 container ifconfig displays:

eth0      Link encap:Ethernet  HWaddr 00:16:3e:e4:d2:de  
          inet6 addr: fe80::216:3eff:fee4:d2de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2564 (2.5 KB)  TX bytes:578 (578.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

trying the obvious things:

/etc/init.d/networking start

yeilds

[....] Starting networking (via systemctl): networking.serviceFailed to get D-Bus connection: No such file or directory
 failed!

ifup eth0 yields

/sbin/ifup: failed to open lockfile /run/network/.ifstate.lock: No such file or directory

ip addr yeilds

Cannot open netlink socket: Address family not supported by protocol

Address family not supported by protocol seems a common error message when running various different networking tools - presumably because no ipv4 address aren't recognized.

similarly dhcp client

root@ubuntu:/var/log# dhclient -v
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Error getting interfaces; Address family not supported by protocol
Can't get list of interfaces.

/etc/network/interfaces is

# The loopback network interface
auto lo
iface lo inet loopback

# Source interfaces
# Please check /etc/network/interfaces.d before changing this file
# as interfaces may have been defined in /etc/network/interfaces.d
# NOTE: the primary ethernet device is defined in
# /etc/network/interfaces.d/eth0
# See LP: #1262951

source /etc/network/interfaces.d/*.cfg

and the eth0.cfg is

# The primary network interface
auto eth0
iface eth0 inet dhcp

(incidentally changing to a static ip didn't make any difference)

Compared my intel container to my arm container /run directory is very sparse only containing lock and systemd (where as on intel it contains a network subfolder among many other things)

I'm guessing this shows (but I don't really know what I'm doing) that the systemd 'start up system' has a problem and failed to start a bunch of services. journalctl returns No journal files were found. and /var/log is fairly sparse only containing: pt btmp dist-upgrade dpkg.log fsck landscape lastlog unattended-upgrades wtmp

Any help would be appreciated :)

Update:

When I try and run systemd-journald manually I get:

qemu: Unsupported syscall: 278
qemu: Unsupported syscall: 74
qemu: Unsupported syscall: 74

Update:

using newer the qemu version:

qemu-user-static (1:2.5+dfsg-5ubuntu10.4) to 1:2.6.1+dfsg-0~16.04

from this PPA https://launchpad.net/~jacob/+archive/ubuntu/virtualisation

improved things a lot. (but still no ipv4 network yet)

/var/run is now populated with expected dirs (including networking)

journalctl now works and returns:

Aug 26 18:02:26 ubuntu systemd-journal[89]: Runtime journal is using 8.0M (max allowed 801.2M, trying to leave 1.1G free of 7.8G available <E2><86><92> current limit 801.2M).
Aug 26 18:02:26 ubuntu systemd-journal[89]: Runtime journal is using 8.0M (max allowed 801.2M, trying to leave 1.1G free of 7.8G available <E2><86><92> current limit 801.2M).
Aug 26 18:02:26 ubuntu systemd-journal[89]: Journal started
Aug 26 18:02:27 ubuntu systemd-sysctl[78]: Failed to write '1' to '/proc/sys/kernel/yama/ptrace_scope': Permission denied
Aug 26 18:02:27 ubuntu systemd-sysctl[78]: Failed to write '176' to '/proc/sys/kernel/sysrq': Permission denied
Aug 26 18:02:27 ubuntu systemd-sysctl[78]: Failed to write '1' to '/proc/sys/fs/protected_hardlinks': Permission denied
Aug 26 18:02:27 ubuntu systemd-sysctl[78]: Failed to write '4 4 1 7' to '/proc/sys/kernel/printk': Permission denied
Aug 26 18:02:27 ubuntu systemd-sysctl[78]: Failed to write '1' to '/proc/sys/kernel/kptr_restrict': Permission denied
Aug 26 18:02:27 ubuntu systemd-sysctl[78]: Failed to write '1' to '/proc/sys/fs/protected_symlinks': Permission denied
Aug 26 18:02:27 ubuntu systemd-sysctl[78]: Failed to write '32768' to '/proc/sys/vm/mmap_min_addr': Permission denied
Aug 26 18:02:27 ubuntu systemd-udevd[74]: error initializing netlink socket
Aug 26 18:02:27 ubuntu systemd-remount-fs[62]: /bin/mount for / exited with exit status 1.
Aug 26 18:02:27 ubuntu systemd-udevd[92]: error initializing netlink socket
Aug 26 18:02:27 ubuntu systemd[1]: Failed to reset devices.list on /system.slice/systemd-journal-flush.service: Operation not permitted
Aug 26 18:02:27 ubuntu systemd[1]: Starting Flush Journal to Persistent Storage...
Aug 26 18:02:27 ubuntu systemd[1]: Started Load/Save Random Seed.
Aug 26 18:02:27 ubuntu systemd-journal[89]: Forwarding to syslog missed 2 messages.
Aug 26 18:02:27 ubuntu systemd-remount-fs[62]: mount: can't find LABEL=cloudimg-rootfs
Aug 26 18:02:27 ubuntu systemd[1]: Started Various fixups to make systemd work better on Debian.
Aug 26 18:02:27 ubuntu mount[67]: mount: permission denied
Aug 26 18:02:27 ubuntu systemd-udevd[108]: error initializing netlink socket
Aug 26 18:02:27 ubuntu systemd[1]: systemd-udevd.service: main process exited, code=exited, status=3/NOTIMPLEMENTED
Aug 26 18:02:27 ubuntu systemd[1]: Failed to start udev Kernel Device Manager.
Aug 26 18:02:27 ubuntu systemd[1]: Unit systemd-udevd.service entered failed state.
Aug 26 18:02:27 ubuntu systemd[1]: systemd-udevd.service failed.
Aug 26 18:02:27 ubuntu systemd[1]: systemd-udevd.service has no holdoff time, scheduling restart.
Aug 26 18:02:27 ubuntu systemd[1]: systemd-udevd-kernel.socket failed to listen on sockets: Address family not supported by protocol
Aug 26 18:02:27 ubuntu systemd[1]: Failed to listen on udev Kernel Socket.
Aug 26 18:02:27 ubuntu systemd[1]: Starting udev Kernel Socket.

The relevant error line seems to be Aug 26 18:02:27 ubuntu systemd-udevd[92]: error initializing netlink socket

Update

I've tried running ifup eth0 -v both with dhcp and a static configuration and both ways gave a similar error:

dhcp Error getting interfaces; Address family not supported by protocol

static Cannot open netlink socket: Address family not supported by protocol

2 Answers 2

1

(Answering due to lack of reputation.)

I had the exact same problem. The lxc container did not get an IPv4 address. Running dhclient eth0 -v resulted in the error message that luckily brought me here

Error getting interfaces; Address family not supported by protocol

This thread really saved my day. After building a new qemu binary, I can make armhf containers join my LAN with this default profile (eno1 being the ethernet interface on my host machine):

name: default
config: {}
description: Default LXD profile
devices:
  eth0:
    name: eth0
    nictype: macvlan
    parent: eno1
    type: nic

I'm using a qemu 2.7.0 binary which you can compile from source and install in some <prefix> path with

./configure --target-list=arm-linux-user --static --prefix=<prefix>
make
make install

Before starting an armhf container, just get the new qemu in there

lxc file push <prefix>/bin/qemu-arm <name>/usr/bin/qemu-arm-static

Another nice side effect is that I can now stop containers without the --force flag!

0

It turned out that qemu 2.6.1 didn't work well enough to get networking working in an arm container.

I applied the following 3 patches to qemu 2.6.1 (after running apt get source qemu-user-static)

https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg06203.html
https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg06204.html
https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg06205.html

and rebuild (using debuild)

Then extracted newly built qemu-aarch64-static from the deb file and installed to the container /usr/lib/lxd/container/$NAME/rootfs/usr/bin

Networking now works:

eth0      Link encap:Ethernet  HWaddr 00:16:3e:54:2e:7c  
          inet addr:10.0.4.110  Bcast:10.0.4.255  Mask:255.255.255.0
          inet6 addr: fe80::216:3eff:fe54:2e7c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:949 errors:0 dropped:0 overruns:0 frame:0
          TX packets:428 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1285688 (1.2 MB)  TX bytes:37196 (37.1 KB)
1
  • I experienced further problems with qemu 2.6.1 - (mono processes hanging on exit) - so i build qemnu 2.7.0-rc4 - which fixed that problem.
    – Tom
    Aug 30, 2016 at 16:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .