-
References
a. QEMU Guest Agent for Windows Build Environment
-
Build Enviroment (Please refer to 0.a)
a. Build a vm with minimal installation of latest stable Fedora (Thrity 30).
b. Install Ruby.
sudo yum install ruby
c. Install Docker.
cd /tmp/ curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh sudo systemctl enable docker.service sudo gpasswd -a <username> docker sudo systemctl start docker.service
d. Install rebuild.
sudo yum install ruby-devel sudo dnf groupinstall development-tools rpm-development-tools c-development gem install rake gem install rbld
e. Setting up the environment.
rbld create --base fedora qemu-ga-win rbld modify qemu-ga-win:initial <In the docker> sudo dnf update -y sudo dnf install -y git glib2-devel libfdt-devel pixman-devel zlib-devel \ python gcc findutils make msitools \ mingw*-glib2 mingw*-pixman* mingw*-gmp mingw*-SDL2 mingw*-pkg-config \ mingw*-glib2-static mingw*-zlib-static \ mingw*-winpthreads-static mingw*-pcre-static \ flex bison <Ctrl-D to exit> rbld commit qemu-ga-win:initial --tag <tagname> rbld rm qemu-ga-win:initial
-
Modify the source code of qemu-ga (Please refer 0.b and 0.c)
a. Into the build docker and download the source code of qemu.
rbld run qemu-ga-win:<tagname> git clone https://github.com/qemu/qemu.git cd qemu curl -o VSS_SDK_7.2_setup.exe https://download.microsoft.com/download/9/4/c/94c588cf-8176-4bdb-9d55-2597c76043c6/setup.exe scripts/extract-vsssdk-headers VSS_SDK_7.2_setup.exe
b. Modify
qemu/qga/commands-win32.c
static char *guest_wctomb_dup(WCHAR *wstr)
static char *guest_wctomb_dup(WCHAR *wstr) { char *str = NULL; size_t i; i = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL); //i = wcslen(wstr) + 1; str = g_malloc(i+1); //WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, // wstr, -1, str, i, NULL, NULL); WideCharToMultiByte(CP_UTF8, 0, wstr, -1, str, i, NULL, NULL); return str; }
(Use
WideCharToMultiByte()
twice.)c. Build qemu-ga and send to the target windows vms.
./configure --disable-docs --target-list=x86_64-softmmu --cross-prefix=x86_64-w64-mingw32- --static --enable-guest-agent-msi --with-vss-sdk make qemu-ga <this is the 64-bits build, send the built msi file to the target windows vms> make clean ./configure --disable-docs --target-list=x86_64-softmmu --cross-prefix=i686-w64-mingw32- --static --enable-guest-agent-msi --with-vss-sdk make qemu-ga <this is the 32-bits build, send the built msi file to the target windows vms>
-
If you can not install the msi file, and it didn't work for uninstalling the previus version, you can install back original version, extract and copy them into your qemu-ga folder (need to stop qemu-ga windows service), mind the file name for this build (
qemu-ga
andqemu_ga
).
Last active
August 12, 2019 07:12
-
-
Save sujunmin/bff63c05df2541dcc5d71dbe04dc1609 to your computer and use it in GitHub Desktop.
Make Windows QEMU Guest Agent Support UTF-8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment