---
dir: rtl
---
# Installing WSL2 on Windows
## Table of Contents
- [العربية](#العربية)
- [English](#english)
- [Français](#français)
## العربية
### جدول المحتويات
- [المقدمة](#المقدمة)
- [الخطوة 1: تمكين النظام الفرعي Windows لـ Linux](#الخطوة-1-تمكين-النظام-الفرعي-ويندوز-لـ-لينكس)
- [الخطوة 2: تمكين منصة الجهاز الافتراضي](#الخطوة-2-تمكين-منصة-الجهاز-الافتراضي-1)
- [الخطوة 3: تنزيل وتثبيت تحديث النواة WSL2](#الخطوة-3-تنزيل-وتثبيت-تحديث-النواة-wsl2-1)
- [الخطوة 4: تعيين WSL2 كالإصدار الافتراضي](#الخطوة-4-تعيين-wsl2-كالإصدار-الافتراضي-1)
- [الخطوة 5: تثبيت توزيع Linux](#الخطوة-5-تثبيت-توزيع-linux-1)
- [الخطوة 6: التحقق من التثبيت](#الخطوة-6-التحقق-من-التثبيت-1)
- [الختام](#الختام-1)
### المقدمة
- يسمح لك WSL2 (Windows Subsystem for Linux 2) بتشغيل توزيع Linux جنبًا إلى جنب مع تثبيت Windows الخاص بك. هذا مفيد لتشغيل التطبيقات والأدوات المستندة إلى Linux، بما في ذلك Sagemath. في هذا القسم، سنتعلم تثبيت WSL2 على Windows.
### الخطوة 1: تمكين النظام الفرعي ويندوز لـ لينكس
1. افتح PowerShell كمسؤول.
2. قم بتشغيل الأمر التالي:
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
### الخطوة 2: تمكين منصة الجهاز الافتراضي
1. قم بتشغيل الأمر التالي في PowerShell:
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
### الخطوة 3: تنزيل وتثبيت تحديث النواة WSL2
1. قم بتنزيل حزمة تحديث النواة لـ WSL2 من [https://aka.ms/wsl2kernel](https://aka.ms/wsl2kernel).
2. قم بتشغيل المثبت لتثبيت تحديث النواة لـ WSL2.
### الخطوة 4: تعيين WSL2 كالإصدار الافتراضي
1. افتح PowerShell وقم بتشغيل الأمر التالي:
```powershell
wsl --set-default-version 2
```
### الخطوة 5: تثبيت توزيع Linux
1. افتح متجر Microsoft وابحث عن توزيع Linux المفضل لديك (على سبيل المثال، Ubuntu).
2. انقر على التوزيع، ثم انقر على الزر "الحصول Get" لتنزيله وتثبيته.
3. بمجرد التثبيت، انقر فوق "تشغيل" لإكمال التثبيت وإعداد حساب المستخدم Linux الخاص بك.
### الخطوة 6: التحقق من التثبيت
- افتح PowerShell وقم بتشغيل الأمر التالي للتحقق من إصدار تثبيت WSL الخاص بك:
```powershell
wsl --list --verbose
```
- تأكد من أن التوزيع المثبت لديك مضبوط على الإصدار 2.
### الختام
- لقد قمت الآن بتثبيت WSL2 على جهاز Windows الخاص بك. يمكنك الآن استخدام أمر `wsl` في PowerShell أو cmd للوصول إلى نظام Linux الجزئي وتشغيل التطبيقات المستندة إلى Linux مثل Sagemath. استمتع بتجربة العمل مع البيئة اللينكسية على جهازك الخاص بنظام Windows!
## English
### Table of Contents
- [Introduction](#introduction)
- [Step 1: Enable the Windows Subsystem for Linux](#step-1-enable-the-windows-subsystem-for-linux)
- [Step 2: Enable Virtual Machine Platform](#step-2-enable-virtual-machine-platform)
- [Step 3: Download and Install the WSL2 Kernel Update](#step-3-download-and-install-the-wsl2-kernel-update)
- [Step 4: Set WSL2 as the Default Version](#step-4-set-wsl2-as-the-default-version)
- [Step 5: Install a Linux Distribution](#step-5-install-a-linux-distribution)
- [Step 6: Verify Installation](#step-6-verify-installation)
- [Conclusion](#conclusion)
### Introduction
- WSL2 (Windows Subsystem for Linux 2) allows you to run a Linux distribution alongside your Windows installation. This is useful for running Linux-based applications and tools, including Sagemath. In this section, we will guide you through the installation of WSL2 on Windows.
### Step 1: Enable the Windows Subsystem for Linux
1. Open PowerShell as Administrator.
2. Run the following command:
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
### Step 2: Enable Virtual Machine Platform
1. Run the following command in PowerShell:
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
### Step 3: Download and Install the WSL2 Kernel Update
1. Download the WSL2 kernel update package from [https://aka.ms/wsl2kernel](https://aka.ms/wsl2kernel).
2. Run the installer to install the WSL2 kernel update.
### Step 4: Set WSL2 as the Default Version
1. Open PowerShell and run the following command:
```powershell
wsl --set-default-version 2
```
### Step 5: Install a Linux Distribution
1. Open the Microsoft Store and search for your preferred Linux distribution (e.g., Ubuntu).
2. Click on the distribution, then click on the "Get" button to download and install it.
3. Once installed, click "Launch" to complete the installation and set up your Linux user account.
### Step 6: Verify Installation
- Open PowerShell and run the following command to check the version of your WSL installation:
```powershell
wsl --list --verbose
```
- Ensure that your installed distribution is set to version 2.
### Conclusion
- Now that you've installed WSL2 on your Windows machine, you can proceed to install and use Linux-based applications like Sagemath by using the `wsl` command in PowerShell or cmd to run the subsystem Linux.
## Français
### Table des matières
- [Introduction](#introduction-1)
- [Étape 1: Activer le sous-système Windows pour Linux](#étape-1-activer-le-sous-système-windows-pour-linux-1)
- [Étape 2: Activer la plateforme de machine virtuelle](#étape-2-activer-la-plateforme-de-machine-virtuelle-1)
- [Étape 3: Télécharger et installer la mise à jour du noyau WSL2](#étape-3-télécharger-et-installer-la-mise-à-jour-du-noyau-wsl2-1)
- [Étape 4: Définir WSL2 comme version par défaut](#étape-4-définir-wsl2-comme-version-par-défaut-1)
- [Étape 5: Installer une distribution Linux](#étape-5-installer-une-distribution-linux-1)
- [Étape 6: Vérification de l'installation](#étape-6-vérification-de-linstallation-1)
- [Conclusion](#conclusion-1)
### Introduction
- WSL2 (Windows Subsystem for Linux 2) vous permet d'exécuter une distribution Linux aux côtés de votre installation Windows. Ceci est utile pour exécuter des applications et des outils basés sur Linux, y compris Sagemath. Dans cette section, nous vous guiderons à travers l'installation de WSL2 sur Windows.
### Étape 1: Activer le sous-système Windows pour Linux
1. Ouvrez PowerShell en tant qu'administrateur.
2. Exécutez la commande suivante :
```powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
```
### Étape 2: Activer la plateforme de machine virtuelle
1. Exécutez la commande suivante dans PowerShell :
```powershell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
```
### Étape 3: Télécharger et installer la mise à jour du noyau WSL2
1. Téléchargez le package de mise à jour du noyau WSL2 à partir de [https://aka.ms/wsl2kernel](https://aka.ms/wsl2kernel).
2. Exécutez l'installateur pour installer la mise à jour du noyau WSL2.
### Étape 4: Définir WSL2 comme version par défaut
1. Ouvrez PowerShell et exécutez la commande suivante :
```powershell
wsl --set-default-version 2
```
### Étape 5: Installer une distribution Linux
1. O uvrir le Microsoft Store et recherchez votre distribution Linux préférée (par exemple, Ubuntu).
2. Cliquez sur la distribution, puis cliquez sur le bouton "Obtenir" pour la télécharger et l'installer.
3. Une fois installée, cliquez sur "Lancer" pour terminer l'installation et configurer votre compte utilisateur Linux.
### Étape 6: Vérification de l'installation
- Ouvrez PowerShell et exécutez la commande suivante pour vérifier la version de votre installation WSL :
```powershell
wsl --list --verbose
```
- Assurez-vous que votre distribution installée est définie sur la version 2.
### Conclusion
- Maintenant que vous avez installé WSL2 sur votre machine Windows, vous pouvez passer à l'installation et à l'utilisation d'applications basées sur Linux telles que Sagemath en utilisant la commande `wsl` dans PowerShell ou cmd pour exécuter le sous-système Linux .