Hi, I’m trying to chroot into a Raspbian image, but there’s not domain name resolution inside the chroot.
- I’m 100% sure to have the correct bind mounts
- the correct /etc/resolv.conf (i tried several)
- ping an IP works (ipv4, ipv6)
- I tried adding a domain in /etc/hosts, and resolution works for this domain only.
- I tried using systemd-nspawn instead of chroot as it’s supposed to be more solid.
Still, I get :
root@latitude5400:~# ping google.com
ping: google.com: Temporary failure in name resolution
Do you have any idea ?
Hi and welcome to the forum
- systemctl status systemd-resolved
- resolvectl status
Here are the status :
~ ❯❯❯ resolvectl status
Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found.
~ ❯❯❯ systemctl status systemd-resolved
● systemd-resolved.service - Network Name Resolution
Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Looks like none are used. That’s weird, I never customized the DNS config and I installed Manjaro less than 2 months ago.
Yea commands like ping need that service enabled (and started)…
But the service needs manual intervention for it’s correct operation maybe that’s why they didn’t enable it by default.
In short you just need to symbolic link
/etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf before starting it
Just to be sure : ping and such WORK in the host. They just don’t work in the chroot/systemd-nspawn “guest”.
I tried symlinking the resolv.conf and starting systemd-resolved, that did not help
I have the exact same issue as @Salamandar: network and DNS work on host, only network works in chroot (DNS do not work).
I think the issue is that Manjaro uses NetworkManager and not resolvctl to handle DNS by default, whereas Raspian/Ubuntu uses resolvctl. I assume the incompatibility is causing the issue, but I haven’t found a solution yet.
I had the same issue and found a solution.
To have dns resolving to work inside the chroot you need to mount
/run into your chroot.
And start the
On your host system mount the required filesystems
# mount -t proc none /mnt/chroot/proc
# mount -t sysfs none /mnt/chroot/sys
# mount -o bind /dev /mnt/chroot/dev
# mount -o bind /dev/pts /mnt/chroot/dev/pts
# mount -o bind /run /mnt/chroot/run/
# systemctl start systemd-resolved.service
Go into the chroot
LANG=C chroot /mnt/chroot/
# LANG=C chroot /mnt/chroot/
[root@vicky /]# uname -a
Linux vicky 5.12.19-hardened1-1-hardened #1 SMP PREEMPT Tue, 20 Jul 2021 17:48:41 +0000 aarch64 GNU/Linux
[root@vicky /]# ping manjaro.org
PING manjaro.org (220.127.116.11) 56(84) bytes of data.
64 bytes from mail.manjaro.org (18.104.22.168): icmp_seq=1 ttl=53 time=30.2 ms
Hope this helps…
try running systemd-nspawn with
That works in our ARM tools.