Système d'exploitation de travail : Microsoft Windows 11
Liens :
Qemu :
https://www.qemu.org/
Compile QEMU from source on Windows 11 :
https://fernandosilva.me/compile-qemu-from-source-on-windows-11-faccc5ad10b8
How to build QEMU on Windows 10/11 :
https://polyos.iscas.ac.cn/en/docs/developer-guides/build-qemu/on-windows/
Compiling QEMU for Windows using MSYS2 :
https://www.itayemi.com/blog/2024/02/21/compiling-qemu-for-windows/
Building QEMU for Windows Host on Windows :
https://medium.com/@mat.krawczuk/building-qemu-for-windows-host-on-windows-30de355b3980
Lien :
https://github.com/msys2/msys2-installer/releases/download/2025-08-30/msys2-x86_64-20250830.exe
Menu : [Démarrer][MSYS2][MSYS2 UCRT64]
$ pacman -Syu
La fenêtre se referme, relance :
$ pacman -Syu
$ pacman -S --needed \
git make python meson ninja pkgconf \
mingw-w64-ucrt-x86_64-toolchain \
mingw-w64-ucrt-x86_64-glib2 \
mingw-w64-ucrt-x86_64-pixman \
mingw-w64-ucrt-x86_64-libslirp \
mingw-w64-ucrt-x86_64-zlib \
mingw-w64-ucrt-x86_64-SDL2 \
mingw-w64-ucrt-x86_64-gtk3
$ pacman -S --needed diffutils grep sed
$ mkdir qemu-build
$ cd qemu-build/
$ git clone https://gitlab.com/qemu-project/qemu.git
$ cd qemu
$ git checkout v10.1.2
$ git switch -c qemu-win11
Switched to a new branch 'qemu-win11'
$ mkdir build && cd build
$ ../configure --target-list="x86_64-softmmu" --disable-werror --enable-slirp --enable-sdl --enable-gtk
$ make -j$(nproc)
$ ls -ls qemu-system-x86_64.exe
79568 -rwxr-xr-x 1 sgond sgond 81473903 Nov 23 16:28 qemu-system-x86_64.exe
$ ./qemu-system-x86_64.exe --version
QEMU emulator version 10.1.2 (v10.1.2)
Copyright (c) 2003-2025 Fabrice Bellard and the QEMU Project developers
$ cd
$ mkdir qemu-portable
$ cd qemu-portable/
$ cp /home/sgond/qemu-build/qemu/build/qemu-system-x86_64.exe .
$ cp /home/sgond/qemu-build/qemu/build/qemu-img.exe .
$ pacman -S mingw-w64-ucrt-x86_64-ntldd
Créer :
C:\msys64\home\sgond\qemu-portable\make-qemu-portable.sh
Ajouter :
#!/usr/bin/env bash
set -euo pipefail
# === Paramètres à adapter au besoin ===
BUILD_DIR="/home/sgond/qemu-build/qemu/build" # dossier où se trouvent les .exe et pc-bios
DEST="${HOME}/qemu-portable" # destination "portable"
# Liste des exécutables à empaqueter (ajoute qemu-img.exe, etc. si tu veux)
EXES=(
"qemu-system-x86_64.exe"
"qemu-img.exe"
# "qemu-nbd.exe"
)
# === Fonctions utilitaires ===
copy_dlls_for() {
local exe="$1"
echo "→ Analyse des DLL pour: ${exe}"
# On récupère les chemins de DLL signalés par ntldd -R
# - On extrait des chemins absolus se terminant par .dll (MSYS ou Windows)
# - On déduplique
ntldd -R -- "${exe}" \
| sed 's/\r$//' \
| grep -iE '\.dll' \
| grep -oE '([A-Za-z]:\\[^ ]+\.dll|/[^ ]+\.dll)' \
| sort -fu \
| while IFS= read -r dll; do
# Normalise les chemins Windows -> MSYS si nécessaire
if [[ "$dll" =~ ^[A-Za-z]:\\ ]]; then
# Convertit "C:\path\to\X.dll" -> "/c/path/to/X.dll"
drive=$(echo "$dll" | sed -E 's/^([A-Za-z]):.*/\1/')
rest=$(echo "$dll" | sed -E 's/^[A-Za-z]:(.*)$/\1/' | tr '\\' '/')
dll="/${drive,,}${rest}"
fi
if [[ -f "$dll" ]]; then
echo " Copie DLL: $dll"
cp -u "$dll" "$DEST"/
else
echo " DLL introuvable (ignorée): $dll"
fi
done
}
copy_pc_bios() {
# Plusieurs emplacements possibles selon ta config :
# - Dans le build dir : $BUILD_DIR/pc-bios
# - Dans le source dir (si build séparé) : $BUILD_DIR/../pc-bios
# - Dans un préfixe d’installation éventuel : share/qemu/…
local candidates=(
"$BUILD_DIR/pc-bios"
"$BUILD_DIR/../pc-bios"
"$BUILD_DIR/share/qemu"
"$BUILD_DIR/../share/qemu"
)
local found=""
for d in "${candidates[@]}"; do
if [[ -d "$d" ]]; then
found="$d"
break
fi
done
if [[ -n "$found" ]]; then
echo "→ Copie des firmwares/BIOS depuis: $found"
mkdir -p "$DEST/pc-bios"
# On copie tout (ROM/FD/EFI/kbd/json/etc.). Préserve l’arborescence.
rsync -a --delete "$found/" "$DEST/pc-bios/" 2>/dev/null || cp -a "$found/." "$DEST/pc-bios/"
else
echo " Aucun dossier pc-bios ou share/qemu trouvé. Vérifie l’emplacement."
fi
}
# === Début du script ===
mkdir -p "$DEST"
# Copie des exécutables + DLLs
for rel in "${EXES[@]}"; do
exe="$BUILD_DIR/$rel"
if [[ ! -f "$exe" ]]; then
echo " Exécutable introuvable: $exe"
exit 1
fi
echo "→ Copie EXE: $exe"
cp -u "$exe" "$DEST/"
# DLLs de l'exécutable
copy_dlls_for "$exe"
done
# Copie des firmwares/BIOS
copy_pc_bios
echo
echo " Dossier portable prêt: $DEST"
echo " Contenu typique: qemu-system-*.exe, *.dll, pc-bios/..."
Action :
Rendre exécutable le script
$ chmod +x make-qemu-portable.sh
$ ./make-qemu-portable.sh
→ Copie EXE: /home/sgond/qemu-build/qemu/build/qemu-system-x86_64.exe
→ Analyse des DLL pour: /home/sgond/qemu-build/qemu/build/qemu-system-x86_64.exe
Copie DLL: /c/msys64/ucrt64/bin/libatk-1.0-0.dll
Copie DLL: /c/msys64/ucrt64/bin/libbrotlicommon.dll
Copie DLL: /c/msys64/ucrt64/bin/libbrotlidec.dll
...
Copie DLL: /c/windows/SYSTEM32/wuceffects.dll
Copie DLL: /c/windows/SYSTEM32/XmlLite.dll
Copie DLL: /c/windows/WinSxS/amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.6280_none_792d7c952443c49a/COMCTL32.dll
Copie DLL: /c/windows/WinSxS/amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.19041.6216_none_919f98d0cc8c5626/gdiplus.dll
→ Copie des firmwares/BIOS depuis: /home/sgond/qemu-build/qemu/build/pc-bios
Dossier portable prêt: /home/sgond/qemu-portable
Contenu typique: qemu-system-*.exe, *.dll, pc-bios/...
$ cp -r ../qemu-build/qemu/pc-bios/* pc-bios/
$ ./qemu-img.exe create -f qcow2 vda.qcow2 60G
Formatting 'vda.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=64424509440 lazy_refcounts=off refcount_bits=16
$ ./qemu-system-x86_64.exe -m 2048 -display sdl -vga std -drive file=vda.qcow2,if=virtio,format=qcow2 -cdrom ./lubuntu-24.04.3-desktop-amd64.iso -boot d -net nic,model=rtl8139 -net user -smp 2 -rtc base=localtime -L pc-bios
$ ./qemu-system-x86_64.exe -m 2048 -display sdl -vga std -drive file=vda.qcow2,if=virtio,format=qcow2 -net nic,model=rtl8139 -net user -smp 2 -rtc base=localtime -L pc-bios