Guide COMPLET et RIGOUREUX : Compilation du noyau Linux 6.18 LTS pour WSL2 sous Windows 11 Enterprise (PowerShell 7.6.1)
Créé le 25 avril 2026 - Expérience réelle avec TOUTES les galères et solutions
Mis à jour le 26 avril 2026 - Ajout de Préparation Complète de l'Environnement
Cette section préparatoire essentielle détaille TOUS les prérequis pour éviter les échecs courants. Le guide utilise deux environnements distincts :
- Windows/PowerShell 7.6.1 : Pour les commandes de gestion WSL (étapes 6-8 : déploiement,
.wslconfig, activation). - Ubuntu 25.10 (WSL2) : Pour la compilation du noyau (étapes 1-5 : préparation, clonage, make).
| Environnement | Parties concernées | Commandes exécutées | Prérequis |
|---|---|---|---|
| PowerShell 7.6.1 (Windows) | Étapes 6,7,8 + Activation finale | wsl --shutdown, édition .wslconfig |
Installation manuelle (voir ci-dessous) |
| Ubuntu 25.10 (WSL2) | Étapes 1-5 | apt install, git clone, make |
WSL installé + distro Ubuntu |
WSL2 n'est pas toujours activé sur Windows 11 Enterprise. Vérifiez d'abord :
# Dans PowerShell 5.1 ou 7 (admin)
wsl --version- Si erreur "wsl introuvable" → Installez WSL2.
- Méthode officielle (10 min) :
# Terminal Admin (PowerShell ou CMD)
wsl --install
# Installe WSL2 + noyau par défaut + Ubuntu (première distro)Redémarrez Windows, puis :
wsl --install -d Ubuntu-25.10 # Si version spécifique souhaitée
wsl --set-default-version 2 # Force WSL2
wsl --update # Noyau à jourVérification :
wsl --list --verbose # Doit montrer Ubuntu-25.10 (WSL2). Sinon, installer une distro Linux de votre choixProblème courant : Virtualisation désactivée → Activez dans BIOS/UEFI ("SVM" AMD / "VT-x" Intel).
PowerShell 5.1 est préinstallé sur Windows 11 (tapez powershell).
PowerShell 7.6.1 (Core) doit être installé manuellement car cross-platform et moderne.
# Terminal Admin
winget install --id Microsoft.PowerShell --source winget- Téléchargez
PowerShell-7.6.1-win-x64.msidepuis GitHub PowerShell. - Exécutez (avec les droits admin) :
msiexec.exe /package PowerShell-7.6.1-win-x64.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ADD_PATH=1
Lancement : Tapez pwsh (pas powershell).
Vérification :
pwsh -v # → 7.6.1
$PSVersionTable # Détails complets| Aspect | PowerShell 5.1 (Natif Windows) | PowerShell 7.6.1 (Core) |
|---|---|---|
| Plateforme | Windows seulement | Windows/Linux/macOS |
| Performance | Plus lente (57x moins sur gros datasets) | 57x plus rapide sur pipelines lourds |
| Fonctionnalités | Base | Nouvelles : ForEach-Object -Parallel, SSH natif, ternaire (? :), conteneurs Docker |
| Coexistence | powershell.exe |
pwsh.exe côte-à-côte (pas de conflit) |
| Utilisation ici | OK pour basique | Requis pour WSL avancé/performant |
Pourquoi 7.6.1 ? Meilleure compatibilité WSL2, scripts cross-platform, futur-proof.
# Dans pwsh (admin)
wsl --version # OK
wsl -l -v # Ubuntu prêt
pwsh -v # 7.6.1Espace disque : 6Go+ libre (C:\ + WSL VHDX). RAM : 8Go+ (compilation -j$(nproc)).
Prêt ? Passez à la section suivante ! 🚀
Problème identifié : wsl --version affiche 6.6.114.1-1 (obsolète)
Solution validée : 6.18.20.3-microsoft-standard-WSL2+ (LTS jusqu'en 2027)
Avant : 6.6.114.1-1 (2024) - Support fin 2026
Après : 6.18.20.3+ (2026) - Support jusqu'en 2027 ✅
💻 Windows 11 Enterprise (10.0.26200.8246)
⚡ PowerShell Core 7.6.1
🐧 Ubuntu-25.10 (WSL2)
🐧 Oracle Linux 9.5 (WSL2)
💾 Espace requis : 6Go+
🧠 RAM recommandée : 8Go+
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential flex bison dwarves libssl-dev libelf-dev bc cpio qemu-utils rsync git# BRANCHE CRITIQUE : linux-msft-wsl-6.18.y
git clone --branch linux-msft-wsl-6.18.y https://github.com/microsoft/WSL2-Linux-Kernel.git
cd WSL2-Linux-Kernel
⚠️ ERREUR FATALE : Sans--branch, vous clonez6.6.ypar défaut !
make clean
sudo make KCONFIG_CONFIG=Microsoft/config-wsl# COMMANDE UNIQUE Microsoft OFFICIELLE
sudo make -j$(nproc) KCONFIG_CONFIG=Microsoft/config-wsl && \
sudo make INSTALL_MOD_PATH="$PWD/modules" modules_install KCONFIG_CONFIG=Microsoft/config-wslSuccès :
DEPMOD /modules/lib/modules/6.18.20.3-microsoft-standard-WSL2+
ls -lh arch/x86/boot/bzImage # 17.5Mo ✓
ls modules/lib/modules/6.18.20.3-microsoft-standard-WSL2+/ # Modules ✓mkdir -p /mnt/c/wsl-kernels/6.18.20.3/
cp arch/x86/boot/bzImage /mnt/c/wsl-kernels/6.18.20.3/
cp -r modules/lib/modules/6.18.20.3-microsoft-standard-WSL2+ /mnt/c/wsl-kernels/6.18.20.3/modules/Fichier : C:\Users\bbrod\.wslconfig
[wsl2]
kernel=C:\\wsl-kernels\\6.18.20.3\\bzImage# PowerShell (admin)
wsl --shutdown
wslTest final :
uname -r
# → 6.18.20.3-microsoft-standard-WSL2+ 🎉| Problème | Cause | Solution |
|---|---|---|
No such file or directory (VHDX) |
WSL2+ vs WSL2 |
Copie manuelle /modules/ |
wsl --version → 6.6 |
Info statique Microsoft | uname -r = vérité |
| OOM compilation | -j$(nproc) trop élevé |
make -j4 |
| Dépendances manquantes | bc, rsync |
apt install bc rsync |
| Métrique | Avant | Après |
|---|---|---|
| Noyau | 6.6.114.1-1 |
6.18.20.3-microsoft-standard-WSL2+ |
| Support LTS | Fin 2026 | Fin 2027 |
| Distros impactées | Aucune | Ubuntu + Oracle Linux |
wsl --version |
6.6.114.1-1 |
6.6.114.1-1 (statique) |
cd ~
rm -rf WSL2-Linux-Kernel/ # Libère 3GoMise à jour :
cd WSL2-Linux-Kernel
git pull origin linux-msft-wsl-6.18.y
# Étapes 3→8Rollback :
[wsl2]
# kernel=... ← Supprimez la ligneCopyright (c) 2026 valorisa (Bertrand Brodeau)
Licence CC-BY-SA 4.0
Expérience réelle du 25 avril 2026 :
- Compilation réussie
6.18.20.3-microsoft-standard-WSL2+ - Toutes galères incluses et résolues
- Guide 100% reproductible
Vous aussi, passez à 6.18 LTS ! 🚀