You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
/etc/resolv.conf is broken when it's an absolute symbolic link on the host #187
systemd-resolved has you symlink /etc/resolv.conf to some other location (under /run/systemd/resolve). When the host volume /etc is mounted, this location of course does not exist, so all hostname access within the container fails.
Reacted by Ian Stapleton Cordasco, Latesil, Anatoli Babenia, Ondřej Míchal and DanMan
I think the best way forward is to switch the /etc/resolv.conf symbolic link to the copy maintained by flatpak-session-helper at /run/host/monitor/resolv.conf.
However, I'd like to wait a bit longer for flatpak/flatpak#2916 to be more widely installed, to avoid having some unintended fallout. Ultimately, Toolbox's primary use-case is Silverblue, and it doesn't use systemd-resolved, so it's better to lean in favour of it.
I'd like to wait a bit longer for flatpak/flatpak#2916
to be more widely installed, to avoid having some unintended fallout.
Ultimately, Toolbox's primary use-case is Silverblue, and it doesn't use
systemd-resolved, so it's better to lean in favour of it.
flatpak/flatpak#2916 was introduced in Flatpak 1.4.0, which is too new for Fedora 29. So we need to wait until Fedora 29 is end-of-life:d before we make this change.
I can confirm @fansari's results with @TingPing's work around. I'm running Fedora 31 Workstation, toolbox-0.0.17-1.fc31.src.rpm, podman-1.6.2-2.fc31.src.rpm, and registry.fedoraproject.org/f31/fedora-toolbox 31 a198bc8c3cda 4 weeks ago 448 MB and having this issue. Let me know if I can provide any other details to help get this resolved (no pun intended).
When will this issue been fixed? I have now again created directory /run/host/monitor (which does not exist on Fedora 31) removed the NetworkManager link and place the resolv.conf there.
toolbox should work with NetworkManager without this issue.
The problem is that in Fedora 31 /etc/resolv.conf is a symlink to /run/host/etc/resolv.conf which in turn is a symlink to /var/run/NetworkManager/resolv.conf, this file does not exist in the container since it does not use NetworkManager.
The registry.fedoraproject.org/f31/fedora-toolbox:31 image has to be fixed to avoid this problem.
I found this Workaround:
⬢[ichavero@toolbox ~]$ sudo -i
sudo: setrlimit(RLIMIT_CORE): Operation not permitted
⬢[root@toolbox ~]# ping google.com
ping: google.com: Name or service not known
⬢[root@toolbox ~]# mkdir /var/run/NetworkManager
⬢[root@toolbox ~]# echo "nameserver 192.168.1.254" > /var/run/NetworkManager/resolv.conf
⬢[root@toolbox ~]# ping -c2 google.com
PING google.com (216.58.217.14) 56(84) bytes of data.
64 bytes from qro02s15-in-f14.1e100.net (216.58.217.14): icmp_seq=1 ttl=57 time=6.74 ms
64 bytes from qro02s15-in-f14.1e100.net (216.58.217.14): icmp_seq=2 ttl=57 time=5.63 ms
--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 5.632/6.187/6.742/0.555 ms
⬢[root@toolbox ~]#
By default, Fedora will ship /etc/resolv.conf as a relative symbolic link to ../run/systemd/resolve/stub-resolv.conf, and so does Ubuntu. This already works since Toolbox 0.0.14 because of commit d63b0a9
This situation is an illustration of the benefits of a relative symbolic link. It ensures that the link continues to resolve properly even when the prefix or the root is changed.
So, if you need a quick solution that works with Toolbox as it's shipping today, I'd suggest switching to a relative symbolic link on your systems.
What doesn't work, and we need to fix, are absolute symbolic links. ie., a /etc/resolv.conf that links to /run/systemd/resolve/stub-resolv.conf.
changed the title [-]resolv.conf is broken when it's a symbolic link on the host[/-][+]/etc/resolv.conf is broken when it's an absolute symbolic link on the host[/+]on Aug 18, 2020
Activity
debarshiray commentedon Jun 7, 2019
Yeah, that wouldn't work. We could bind mount /run too or switch to using the
flatpak-spawnmaintained copies.What does
ls -l /etc/resolv.confshow on the host? Could you please paste the output here?refi64 commentedon Jun 7, 2019
like the resolved documentation mentions.
debarshiray commentedon Jun 24, 2019
So, Ubuntu uses systemd-resolved since 16.04.
debarshiray commentedon Jul 3, 2019
I think the best way forward is to switch the
/etc/resolv.confsymbolic link to the copy maintained byflatpak-session-helperat/run/host/monitor/resolv.conf.However, I'd like to wait a bit longer for flatpak/flatpak#2916 to be more widely installed, to avoid having some unintended fallout. Ultimately, Toolbox's primary use-case is Silverblue, and it doesn't use systemd-resolved, so it's better to lean in favour of it.
debarshiray commentedon Sep 5, 2019
flatpak/flatpak#2916 was introduced in Flatpak 1.4.0, which is too new for Fedora 29. So we need to wait until Fedora 29 is end-of-life:d before we make this change.
[-]resolv.conf is broken with systemd-resolved[/-][+]resolv.conf is broken when it's a symbolic link on the host[/+]TingPing commentedon Nov 20, 2019
Since this date is approaching is there any work on this? Its a bit of a problem to simply not work with many configurations...
EDIT: Seems like you can modify toolbox to use
/run/host/monitor/resolv.confinstead of/run/host/etc/resolv.conf.fansari commentedon Nov 20, 2019
Seems to work with /run/host/monitor/resolv.conf. I set the link stopped the box and started again. The link remained intact.
sigmavirus24 commentedon Dec 4, 2019
I can confirm @fansari's results with @TingPing's work around. I'm running Fedora 31 Workstation,
toolbox-0.0.17-1.fc31.src.rpm,podman-1.6.2-2.fc31.src.rpm, andregistry.fedoraproject.org/f31/fedora-toolbox 31 a198bc8c3cda 4 weeks ago 448 MBand having this issue. Let me know if I can provide any other details to help get this resolved (no pun intended).fansari commentedon Feb 21, 2020
When will this issue been fixed? I have now again created directory /run/host/monitor (which does not exist on Fedora 31) removed the NetworkManager link and place the resolv.conf there.
toolbox should work with NetworkManager without this issue.
abitrolly commentedon Mar 17, 2020
Can't add custom DNS servers to
/etc/resolv.conffrom toolbox. I had to copy it, unlink and copy back.imcsk8 commentedon Apr 1, 2020
The problem is that in Fedora 31
/etc/resolv.confis a symlink to/run/host/etc/resolv.confwhich in turn is a symlink to/var/run/NetworkManager/resolv.conf, this file does not exist in the container since it does not use NetworkManager.The
registry.fedoraproject.org/f31/fedora-toolbox:31image has to be fixed to avoid this problem.I found this Workaround:
martinpitt commentedon Apr 2, 2020
I sent a fix for that in PR #380 a while ago.
liambeguin commentedon Apr 9, 2020
I tested #380 and it works great for me with
systemd-resolved.Thanks
14 remaining items
debarshiray commentedon Aug 18, 2020
An update about the impending
systemd-resolvedchange in Fedora 33.By default, Fedora will ship
/etc/resolv.confas a relative symbolic link to../run/systemd/resolve/stub-resolv.conf, and so does Ubuntu. This already works since Toolbox 0.0.14 because of commit d63b0a9This situation is an illustration of the benefits of a relative symbolic link. It ensures that the link continues to resolve properly even when the prefix or the root is changed.
So, if you need a quick solution that works with Toolbox as it's shipping today, I'd suggest switching to a relative symbolic link on your systems.
What doesn't work, and we need to fix, are absolute symbolic links. ie., a
/etc/resolv.confthat links to/run/systemd/resolve/stub-resolv.conf.[-]resolv.conf is broken when it's a symbolic link on the host[/-][+]/etc/resolv.conf is broken when it's an absolute symbolic link on the host[/+]cmd/initContainer: Follow symlinks when redirecting
cmd/initContainer: Reinforce symlink redirection
cmd/initContainer: Reinforce symlink redirection
cmd/initContainer: Reinforce symlink redirection
cmd/initContainer: Reinforce symlink redirection
cmd/initContainer: Reinforce symlink redirection
cmd/initContainer: Reinforce symlink redirection
cmd/initContainer: Reinforce symlink redirection
cmd/initContainer: Reinforce symlink redirection
cmd/initContainer: Reinforce symlink redirection
cmd/initContainer: Try to handle config files that're absolute symlinks
test/system: Try to handle /etc/resolv.conf on host as absolute symlink