Installation WSL Automatisée

VérifiéPrudence

Automatise l'installation et la validation du sous-système Windows pour Linux (WSL) sur Windows. Prend en charge à la fois les installations modernes en une commande pour Windows 10 build 19041+ et les chemins manuels pour les versions plus anciennes. Utilisez-le lorsqu'un utilisateur doit installer WSL, configurer une distribution Linux ou diagnostiquer un environnement WSL défectueux.

Spar Skills Guide Bot
DeveloppementIntermédiaire
02/06/2026
Claude Code
#install-wsl#windows-subsystem-linux#ubuntu#automation#environment-setup

Recommandé pour

Synthèse automatique

Installe et valide automatiquement WSL (Windows Subsystem for Linux) sur Windows, avec des chemins d'installation modernes et manuels.

Points forts

  • Détection automatique de la méthode d'installation appropriée selon la version de Windows
  • Validation complète après installation pour garantir le bon fonctionnement
  • Instructions claires pour les étapes nécessitant une intervention humaine (redémarrage, création d'utilisateur)
  • Gestion des erreurs et chemins de récupération explicites

Limites

  • Nécessite que l'utilisateur exécute PowerShell en tant qu'administrateur
  • Ne fonctionne que sur Windows, pas sur d'autres systèmes d'exploitation
  • Les changements de BIOS ou de virtualisation ne peuvent pas être automatisés
Quand l'utiliser

Utilisez cette compétence lorsque vous devez installer WSL ou Ubuntu sur Windows, réparer une installation existante, ou configurer un environnement de développement Linux sur Windows.

Quand l'éviter

Ne l'utilisez pas si l'utilisateur n'a pas les droits administrateur, ou si une distribution Linux spécifique non prise en charge est demandée.

Analyse de sécurité

Prudence
Score qualité90/100

The skill automates a legitimate system administration task (WSL installation) using privileged scripts, which is inherently powerful but not malicious. No destructive or exfiltration actions are described. However, the absence of script content in the audit scope means the skill references external code that could be altered, so caution is warranted.

Points d'attention
  • •Executes PowerShell scripts with likely administrator privileges, which can modify Windows features, install software, and restart the system.
  • •Relies on external script files (e.g., install-wsl-modern.ps1) whose contents are not provided in the skill, creating supply-chain risk if those scripts are compromised.
Comment cette analyse est faite

Exemples

Install WSL with default Ubuntu
Install WSL on my Windows machine with the default Ubuntu distribution.
Fix broken WSL installation
My WSL installation is broken. Can you diagnose and fix it?
Set up Linux development environment
I need Linux tools on Windows for development. Please set up WSL with Ubuntu.

name: install-wsl-auto description: Installs and validates WSL on Windows with guided automation for modern and legacy installation paths. Use when a user asks to install WSL, set up Linux on Windows, or fix a broken WSL install.

AI Builder - Install WSL Auto

This skill installs Windows Subsystem for Linux (WSL) safely, chooses the correct installation path, validates the environment, and gives the user a practical post-install guide.

When to Use This Skill

  • User asks to install WSL or Ubuntu on Windows.
  • User needs Linux tooling on Windows for development.
  • Existing WSL installation is broken and needs diagnosis or repair.
  • User needs beginner-friendly setup plus verification.

Your Roles in This Skill

  • SysOps Engineer: Assess system readiness, run installation scripts, and apply platform-safe defaults.
  • QA Engineer: Validate installation with deterministic checks and capture pass/fail results.
  • Customer Support: Explain each step in plain language, confirm user decisions, and provide recovery paths.
  • Technical Writer: Deliver a concise quick-start and troubleshooting handoff.

Role Communication

As an expert in your assigned roles, you must announce your actions before performing them using the following format:

As a {Role, and Role-XYZ if have more roles}, I will {action description}

This communication pattern ensures transparency and allows for human-in-the-loop oversight at key decision points.

Key Principles

  • Prefer the modern one-command flow on Windows 10 build 19041+ and Windows 11.
  • Keep user-impacting actions explicit (especially restart and BIOS changes).
  • Use scripts for repeatability; avoid ad-hoc command variations.
  • Do not claim success until validation passes.
  • If installation cannot be completed automatically, provide exact manual next steps.

Instructions

Follow these steps in order.

Step 1: Confirm Context and Safety

  1. Confirm the user is on Windows and can run PowerShell as Administrator.
  2. Explain that enabling Windows features and restarting are expected.
  3. Ask whether to use the default distribution (Ubuntu-22.04) or a user-specified distro.
  4. If the user is unsure, use: references/distributions.md and choose a beginner-safe default (Ubuntu-22.04).

Step 2: Run Compatibility Check

  1. Execute: scripts/check-wsl-compatibility.ps1
  2. Parse the JSON summary at the end and decide:
    • method = modern: continue to Step 3A.
    • method = manual: continue to Step 3B.
    • method = unsupported: stop and provide upgrade guidance.
  3. If not running as admin, stop and ask the user to reopen PowerShell as Administrator.

Step 3A: Modern Install Path

Use this path for Windows build 19041+.

  1. Execute: scripts/install-wsl-modern.ps1 -Distribution <distro> The script normalizes common distro aliases and rejects unsupported distro names.
  2. If the script reports needsRestart = true, guide the restart.
  3. After restart, continue with Step 4 and Step 5.

Step 3B: Manual Install Path

Use this path for older Windows 10 builds.

  1. Pre-restart phase: scripts/install-wsl-manual.ps1 -Distribution <distro>
  2. Restart Windows when prompted.
  3. Post-restart phase: scripts/install-wsl-manual.ps1 -ContinueAfterRestart -Distribution <distro> The script normalizes common distro aliases and validates availability.
  4. If kernel update is required, follow the official Microsoft package flow noted by the script output.
  5. Continue with Step 4 and Step 5.

Step 4: First-Run User Setup

  1. Ensure the Linux distro launches once.
  2. Guide user to create Linux username and password.
  3. Explain password entry has no visible characters in terminal.
  4. Confirm the user can reopen WSL after first-run setup.

Step 5: Validate Installation

  1. Execute: scripts/test-wsl.ps1 -Strict
  2. Confirm:
    • WSL command available
    • At least one distro installed
    • At least one distro is running WSL 2
    • Command execution inside WSL works
    • Basic Linux toolchain works (apt available)
    • Network check inside WSL works
    • /mnt/c access works
  3. If strict mode fails only on network checks in constrained environments, rerun: scripts/test-wsl.ps1 and treat network as advisory.
  4. If checks fail, route to references/troubleshooting.md.

Step 6: Handoff and Next Steps

  1. Provide a short result summary: install method, distro, and validation outcome.
  2. Provide quick-start guidance from: references/user-guide.md
  3. If unresolved issues remain, provide targeted fixes from: references/troubleshooting.md
  4. If distro selection needs adjustment or reinstall, use: references/distributions.md
  5. End with concrete next action for the user.

Expected Output

Provide a structured final report with:

  • Environment summary (Windows build, chosen path)
  • Actions executed (scripts and parameters)
  • Validation results (pass/fail per test)
  • Any remaining blockers with exact remediation steps
  • Quick-start commands for daily use (wsl, wsl --shutdown, sudo apt update)

Common Issues

  • Installation requires restart before WSL commands are available.
  • BIOS virtualization disabled blocks WSL 2.
  • Corporate policy can block Windows optional feature changes.
  • DNS or VPN conflicts can break WSL networking after install.

When these occur, use references/troubleshooting.md and report exactly which step failed.

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/install-wsl-auto-mmlj2p00/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/install-wsl-auto-mmlj2p00' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/install-wsl-auto-mmlj2p00/download' --output '.skill-downloads/install-wsl-auto-mmlj2p00/SKILL.md.part' && mv '.skill-downloads/install-wsl-auto-mmlj2p00/SKILL.md.part' '.skill-downloads/install-wsl-auto-mmlj2p00/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/install-wsl-auto-mmlj2p00/SKILL.md' && test -s '.skill-downloads/install-wsl-auto-mmlj2p00/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/install-wsl-auto' && cp -R '.skill-downloads/install-wsl-auto-mmlj2p00' '.claude/skills/install-wsl-auto'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/install-wsl-auto-mmlj2p00'

openskills read 'install-wsl-auto-mmlj2p00'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/install-wsl-auto-mmlj2p00/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires