TransWikia.com

How to get name resolution working inside a chroot of a different architecture?

Unix & Linux Asked by Sixtyfive on March 4, 2021

On an amd64 machine running Manjaro Linux, I’d like to be able to resolve names inside an arm chroot, which is Arch Linux ARM. Unfortunately, it’s not working. I suspect it might have something to do with different glibc versions or so, but have no idea how to overcome the problem. The problem exists with both the pre-compiled qemu-static-arm and the self-compiled qemu-user-static packages from AUR.

Here’s what I’ve done to get inside the guest system as well as what’s been done thus far once inside, including the error message:

[t440s ~]# ping -c 1 unix.stackexchange.com
PING unix.stackexchange.com (151.101.65.69) 56(84) bytes of data.
64 bytes from 151.101.65.69 (151.101.65.69): icmp_seq=1 ttl=60 time=22.5 ms

--- unix.stackexchange.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 22.549/22.549/22.549/0.000 ms
[t440s ~]# mount /dev/mmcblk0p1 root/
[t440s ~]# mount --bind /dev/ root/dev/
[t440s ~]# mount --bind /proc/ root/proc/
[t440s ~]# mount --bind /dev/pts/ root/dev/pts/
[t440s ~]# mount --bind /run/ root/run/
[t440s ~]# cp /usr/bin/qemu-arm-static root/usr/bin/
[t440s ~]# chroot root/ qemu-arm-static /bin/bash
[root@t440s /]# cat etc/resolv.conf 
nameserver 141.1.1.1
[root@t440s /]# ping unix.stackexchange.com
/usr/bin/ping: unix.stackexchange.com: Temporary failure in name resolution
[root@t440s /]# ls -ltr /etc/resolv.conf 
lrwxrwxrwx 1 root root 32 Aug  9 03:54 /etc/resolv.conf -> /run/systemd/resolve/resolv.conf
[root@t440s /]# ls -ltr /run/systemd/resolve/resolv.conf
-rw-r--r-- 1 root root 21 Jan 17 18:42 /run/systemd/resolve/resolv.conf
[root@t440s /]# rm /etc/resolv.conf 
[root@t440s /]# cp /run/systemd/resolve/resolv.conf /etc/
[root@t440s /]# ping unix.stackexchange.com
/usr/bin/ping: unix.stackexchange.com: Temporary failure in name resolution

How can one make name resolution work with this technique?

One Answer

Maybe install also binfmt-qemu-static from AUR?

Answered by Thomas Hugel on March 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP