Ouvrir dans l'explorateur

Allow WSL container

Cette stratégie n'a pas de traduction française dans les modèles de l'éditeur ; le texte original est en anglais.

Type
Ordinateur
Chemin GPO
Configuration ordinateur › Stratégies › Modèles d'administration › Windows Subsystem for Linux › WSL container EN : Computer Configuration › Policies › Administrative Templates › Windows Subsystem for Linux › WSL container
Pris en charge sur
SUPPORTED_Windows10
Fichier ADMX
WSL.admx
Nom interne
WSL/AllowWSLContainer

Explication

This policy controls whether WSL container can be used on this machine. When enabled or not configured, users and Windows applications can run Linux containers via WSL. When set to disabled, WSL container is blocked for all users and Windows apps cannot run Linux containers. Warning: Setting this to 'Disabled' can break Windows apps that depend on Linux containers.

Registre

HKEY_LOCAL_MACHINE\Software\Policies\WSL
Nom de la valeur
AllowWSLContainer
ÉtatValeur écrite
ActivéREG_DWORD = 1
DésactivéREG_DWORD = 0

PowerShell

Commandes PowerShell qui écrivent dans le registre ce que la stratégie écrirait. Les valeurs entre chevrons (<…>) sont à remplacer.

Écrire directement dans le registre contourne la stratégie de groupe : si une GPO gère cette valeur, elle sera réécrite au prochain gpupdate ; sinon la valeur reste en place (effet « tatouage »). Préférez une GPO ou, en local, LGPO.exe. Exécutez PowerShell en administrateur pour HKLM. Certaines stratégies demandent un redémarrage ou gpupdate /force.

Activer

# Activer : WSL/AllowWSLContainer
$k = 'HKLM:\Software\Policies\WSL'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AllowWSLContainer' -Value 1 -Type DWord

Désactiver

# Désactiver : WSL/AllowWSLContainer
$k = 'HKLM:\Software\Policies\WSL'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AllowWSLContainer' -Value 0 -Type DWord

Revenir à « Non configuré »

# Revenir à « Non configuré » : WSL/AllowWSLContainer
$k = 'HKLM:\Software\Policies\WSL'
Remove-ItemProperty -Path $k -Name 'AllowWSLContainer' -ErrorAction SilentlyContinue

Application

Sous-système Windows pour Linux (WSL) (Microsoft) — modèles de novembre 2026

Modèles officiels téléchargés le 12 novembre 2026.