Build(Customize) Windows QEMU Guest Agent

參考資料:

https://wiki.qemu.org/Hosts/W32

http://www.cnblogs.com/silvermagic/p/7666143.html

  1. Prepare(Install) Fedora 26 Virual Machine
  2. Prepare mingw64 envionment
    yum install mingw64-pixman mingw64-glib2  mingw64-gmp mingw64-SDL mingw64-pkg-config
    yum install mingw64-winpthreads-static
  3. Download VSS SDK
    http://www.microsoft.com/en-us/download/details.aspx?id=23490
    from QEMU source

    ./qemu/scripts/extract-vsssdk-headers setup.exe
  4. Download and build from QEMU source
    git clone https://github.com/qemu/qemu
    cd qemu
    git submodule update --init dtc
    ./configure --enable-guest-agent --cross-prefix=x86_64-w64-mingw32- --with-vss-sdk=/root/vss
    make msi -j
    
  5. Copy qemu-ga-x86_64.msi to Windows VM and install it.
  6. Test query VM IP from KVM Host.
    virsh
    list (Get VM Name or ID)
    qemu-agent-command <Name or Id> '{"execute":"guest-info"}'
    qemu-agent-command <Name or Id> '{"execute":"guest-network-get-interfaces"}'

 

 

 

 

 

 

Download: qemu-ga-x86_64(v2.10.50)

Facebook Comments Box

One thought on “Build(Customize) Windows QEMU Guest Agent”

  1. 第一次編譯時發生下面錯誤
    —————————-
    CHK version_gen.h
    AR libqemuutil.a
    LINK qga/vss-win32/qga-vss.dll
    /usr/lib/gcc/x86_64-w64-mingw32/4.9.3/../../../../x86_64-w64-mingw32/bin/ld: cannot find -lpthread
    collect2: error: ld returned 1 exit status
    make: *** [qga/vss-win32/qga-vss.dll] Error 1
    —————————-

    原因是Fedora 26需額外安裝mingw64-winpthreads-static,QEMU官方網站未說明需這個RPM ,從第二個參考網站上查到,安裝後就可以compile(yum -y install mingw64-winpthreads-static)

Leave a Reply