Skip to content

/etc/resolv.conf is broken when it's an absolute symbolic link on the host #187

Closed

Description

@refi64

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.

Activity

  1. debarshiray commented on Jun 7, 2019

    @debarshiray
    Member

    Yeah, that wouldn't work. We could bind mount /run too or switch to using the flatpak-spawn maintained copies.

    What does ls -l /etc/resolv.conf show on the host? Could you please paste the output here?

  2. refi64 commented on Jun 7, 2019

    @refi64
    Author
    lrwxrwxrwx. 1 root root 32 Jun  6 13:23 /etc/resolv.conf -> /run/systemd/resolve/resolv.conf
    

    like the resolved documentation mentions.

  3. debarshiray commented on Jun 24, 2019

    @debarshiray
    Member
  4. debarshiray commented on Jul 3, 2019

    @debarshiray
    Member

    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.

  5. debarshiray commented on Sep 5, 2019

    @debarshiray
    Member

    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.

  6. changed the title [-]resolv.conf is broken with systemd-resolved[/-] [+]resolv.conf is broken when it's a symbolic link on the host[/+] on Sep 24, 2019
  7. TingPing commented on Nov 20, 2019

    @TingPing

    So we need to wait until Fedora 29 is end-of-life:d before we make this change.

    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.conf instead of /run/host/etc/resolv.conf.

  8. fansari commented on Nov 20, 2019

    @fansari

    Seems to work with /run/host/monitor/resolv.conf. I set the link stopped the box and started again. The link remained intact.

  9. sigmavirus24 commented on Dec 4, 2019

    @sigmavirus24

    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).

  10. added
    1. Bug
    on Dec 5, 2019
  11. fansari commented on Feb 21, 2020

    @fansari

    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.

  12. abitrolly commented on Mar 17, 2020

    @abitrolly

    Can't add custom DNS servers to /etc/resolv.conf from toolbox. I had to copy it, unlink and copy back.

  13. imcsk8 commented on Apr 1, 2020

    @imcsk8

    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 ~]# 
    
    
  14. martinpitt commented on Apr 2, 2020

    @martinpitt
    Contributor

    I sent a fix for that in PR #380 a while ago.

  15. liambeguin commented on Apr 9, 2020

    @liambeguin

    I tested #380 and it works great for me with systemd-resolved.

    Thanks

  16. 14 remaining items

  17. debarshiray commented on Aug 18, 2020

    @debarshiray
    Member

    An update about the impending systemd-resolved change in Fedora 33.

    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.

  18. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

1. Bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions