dockerpi icon indicating copy to clipboard operation
dockerpi copied to clipboard

[rpi2] ArchARM with VM image: cannot ping 8.8.8.8

Open bronze51 opened this issue 4 years ago • 2 comments

I build an image for Arch ARM (custom-pi-recent.img, what's in a name). I started lukechilds/dockerpi:vm pi2 with the command below.

I was then able to update the container/img file with pacman. I can ssh into other devices on my lan.

But when I try to ping 8.8.8.8, there is no output. I checked journalctl -f, and there is also no information specific to the ping command.

I had understood that the network adapter should be named usb0, but it is named eth0.

[...]# ip a show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether 40:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic eth0
       valid_lft 85146sec preferred_lft 85146sec
    inet6 fec0::4254:ff:fe12:3457/64 scope site dynamic mngtmpaddr noprefixroute
       valid_lft 86347sec preferred_lft 14347sec
    inet6 fe80::4254:ff:fe12:3457/64 scope link
       valid_lft forever preferred_lft forever

I captured the startup log below, but cut out a few lines. Please let me know if should provide more of the startup logs?

[...]$ docker run -it -p5022:5022 -v `pwd`/custom-pi-recent.img:/sdcard/filesystem.img lukechilds/dockerpi:vm pi2
image: /sdcard/filesystem.img
file format: raw
virtual size: 2 GiB (2147483648 bytes)
disk size: 1.85 GiB
Extracting partitions
dd: invalid number 'heads,'
192512+0 records in
192512+0 records out
98566144 bytes (94.0MB) copied, 0.842927 seconds, 111.5MB/s
Extracting boot filesystem
...
Extracting /localhost to /fat/localhost
Searching for kernel='kernel7.img'
Searching for dtb='bcm2709-rpi-2-b.dtb'
Booting QEMU machine "raspi2b" with kernel=/fat/kernel7.img dtb=/fat/bcm2709-rpi-2-b.dtb
[    0.000000] Booting Linux on physical CPU 0xf00
[    0.000000] Linux version 5.10.39-2-ARCH (builduser@leming) (armv7l-unknown-linux-gnueabihf-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 SMP Thu May 27 14:26:43 UTC 2021
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Raspberry Pi 2 Model B
...
[    5.936896] usb 1-1: New USB device found, idVendor=0409, idProduct=55aa, bcdDevice= 1.01
[    5.937623] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    5.938151] usb 1-1: Product: QEMU USB Hub
[    5.938570] usb 1-1: Manufacturer: QEMU
[    5.938874] usb 1-1: SerialNumber: 314159-1
[    5.942714] hub 1-1:1.0: USB hub found
[    5.943738] hub 1-1:1.0: 8 ports detected
[    6.319205] usb 1-1.1: new full-speed USB device number 3 using dwc_otg
usbnet: failed control transaction: request 0x8006 value 0x600 index 0x0 length 0xa
usbnet: failed control transaction: request 0x8006 value 0x600 index 0x0 length 0xa
usbnet: failed control transaction: request 0x8006 value 0x600 index 0x0 length 0xa
[    6.478431] random: fast init done
[    6.491835] usb 1-1.1: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 0.00
[    6.494305] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=10
[    6.494700] usb 1-1.1: Product: RNDIS/QEMU USB Network Device
[    6.495067] usb 1-1.1: Manufacturer: QEMU
[    6.495203] usb 1-1.1: SerialNumber: 1-1.1
usbnet: failed control transaction: request 0x2143 value 0xc index 0x0 length 0x0
[    6.554494] cdc_ether 1-1.1:1.0 eth0: register 'cdc_ether' at usb-3f980000.usb-1.1, CDC Ethernet Device, 40:54:00:12:34:57
[    8.974408] systemd[1]: System time before build time, advancing clock.
[    9.515219] NET: Registered protocol family 10
[    9.959964] Segment Routing with IPv6
[   11.180298] systemd[1]: systemd 248.3-2-arch running in system mode. (+PAM +AUDIT -SELINUX -APPARMOR -IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified)
[   11.204234] systemd[1]: Detected architecture arm.

Welcome to Arch Linux ARM!
...
         Starting User Login Management...
usbnet: failed control transaction: request 0x2143 value 0xe index 0x0 length 0x0
usbnet: failed control transaction: request 0x2143 value 0xe index 0x0 length 0x0
...
Arch Linux 5.10.39-2-ARCH (ttyAMA0)

bronze51 avatar Jun 05 '21 15:06 bronze51

I stumbled into this a few hours ago and just noticed that it seems to be "by qemu design", see: https://github.com/lukechilds/dockerpi/issues/5#issuecomment-584591440

MartinLoeper avatar Jun 06 '21 00:06 MartinLoeper

I solved by adding the following in the docker-compose.yml file:

...
sysctls:
    - net.ipv4.ping_group_range=0 2147483647
...

For docker run should be the following:

docker run ... --sysctl net.ipv4.ping_group_range="0 2147483647" ...

matteocarnelos avatar Jun 08 '21 13:06 matteocarnelos