Cannot start VMs without routable IPv4 address

Bug #1492621 reported by Kevin Otte on 2015-09-05
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qemu (Ubuntu)
Undecided
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,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    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,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master ovs-system state UP group default qlen 1000
    link/ether a4:ba:db:32:4c:6b brd ff:ff:ff:ff:ff:ff
    inet6 fe80::a6ba:dbff:fe32:4c6b/64 scope link
       valid_lft forever preferred_lft forever
3: em2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master ovs-system state UP group default qlen 1000
    link/ether a4:ba:db:32:4c:6c brd ff:ff:ff:ff:ff:ff
    inet6 fe80::a6ba:dbff:fe32:4c6c/64 scope link
       valid_lft forever preferred_lft forever
4: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default
    link/ether a6:01:71:d4:b2:71 brd ff:ff:ff:ff:ff:ff
5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
    link/ether a4:ba:db:32:4c:6b brd ff:ff:ff:ff:ff:ff
    inet6 2606:a000:a461:4500:a6ba:dbff:fe32:4c6b/64 scope global mngtmpaddr dynamic
       valid_lft 86292sec preferred_lft 14292sec
    inet6 fe80::c03d:22ff:fea5:3034/64 scope link
       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:2330:reds_init_socket: getaddrinfo(127.0.0.1,5900): Address family for hostname not supported
2015-09-05T17:43:39.911871Z qemu-system-x86_64: failed to initialize spice server

root@athens:~# dhclient br0
root@athens:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    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,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master ovs-system state UP group default qlen 1000
    link/ether a4:ba:db:32:4c:6b brd ff:ff:ff:ff:ff:ff
    inet6 fe80::a6ba:dbff:fe32:4c6b/64 scope link
       valid_lft forever preferred_lft forever
3: em2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master ovs-system state UP group default qlen 1000
    link/ether a4:ba:db:32:4c:6c brd ff:ff:ff:ff:ff:ff
    inet6 fe80::a6ba:dbff:fe32:4c6c/64 scope link
       valid_lft forever preferred_lft forever
4: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default
    link/ether a6:01:71:d4:b2:71 brd ff:ff:ff:ff:ff:ff
5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
    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:a461:4500:a6ba:dbff:fe32:4c6b/64 scope global mngtmpaddr dynamic
       valid_lft 86335sec preferred_lft 14335sec
    inet6 fe80::a6ba:dbff:fe32:4c6b/64 scope link
       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-5expubuntu9.4
ProcVersionSignature: Ubuntu 3.19.0-26.28-generic 3.19.8-ckt4
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=/vmlinuz-3.19.0-26-generic.efi.signed root=/dev/mapper/vg_athens-lv_root ro
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.:bvr1.12.0:bd09/06/2013:svnDellInc.:pnPowerEdgeT310:pvr:rvnDellInc.:rn0MNFTH:rvrA00:cvnDellInc.:ct17:cvr:
dmi.product.name: PowerEdge T310
dmi.sys.vendor: Dell Inc.

Kevin Otte (nivex) wrote :
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug. I suspect this is actually a libvirt bug. To make sure, could you check whether

kvm -spice addr=127.0.0.1,port=5900

works for you? At least in an empty network namespace on my host this seemed to work fine.

Changed in qemu (Ubuntu):
status: New → Incomplete
Kevin Otte (nivex) wrote :

I don't have the 'kvm' command on this machine, but it definitely appears to be qemu related:

kjotte@athens:~$ qemu-system-x86_64 -spice addr=127.0.0.1,port=5900
(/usr/bin/qemu-system-x86_64:1785): Spice-Warning **: reds.c:2330:reds_init_socket: getaddrinfo(127.0.0.1,5900): Address family for hostname not supported
qemu-system-x86_64: failed to initialize spice server

Can you show the output of 'sudo ifconfig -a; sudo brctl show; sudo netstat -nr' ?

Does

nc -l -4 127.0.0.1 5555 & echo ab | nc -4 127.0.0.1 5555

work?

Kevin Otte (nivex) wrote :

Attaching typescript output of requested diagnostic commands.
As OVS rather than Linux bridge is in use, I have included potentially relevant ovs-* command output.

Kevin Otte (nivex) wrote :

Given that VNC does this as well, I traced the problem all the way back to getaddrinfo() behavior in libc. I believe this describes it: https://bugzilla.redhat.com/show_bug.cgi?id=721350

tl;dr: It ignores loopback when enumerating addresses per family. Workaround is to define the display as ::1, which works fine since there's a global v6 address on the box.

Close: notabug

Serge Hallyn (serge-hallyn) wrote :

Thanks, Kevin!

Changed in qemu (Ubuntu):
status: Incomplete → Invalid
adam (addyp95) wrote :

This is still a present bug. In its current defaults, the lack of a routable ipv4 address will still cause libvirt to fail starting any guests. While setting ::1 worked for Kevin, this doesn't fix the bug, just works around it.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.