Cannot start VMs without routable IPv4 address
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GLibC |
Confirmed
|
Medium
|
|||
glibc (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
qemu (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
qemu will not start VMs using spice or vnc displays unless there is a routable IPv4 address on the machine, even though the error relates to 127.0.0.1
root@athens:~# ip addr
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: em1: <BROADCAST,
link/ether a4:ba:db:32:4c:6b brd ff:ff:ff:ff:ff:ff
inet6 fe80::a6ba:
valid_lft forever preferred_lft forever
3: em2: <BROADCAST,
link/ether a4:ba:db:32:4c:6c brd ff:ff:ff:ff:ff:ff
inet6 fe80::a6ba:
valid_lft forever preferred_lft forever
4: ovs-system: <BROADCAST,
link/ether a6:01:71:d4:b2:71 brd ff:ff:ff:ff:ff:ff
5: br0: <BROADCAST,
link/ether a4:ba:db:32:4c:6b brd ff:ff:ff:ff:ff:ff
inet6 2606:a000:
valid_lft 86292sec preferred_lft 14292sec
inet6 fe80::c03d:
valid_lft forever preferred_lft forever
root@athens:~# virsh start icarus
error: Failed to start domain icarus
error: internal error: process exited while connecting to monitor: ((null):4086): Spice-Warning **: reds.c:
2015-09-
root@athens:~# dhclient br0
root@athens:~# ip addr
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: em1: <BROADCAST,
link/ether a4:ba:db:32:4c:6b brd ff:ff:ff:ff:ff:ff
inet6 fe80::a6ba:
valid_lft forever preferred_lft forever
3: em2: <BROADCAST,
link/ether a4:ba:db:32:4c:6c brd ff:ff:ff:ff:ff:ff
inet6 fe80::a6ba:
valid_lft forever preferred_lft forever
4: ovs-system: <BROADCAST,
link/ether a6:01:71:d4:b2:71 brd ff:ff:ff:ff:ff:ff
5: br0: <BROADCAST,
link/ether a4:ba:db:32:4c:6b brd ff:ff:ff:ff:ff:ff
inet 172.31.3.106/24 brd 172.31.3.255 scope global br0
valid_lft forever preferred_lft forever
inet6 2606:a000:
valid_lft 86335sec preferred_lft 14335sec
inet6 fe80::a6ba:
valid_lft forever preferred_lft forever
root@athens:~# virsh start icarus
Domain icarus started
ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: qemu-system-x86 1:2.2+dfsg-
ProcVersionSign
Uname: Linux 3.19.0-26-generic x86_64
ApportVersion: 2.17.2-0ubuntu1.3
Architecture: amd64
Date: Sat Sep 5 13:46:23 2015
InstallationDate: Installed on 2015-08-29 (6 days ago)
InstallationMedia: Ubuntu-Server 15.04 "Vivid Vervet" - Release amd64 (20150422)
MachineType: Dell Inc. PowerEdge T310
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=
SourcePackage: qemu
UdevLog: Error: [Errno 2] No such file or directory: '/var/log/udev'
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 09/06/2013
dmi.bios.vendor: Dell Inc.
dmi.bios.version: 1.12.0
dmi.board.name: 0MNFTH
dmi.board.vendor: Dell Inc.
dmi.board.version: A00
dmi.chassis.type: 17
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.
dmi.product.name: PowerEdge T310
dmi.sys.vendor: Dell Inc.
tags: | added: qemu-20.10 |
Changed in glibc: | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
tags: |
added: qemu-22.04 server-todo removed: qemu-21.10 |
Changed in qemu (Ubuntu): | |
importance: | Undecided → Medium |
tags: | removed: server-todo |
getaddrinfo() will disregard the loopback addresses ::1 and 127.0.0.1 when attempting to figure out which address families are present on the host, when being called with the AI_ADDRCONFIG flag.
This makes a lot of sense when looking up an external hostname. However, it makes very little sense when connecting to the hostname "localhost". I've learned that the browser vendors will avoid using AI_ADDRCONFIG or do it while using workarounds for the localhost case, see for instance:
https:/ /bugzilla. mozilla. org/show_ bug.cgi? id=614526
Without such a workaround, connecting to a IPv4-only service listening on 127.0.0.1 using the hostname "localhost" will fail unless the machine also has external IPv4 connectivity. Which is not what a user would expect, since the (lack of) external connectivity is irrelevant to the accessibility to the loopback interface.
Therefore, when looking up "localhost", the loopback addresses ::1 and 127.0.0.1 should not be ignored by getaddrinfo() when using AI_ADDRCONFIG
Tore