Home  >  Article  >  Computer Tutorials  >  How to restart WSL using PowerShell, CMD, Task Manager

How to restart WSL using PowerShell, CMD, Task Manager

PHPz
PHPzforward
2024-02-19 16:49:05925browse

WSL or Windows Subsystem for Linux is a built-in feature of Windows 10/11 that allows users to run a Linux environment on Windows systems without the need to dual-boot or use a virtual machine. Restarting WSL is a convenient and efficient way to reboot or reinitialize a Linux instance without restarting the entire system. This article will focus on how to restart WSL through Windows PowerShell, Command Prompt (CMD) and Task Manager.

How to restart WSL using PowerShell, CMD, Task Manager

How to restart WSL using PowerShell, CMD, Task Manager

You can use any of the following methods to restart WSL on Windows.

  • WSL Command
  • Restart a specific Linux distribution
  • Service via LxssManager
  • Use CMD to restart WSL
  • Restart WSL from Task Manager
  • Please make sure to save your work on whatever distribution you are using because when you restart the WSL service it will shut down.

    1]WSL command

    To restart WSL from Windows PowerShell, we use the WSL command with appropriate options. It is a Windows executable command that interacts with the WSL distribution.

    • After clicking the search icon on the desktop, type PowerShell.
    • At the PowerShell prompt, type the following command and press Enter:
    WSL-关闭
    • You can start WSL again by clicking the application icon on the desktop or searching for it in the Start menu.

    WSL-Shutdown will terminate all active WSL distributions or instances currently running on the physical system or device. Multiple WSL distributions can be installed on the computer, such as Ubuntu, Debian, Kali, etc., and all of these distributions can be shut down and restarted simultaneously through the above steps.

    The above is the detailed content of How to restart WSL using PowerShell, CMD, Task Manager. For more information, please follow other related articles on the PHP Chinese website!

    Statement:
    This article is reproduced at:mryunwei.com. If there is any infringement, please contact admin@php.cn delete