參考資料:
https://wiki.qemu.org/Hosts/W32
http://www.cnblogs.com/silvermagic/p/7666143.html
- Prepare(Install) Fedora 26 Virual Machine
- Prepare mingw64 envionment
yum install mingw64-pixman mingw64-glib2 mingw64-gmp mingw64-SDL mingw64-pkg-config yum install mingw64-winpthreads-static
- Download VSS SDK
http://www.microsoft.com/en-us/download/details.aspx?id=23490
from QEMU source./qemu/scripts/extract-vsssdk-headers setup.exe
- 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
- Copy qemu-ga-x86_64.msi to Windows VM and install it.
- 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
第一次編譯時發生下面錯誤
—————————-
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)