Bug 1400381

Summary: [virtio-win] qemu-ga start failed
Product: [Community] Virtualization Tools Reporter: euroford <an.euroford>
Component: virtio-winAssignee: Yvugenfi <yvugenfi>
Status: CLOSED WORKSFORME QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: ghammer, lijin, michen, phou, virt-maint, vrozenfe, wyu, xiagao, yvugenfi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-08 13:09:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description euroford 2016-12-01 02:59:13 UTC
Description of problem:
"qemu-ga.exe -d" start failed

Version-Release number of selected component (if applicable):
virtio-win-0.1.126.iso

How reproducible:
install guest-agent with virtio-win-0.1.1/guest-agent/qemu-ga-x86.exe

Steps to Reproduce:
1.cd C:\Program Files\qemu-agent
2.qemu-ga.exe -d
3.

Actual results:
critical: error opening path
critical: error opening channel
critical: failed to create guest agent channel
critical: failed to initialize guest agent channel

Expected results:
work

Additional info:

Comment 1 euroford 2016-12-01 03:12:22 UTC
<domain type='kvm' id='9'>
  <name>win7</name>
  <uuid>dd495850-9136-4ecd-8740-781e3968a441</uuid>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.7'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
    </hyperv>
    <vmport state='off'/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='forbid'>Skylake-Client</model>
  </cpu>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
    <timer name='hypervclock' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/win7.qcow2'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/home/emind/文档/VM/virtio-win-0.1.126.iso'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <alias name='usb'/>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <alias name='usb'/>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:b6:9e:56'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'>
      <alias name='input1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
      <image compression='off'/>
    </graphics>
    <sound model='ich6'>
      <alias name='sound0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir0'/>
      <address type='usb' bus='0' port='2'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <alias name='redir1'/>
      <address type='usb' bus='0' port='3'/>
    </redirdev>
    <memballoon model='virtio'>
      <stats period='5'/>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none' model='none'/>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+1000:+100</label>
    <imagelabel>+1000:+100</imagelabel>
  </seclabel>
</domain>

Comment 2 euroford 2016-12-01 04:25:06 UTC
2016-12-01 01:47:17.387+0000: starting up libvirt version: 2.4.0, package: 1+b1 (amd64 Build Daemon (binet) <buildd-binet.org> Thu, 03 Nov 2016 13:20:46 +0100), qemu version: 2.7.0(Debian 1:2.7+dfsg-3+b1), hostname: emind-pc
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin QEMU_AUDIO_DRV=spice /usr/bin/kvm -name guest=win7,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-9-win7/master-key.aes -machine pc-i440fx-2.7,accel=kvm,usb=off,vmport=off,dump-guest-core=off -cpu Skylake-Client,hv_time,hv_relaxed,hv_vapic,hv_spinlocks=0x1fff -m 4096 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid dd495850-9136-4ecd-8740-781e3968a441 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-9-win7/monitor.sock,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=/var/lib/libvirt/images/win7.qcow2,format=qcow2,if=none,id=drive-ide0-0-0 -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive file=/home/emind/文档/VM/virtio-win-0.1.126.iso,format=raw,if=none,id=drive-ide0-0-1,readonly=on -device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 -netdev tap,fd=26,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:b6:9e:56,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0,bus=usb.0,port=1 -spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=2 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=3 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 -msg timestamp=on
char device redirected to /dev/pts/0 (label charserial0)
main_channel_link: add main channel client
red_dispatcher_set_cursor_peer:
inputs_connect: inputs channel client create

Comment 3 euroford 2016-12-01 06:44:51 UTC
vport0p1 driver is unsigned.

Comment 4 Yvugenfi@redhat.com 2016-12-01 09:19:54 UTC
(In reply to euroford from comment #3)
> vport0p1 driver is unsigned.

Hi,

It should work with unsigned driver as well. 

Do you run it from elevated shell (run cmd or PS as administrator)?

Comment 5 Gal Hammer 2016-12-01 10:16:23 UTC
It seems like you VM's configuration is missing the guest agent channel:

<channel type='unix'>
   <source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/>
   <target type='virtio' name='org.qemu.guest_agent.0'/>
</channel>

Comment 6 euroford 2016-12-01 10:51:07 UTC
(In reply to Yan Vugenfirer from comment #4)
> (In reply to euroford from comment #3)
> > vport0p1 driver is unsigned.
> 
> Hi,
> 
> It should work with unsigned driver as well. 
> 
> Do you run it from elevated shell (run cmd or PS as administrator)?

sure, got the same failure.

I think vport driver is not work.

Comment 7 euroford 2016-12-01 10:54:48 UTC
(In reply to Gal Hammer from comment #5)
> It seems like you VM's configuration is missing the guest agent channel:
> 
> <channel type='unix'>
>    <source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/>
>    <target type='virtio' name='org.qemu.guest_agent.0'/>
> </channel>


Should Windows7 VM use this configure: 
<channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>

Comment 8 Gal Hammer 2016-12-01 12:21:38 UTC
(In reply to euroford from comment #7)
> (In reply to Gal Hammer from comment #5)
> > It seems like you VM's configuration is missing the guest agent channel:
> > 
> > <channel type='unix'>
> >    <source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/>
> >    <target type='virtio' name='org.qemu.guest_agent.0'/>
> > </channel>

This one is required if you plan to use the qemu guest agent. 
 
> Should Windows7 VM use this configure: 
> <channel type='spicevmc'>
>       <target type='virtio' name='com.redhat.spice.0'/>
>       <address type='virtio-serial' controller='0' bus='0' port='1'/>
> </channel>

This one is required if you plan to use the spice agent (connecting to the VM using the spice client).

Comment 9 euroford 2016-12-02 03:39:52 UTC
Thanks Gal, guest agent start up, but I can't drag and drop any file.

Comment 10 euroford 2016-12-02 05:43:26 UTC
Should virtio-win include vdagent-win?

Comment 11 xiagao 2016-12-05 03:04:41 UTC
(In reply to euroford from comment #9)
> Thanks Gal, guest agent start up, but I can't drag and drop any file.

Hi euroford,
What do you mean "drag and drop any file"?

Anyway,for windows guest agent, the related commands are not wholly supported:
{"execute":"guest-get-vcpus"}
{"execute":"guest-network-get-interfaces"}     
{"execute":"guest-file-open", "arguments":{"path":"/tmp/testqga","mode":"r"}} 
{"execute":"guest-file-read", "arguments":{"handle":1000,"count":1024}}
{"execute":"guest-file-seek","arguments":{"handle":1000,"offset":2,"whence":0}}
{"execute":"guest-file-flush","arguments":{"handle":1000,"count":1024}} 
{"execute":"guest-file-write","arguments":{"handle":1000,"buf-b64":"aGVsbG8gd29ybGQhCg=="}}
{"execute":"guest-file-close","arguments":{"handle":1000}}
{ "execute": "guest-suspend-hybrid"}
{ "execute": "guest-suspend-disk"}
{ "execute": "guest-suspend-ram"}

Thanks,
xiagao

Comment 12 Yvugenfi@redhat.com 2016-12-08 13:09:02 UTC
You can download vdagent from here: https://www.spice-space.org/download.html

Comment 13 euroford 2016-12-21 03:05:55 UTC
(In reply to Yan Vugenfirer from comment #12)
> You can download vdagent from here: https://www.spice-space.org/download.html

You're right, but I think virtio-win should include vdagent-win, it's an other bug.