📜  dism.exe online enable-feature featurename:Microsoft-Windows-Subsystem-Linux all norestart - Shell-Bash (1)

📅  最后修改于: 2023-12-03 14:40:45.409000             🧑  作者: Mango

Enabling Windows Subsystem for Linux via Command Line

If you're a programmer using Windows, you may find the need to use Linux configurations or commands. Luckily, Windows makes this possible with its Windows Subsystem for Linux (WSL). In this tutorial, we will show you how to enable this feature through command line using the dism.exe tool.

Prerequisites

Before proceeding, ensure that you meet the following requirements:

  • Your computer is running Windows 10 version 1607 or higher
  • You have administrator privileges
  • You have internet access
Steps
  1. Open Command Prompt as an Administrator
  2. Enter the following command to enable the feature:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

This will start the installation of WSL and may take several minutes to complete.

  1. After installation is complete, restart your computer.

  2. Once your computer has restarted, you can launch the "Bash on Ubuntu on Windows" app or any other Linux distribution app from the Microsoft Store.

Code Snippet
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

This command will enable the Windows Subsystem for Linux through the command line. Make sure to include the /all and /norestart flags to ensure all necessary components are installed and to prevent your computer from restarting in the middle of the process.

Happy programming with WSL!