[arch-general] QEMU Networking
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:
On 2022-09-02 at 09:41:21 -0400,
Dan Sommers via arch-general
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. :-)
[...]
[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?
FYI: QEMU is just like drill: it doesn't work with systemd-resolved's default resolv.conf. When I added a nameserver line to resolv.conf, my virual machines gained internet access. Sorry for the noise; perhaps this post will show up in a search engine and be useful to someone in the future. -- I can eat glass, it does not hurt me. Dan Sommers, http://www.tombstonezero.net/dan
On 2022-09-02 at 10:01:15 -0400,
Dan Sommers via arch-general
On 2022-09-02 at 09:41:21 -0400, Dan Sommers via arch-general
wrote:
[Then I found https://bbs.archlinux.org/viewtopic.php?id=253005.]
FYI: QEMU is just like drill: it doesn't work with systemd-resolved's default resolv.conf. When I added a nameserver line to resolv.conf, my virual machines gained internet access.
FWIW: https://gitlab.com/qemu-project/qemu/-/issues/1189 -- I can eat glass, it does not hurt me. Dan Sommers, http://www.tombstonezero.net/dan
On Fri, 2 Sep 2022 17:12:35 -0400
Dan Sommers via arch-general
On 2022-09-02 at 10:01:15 -0400, Dan Sommers via arch-general
wrote: On 2022-09-02 at 09:41:21 -0400, Dan Sommers via arch-general
wrote: [Then I found https://bbs.archlinux.org/viewtopic.php?id=253005.]
FYI: QEMU is just like drill: it doesn't work with systemd-resolved's default resolv.conf. When I added a nameserver line to resolv.conf, my virual machines gained internet access.
If you resolv.conf was empty, you didn't set up systemd-resolved correctly. See the wiki, it should be a symlink.
On 2022-09-02 at 18:08:42 -0500,
Doug Newgard via arch-general
On Fri, 2 Sep 2022 17:12:35 -0400 Dan Sommers via arch-general
wrote: On 2022-09-02 at 10:01:15 -0400, Dan Sommers via arch-general
wrote: On 2022-09-02 at 09:41:21 -0400, Dan Sommers via arch-general
wrote: [Then I found https://bbs.archlinux.org/viewtopic.php?id=253005.]
FYI: QEMU is just like drill: it doesn't work with systemd-resolved's default resolv.conf. When I added a nameserver line to resolv.conf, my virual machines gained internet access.
If you resolv.conf was empty, you didn't set up systemd-resolved correctly. See the wiki, it should be a symlink.
I set up iwd as per https://wiki.archlinux.org/title/Iwd during installation. There are three sentences about a DNS Manager, including a note that "if not specified, systemd-resolved is used as the default." I didn't set up systemd-resolved at all, which means that you are not wrong to say that I didn't set it up correctly. :-) (My previous Arch system came with ConnMann and netctl out of the box, and I switched to NetworkManager for the sake of XFCE. I don't recall doing anything special to set up name resolution.) If I missed something during or shortly after installation, then this is all on me, and I learned a few things, and I'll know better next time. In the interest of improving Arch and perhaps saving someone else from the running into the same situation, I went back through the the Installation Guide and the General Recommendations. The Installation Guide says that I can verify my internet connection with "ping archlinux.org," which has always worked. That's followed by a note that, "[in] the installation image, systemd-networkd, systemd-resolved, iwd and ModemManager are preconfigured and enabled by default. That will not be the case for the installed system." The only reference to DNS in the General Recommendations is about better security. Hindsight being 20/20, I could say that the note in the Installation Guide told me to go back and check my network setup after the installation. On the other hand, that note follows the paragraph that says that I can verify my network connection by pinging archlinux.org. In my best Bones McCoy voice, I'm a [retired] software developer, not a network administrator. My recommendation would be something in the General Recommendations about re-checking that networking (i.e., whatever you did under "Connect to the internet" during installation) is completely and correctly set up, even if you did choose the defaults during installation (or didn't override those defaults if you didn't have to). If there's a place to make this recommendation (and to justify it by today's experience), then by all means, point me to it. Thanks for listening (and for Arch), Dan -- I can eat glass, it does not hurt me. Dan Sommers, http://www.tombstonezero.net/dan
participants (2)
-
2QdxY4RzWzUUiLuE@potatochowder.com
-
Doug Newgard