Bug 504451 - kvm guest install fails with 'socket(): Address family not supported by protocol'
kvm guest install fails with 'socket(): Address family not supported by proto...
Status: CLOSED INSUFFICIENT_DATA
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
11
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Daniel Veillard
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-07 02:41 EDT by guy carmin
Modified: 2009-08-07 10:30 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-08-07 10:30:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
/var/log/libvirt/qemu/testvm.log (708 bytes, text/plain)
2009-06-09 04:02 EDT, guy carmin
no flags Details
virt-manager.log (17.52 KB, text/plain)
2009-06-09 04:04 EDT, guy carmin
no flags Details
version.info (37.15 KB, text/plain)
2009-06-09 04:07 EDT, guy carmin
no flags Details
strace output of /usr/bin/qemu-kvm as launched by virt-manager (253.01 KB, application/octet-stream)
2009-06-17 09:46 EDT, Joel
no flags Details
Strace output (949.10 KB, text/plain)
2009-06-17 10:51 EDT, K.T. Stevenson
no flags Details
strace -f output (4.11 MB, text/plain)
2009-06-21 08:51 EDT, K.T. Stevenson
no flags Details
~/.virt-manager/virt-manager.log (12.92 KB, text/plain)
2009-07-19 05:19 EDT, Michael Hampton
no flags Details
/var/log/messages (6.64 KB, text/plain)
2009-07-19 05:20 EDT, Michael Hampton
no flags Details

  None (edit)
Description guy carmin 2009-06-07 02:41:37 EDT
Description of problem:
runing virt manager
create a new guest 
choose all parameters 
after creating the guest H.D. file it fails with the following error:
Unable to complete install '<class 'libvirt.libvirtError'> internal error unable to start guest: char device redirected to /dev/pts/4
char device redirected to /dev/pts/5

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 1495, in do_install
    dom = guest.start_install(False, meter = meter)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 541, in start_install
    return self._do_install(consolecb, meter, removeOld, wait)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 633, in _do_install
    self.domain = self.conn.createLinux(install_xml, 0)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 974, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error unable to start guest: char device redirected to /dev/pts/4
char device redirected to /dev/pts/5


Version-Release number of selected component (if applicable):

[root@Gandalf ~]# uname -a
Linux Gandalf.matrix.it 2.6.29.4-167.fc11.x86_64 #1 SMP Wed May 27 17:27:08 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@Gandalf ~]# cat /etc/redhat-release
Fedora release 11 (Leonidas)
[root@Gandalf ~]# rpm -qa |grep -i 'virt\|virsh\|qemu\|kvm'
virt-mem-0.3.1-6.fc11.x86_64
qemu-system-x86-0.10.5-1.fc11.x86_64
qemu-img-0.10.5-1.fc11.x86_64
virt-manager-0.7.0-4.fc11.x86_64
qemu-common-0.10.5-1.fc11.x86_64
python-virtinst-0.400.3-8.fc11.noarch
virt-ctrl-1.0.1-3.fc11.x86_64
qemu-kvm-0.10.5-1.fc11.x86_64
libvirt-0.6.2-11.fc11.x86_64
virt-df-2.1.5-1.fc11.x86_64
etherboot-zroms-kvm-5.4.4-14.fc11.noarch
virt-top-1.0.3-4.fc11.x86_64
libvirt-python-0.6.2-11.fc11.x86_64
virt-viewer-0.0.3-5.fc11.x86_64
qemu-kvm-tools-0.10.5-1.fc11.x86_64


How reproducible:

just follow the problem the problem description steps.

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Mark McLoughlin 2009-06-08 13:47:43 EDT
Thanks for the report. Unfortunately, the error message doesn't give us any real clues as to what went wrong.

Could you attach ~/.virt-manager/virt-manager.log and /var/log/libvirt/qemu/$guest.log ?

Also, perhaps check for SELinux errors using "ausearch -m AVC -ts recent"

See also https://fedoraproject.org/wiki/Reporting_virtualization_bugs
Comment 2 guy carmin 2009-06-09 04:02:39 EDT
Created attachment 346977 [details]
/var/log/libvirt/qemu/testvm.log
Comment 3 guy carmin 2009-06-09 04:04:48 EDT
Created attachment 346978 [details]
virt-manager.log
Comment 4 guy carmin 2009-06-09 04:07:23 EDT
Created attachment 346979 [details]
version.info
Comment 5 Mark McLoughlin 2009-06-12 05:22:11 EDT
This is interesting:

socket(): Address family not supported by protocol
socket(): Address family not supported by protocol

Just guessing, but what's the contents of your /etc/hosts?

Perhaps attach the output of strace:

LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin  strace -f -ttt /usr/bin/qemu-kvm -S -M pc -m 512 -smp 1 -name testkvm -uuid e8fb33e9-8a68-6463-eeac-17afa1d11c57 -monitor pty -pidfile /var/run/libvirt/qemu//testkvm.pid -no-reboot -boot d -drive file=/var/lib/libvirt/images/testkvm.img,if=ide,index=0 -drive file=/home/guy/support/Mercury/boot-iso/EL5.2x86_64.boot.orig.iso,if=ide,media=cdrom,index=2 -net nic,macaddr=54:52:00:22:7b:ee,vlan=0 -net user -serial pty -parallel none -usb -vnc 127.0.0.1:1 -soundhw es1370
Comment 6 Joel 2009-06-17 09:40:45 EDT
I'm seeing the exact same issue as reported in this bug.  My /etc/hosts:
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
127.0.0.1               localhost.localdomain localhost
127.0.0.1               lc4eb8711466673.ibm.com lc4eb8711466673

Also, I should mention that creating VMs from virt-install from the command line does work.  It's only when I try to create a VM from virt-manager when I run into the issue.

For example this works:

virt-install -d --name="SLES11" --ram=256 --disk=path=sles11.img  --cdrom=./SLES-11-DVD-i586-GM-DVD1.iso --accelerate

Once the VM is up and running, I can close the virt-viewer window and reattach to the VM from virt-manager.

I'll be attaching the strace output in a moment.
Comment 7 Joel 2009-06-17 09:46:56 EDT
Created attachment 348255 [details]
strace output of /usr/bin/qemu-kvm as launched by virt-manager

It never quite quits running the strace, so I deleted a couple of megs worth of lines consisting of:

[pid 22235] 1245246187.986911 select(22, [5 8 11 12 14 15 17 21], [], [], {1, 0}) = -1 EBADF (Bad file descriptor)
Comment 8 Mark McLoughlin 2009-06-17 10:00:55 EDT
Joel: are you seeing "socket(): Address family not supported by protocol"? it doesn't appear to be in the strace
Comment 9 Joel 2009-06-17 10:23:42 EDT
I do get the message as part of the python traceback:

Unable to complete install '<class 'libvirt.libvirtError'> internal error unable to start guest: char device redirected to /dev/pts/2
char device redirected to /dev/pts/3
socket(): Address family not supported by protocol

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 1501, in do_install
    dom = guest.start_install(False, meter = meter)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 541, in start_install
    return self._do_install(consolecb, meter, removeOld, wait)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 633, in _do_install
    self.domain = self.conn.createLinux(install_xml, 0)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 974, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error unable to start guest: char device redirected to /dev/pts/2
char device redirected to /dev/pts/3
socket(): Address family not supported by protocol

For whatever reason, the strace output just sits there looping with the "[pid 22235] 1245246187.986911 select(22, [5 8 11 12 14 15 17 21], [], [], {1,
0}) = -1 EBADF (Bad file descriptor) " messages.
Comment 10 K.T. Stevenson 2009-06-17 10:49:34 EDT
I see this also.  In addition, I am unable to start a virtual machine once created.  For example:

$ sudo virsh start c4eb
error: Failed to start domain c4eb
error: internal error unable to start guest: char device redirected to /dev/pts/2
char device redirected to /dev/pts/3

'socket(): Address family not supported by protocol' also shows up in the log.

I will add a strace of the underlying command to this ticket.  Like Joel, it seems to go into a loop.  I did find these messages interesting though.

fcntl(16, F_SETFL, O_RDONLY|O_NONBLOCK) = -1 EBADF (Bad file descriptor)
ioctl(16, 0x800454d2, 0x7fff485d9e50)   = -1 EBADF (Bad file descriptor)
write(2, "TUNGETIFF ioctl() failed: Bad fil"..., 46TUNGETIFF ioctl() failed: Bad file descriptor
) = 46
ioctl(16, 0x400454d0, 0)                = -1 EBADF (Bad file descriptor)
write(2, "TUNSETOFFLOAD ioctl() failed: Bad"..., 50TUNSETOFFLOAD ioctl() failed: Bad file descriptor
) = 50
Comment 11 K.T. Stevenson 2009-06-17 10:51:28 EDT
Created attachment 348264 [details]
Strace output

Output from command:

strace qemu-kvm -S -M pc -m 1024 -smp 1 -name c4eb -uuid 6bcea14a-505e-18e2-024a-a2b0f8f7ca9f -monitor pty -pidfile /var/run/libvirt/qemu//c4eb.pid -boot c -drive file=/var/lib/libvirt/images/c4eb.img,if=ide,index=0,boot=on -drive file=,if=ide,media=cdrom,index=2 -net nic,macaddr=54:52:00:7a:cc:2f,vlan=0 -net tap,fd=16,script=,vlan=0,ifname=vnet0 -serial pty -parallel none -usb -vnc 127.0.0.1:0 -soundhw es1370 > strace.out 2>&1
Comment 12 Daniel Berrange 2009-06-17 11:23:51 EDT
I wonder if that socket() error message is coming from the SDL audio backend - perhaps pulseaudio or alsa etc.  Might be worth trying the VM without the <sound>  XML element in the libvirt config
Comment 13 K.T. Stevenson 2009-06-17 11:38:58 EDT
D'oh! *headsmack*

That fixes the problem for me.  Now I need to frob around with it to find out how to get sound.

Thanks!
Comment 14 Joel 2009-06-17 13:58:10 EDT
Taking out the sound bit from the XML config definitely gets it working for me as well.
Comment 15 Mark McLoughlin 2009-06-19 12:11:39 EDT
Nice guess Dan

(In reply to comment #11)

> Output from command:
> 
> strace qemu-kvm

Could you re-do this with 'strace -f' so that we can try and figure out exactly where this socket() error is coming from?

Separately, try running with QEMU_AUDIO_DRV=pa - that'll make it use the pulseaudio backend instead of the SDL backend; see bug #495964
Comment 16 Daniel Berrange 2009-06-19 12:15:44 EDT
FYI, for VMs started with 'qemu://system' you'll likely need to manually run an instance of the pulseaudio system daemon,  eg  pulseaudio --system.  The QEMU vm as root, won't connect to a pulseaudio daemon in your desktop session, nor will pulseaudio libs auto-spawn when run as root.
Comment 17 K.T. Stevenson 2009-06-21 08:51:09 EDT
Created attachment 348788 [details]
strace -f output

strace -f output as requested.
Comment 18 Mark McLoughlin 2009-06-22 08:07:05 EDT
(In reply to comment #17)

> strace -f output as requested.

Thanks for trying, but this doesn't show the "Address family not supported by protocol" error - did you run it with your original command line?
Comment 19 K.T. Stevenson 2009-06-22 08:34:29 EDT
Yes, I did.  I also verified that I could reproduce the error prior to starting the strace.

I get very different behavior when trying to start a vm via libvirt versus using the qemu-kvm command.  When starting via libvirt (i.e. virsh start guest) I receive the socket errors.  When using qemu-kvm, I get what appears to be an infinite loop.  Not sure what is going on there.

At any rate, I am no longer in a position to provide more data at this time.  I have been directed to install an *ahem* different OS on my machine and do not have another system to continue to troubleshoot with.
Comment 20 Mark McLoughlin 2009-06-22 08:49:47 EDT
Okay, thanks KT

We're at a bit of a standstill here, then - if anyone can provide some data on where exactly this "Address family not supported by protocol" error is coming from or some steps to allow this to be reproduced on any machine, please let us know
Comment 21 Michael Hampton 2009-07-19 05:17:53 EDT
I'm seeing virtually the same error, when trying to create a new (and my first) KVM virtual machine, but I also get a kernel oops. After clicking Finish on Step 5 of 5 in the wizard, I get the window saying the virtual disk is being created, then a kernel oops, followed by the same Python traceback everyone else has reported:

Unable to complete install '<class 'libvirt.libvirtError'> internal error unable to start guest: char device redirected to /dev/pts/7
char device redirected to /dev/pts/8

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 1501, in do_install
    dom = guest.start_install(False, meter = meter)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 541, in start_install
    return self._do_install(consolecb, meter, removeOld, wait)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 633, in _do_install
    self.domain = self.conn.createLinux(install_xml, 0)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 974, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error unable to start guest: char device redirected to /dev/pts/7
char device redirected to /dev/pts/8

'

Here is some (short) hardware information as suggested by the wiki page. I'll attach some log files shortly.

# cat /var/log/libvirt/qemu/CentOS.log
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/bin/qemu-kvm -S -M pc -m 512 -smp 1 -name CentOS -uuid dd2df889-25da-38fc-de81-0ea7f63c055a -monitor pty -pidfile /var/run/libvirt/qemu//CentOS.pid -no-reboot -boot d -drive file=/var/lib/libvirt/images/CentOS-3.img,if=ide,index=0 -drive file=/home/error/Download/CentOS-5.3-x86_64-bin-DVD/CentOS-5.3-x86_64-bin-DVD.iso,if=ide,media=cdrom,index=2 -net nic,macaddr=54:52:00:24:de:71,vlan=0 -net tap,fd=21,vlan=0 -serial pty -parallel none -usb -vnc 127.0.0.1:0 
char device redirected to /dev/pts/7
char device redirected to /dev/pts/8


# rpm -q kernel qemu-kvm python-virtinst virt-viewer virt-manager
kernel-2.6.29.5-191.fc11.x86_64
qemu-kvm-0.10.5-3.fc11.x86_64
python-virtinst-0.400.3-8.fc11.noarch
virt-viewer-0.0.3-4.fc11.x86_64
virt-manager-0.7.0-5.fc11.x86_64

# uname -a
Linux underground 2.6.29.5-191.fc11.x86_64 #1 SMP Tue Jun 16 23:23:21 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

# cat /proc/cpuinfo
<snip>
processor	: 7
vendor_id	: GenuineIntel
cpu family	: 6
model		: 26
model name	: Intel(R) Core(TM) i7 CPU         920  @ 2.67GHz
stepping	: 4
cpu MHz		: 1600.000
cache size	: 8192 KB
physical id	: 0
siblings	: 8
core id		: 3
cpu cores	: 4
apicid		: 7
initial apicid	: 7
fpu		: yes
fpu_exception	: yes
cpuid level	: 11
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 lahf_lm ida tpr_shadow vnmi flexpriority ept vpid
bogomips	: 5344.67
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

# virsh capabilities
<capabilities>

  <host>
    <cpu>
      <arch>x86_64</arch>
    </cpu>
    <topology>
      <cells num='1'>
        <cell id='0'>
          <cpus num='8'>
            <cpu id='0'/>
            <cpu id='1'/>
            <cpu id='2'/>
            <cpu id='3'/>
            <cpu id='4'/>
            <cpu id='5'/>
            <cpu id='6'/>
            <cpu id='7'/>
          </cpus>
        </cell>
      </cells>
    </topology>
  </host>

  <guest>
    <os_type>hvm</os_type>
    <arch name='i686'>
      <wordsize>32</wordsize>
      <emulator>/usr/bin/qemu</emulator>
      <machine>pc</machine>
      <machine>isapc</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/bin/qemu-kvm</emulator>
      </domain>
    </arch>
    <features>
      <pae/>
      <nonpae/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
      <wordsize>64</wordsize>
      <emulator>/usr/bin/qemu-system-x86_64</emulator>
      <machine>pc</machine>
      <machine>isapc</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/bin/qemu-kvm</emulator>
      </domain>
    </arch>
    <features>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

</capabilities>
Comment 22 Michael Hampton 2009-07-19 05:19:01 EDT
Created attachment 354270 [details]
~/.virt-manager/virt-manager.log
Comment 23 Michael Hampton 2009-07-19 05:20:12 EDT
Created attachment 354271 [details]
/var/log/messages
Comment 24 Mark McLoughlin 2009-08-07 10:30:37 EDT
Michael: thanks for the info, but what I'm really trying to get to the bottom of in this bug is the socket error

The 'char device redirected' thing is extremely generic, it could be anything.

Your kernel oops is probably caused by loading the vboxdrv module. See also bug #499307. Try removing that module, rebooting and trying again

Closing this bug as INSUFFICIENT_DATA because we need more info to figure out what the socket error was all about

Note You need to log in before you can comment on or make changes to this bug.