[arch-general] QEMU Networking

2QdxY4RzWzUUiLuE at potatochowder.com 2QdxY4RzWzUUiLuE at potatochowder.com
Fri Sep 2 13:41:21 UTC 2022


Greetings,

I think my question is: now that I have a new laptop and a slightly
different networking setup, how do I get QEMU to work with
systemd-resolved, but if I had all the answers, then I wouldn't be
asking for help.  :-)

My symtoms are that QEMU guests (various live Linux CDs) can ping IP
addresses, but not resolve names:

    $ ping -c1 archlinux.org
    ping: archlinux.org: Name or service not known

    $ resolvectl query archlinux.org
    archlinux.org: resolve call failed: Lookup failed due to system error: Network is unreachable

    $ ping -c1 95.217.163.246
    PING 95.217.163.246 (95.217.163.246) 56(84) bytes of data.
    64 bytes from 95.217.163.246: icmp_seq=1 ttl=255 time=414 ms
    [statistics elided to conserve bandwidth]

On my old laptop, I used NetworkManager resolvconf, but on the new one,
I'm using iwctl/iwd and systemd-resolved, so I'm assuming that that's
the culprit.

In any case, I'm using the following command to start QEMU (various live
CDs boot and run with various options, but they all exhibit the same
networking symptoms; vm.qcow2 is newly created):

    qemu-system-x86_64 -m 8G -enable-kvm -drive file=vm.qcow2 -cdrom /path/to/iso-image

I have no access to a wired network.  I do have access to two WiFi
networks.  One is from my cell phone provider.  The other goes through a
captive portal over which I have no control.  I get the same symptoms in
my guests either way.  When using the network connection from my cell
phone provider (some output removed to remove obviously irrelevant data
and/or formatting meant for humans):

    $ ping -c1 archlinux.org
    PING archlinux.org (95.217.163.246) 56(84) bytes of data.
    64 bytes from archlinux.org (95.217.163.246): icmp_seq=1 ttl=41 time=210 ms

    $ pacman -Q qemu
    qemu-desktop 7.0.0-1

    $ ip a
    4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether b0:3c:dc:82:f1:ea brd ff:ff:ff:ff:ff:ff
        inet 192.168.0.131/24 brd 192.168.0.255 scope global noprefixroute wlan0
           valid_lft forever preferred_lft forever
        inet6 fe80::b23c:dcff:fe82:f1ea/64 scope link
           valid_lft forever preferred_lft forever

    $ resolvectl
    Global
               Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
        resolv.conf mode: foreign

    Link 4 (wlan0)
        Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
             Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
    Current DNS Server: 208.67.222.222
           DNS Servers: 208.67.222.222 208.67.220.220

    $ iwctl device list
      Name                  Address               Powered     Adapter     Mode
      wlan0                 b0:3c:dc:82:f1:ea     on          phy0        station

    $ iwctl adapter list
      Name      Powered   Vendor                Model
      phy0      on        Intel Corporation     Alder Lake-P PCH
                                                CNVi WiFi

    [Then I found <https://bbs.archlinux.org/viewtopic.php?id=253005>.]

    $ drill archlinux.org
    Error: error sending query: No (valid) nameservers defined in the resolver

    $ cat /etc/resolv.conf
    # Resolver configuration file.
    # See resolv.conf(5) for details.

What am I missing?  Do I care that drill doesn't work on my host?

Thanks,
Dan

--
I can eat glass, it does not hurt me.
Dan Sommers, http://www.tombstonezero.net/dan


More information about the arch-general mailing list