The Windows subsystem Linux is the additional feature that comes in Windows 10 and allows users to run the Linux environment directly on Windows without any Virtual machine. The users can easily enable this service from the control panel and after that by installing a Linux app from the Microsoft store can easily run Linux commands. (See: How to enable WSL and install Ubuntu).
As the Linux environment apps such as Ubuntu, Debian, OpenSuse, or Kali do not support the Systemd that provides fundamental building blocks for a Linux operating system, we can’t use reboot or use the systemctl commands to manage the systemd services. So, in such a case, if we want to restart the windows subsystem for the Linux Lxssmanager service, what to do? Here in this article, you will get a simple solution for that.
Restart WSL 1 or 2 in Windows 11 or 10 using the command given below…
For WSL2, it is recommended to use this Powershell command. Right-click on the Windows Start button and select Powershell (Admin) or Windows Terminal (Admin). There issue the below-given command:
Now, again open your WSL apps such as ubuntu or any other and it will start again.
Method 1: Restart the Lxssmanager service
- Press Win Key + R
- The Windows RUN box will open
- Type services.msc and hit the enter button.
- From the Services window search for a Windows Subsystem for Linux service called LxssManager.
- Right-click on the Lxssmanager service and select the option Restart. This will reboot/restart the windows subsystem for Linux -WSL (Ubuntu, Debian, Kali, OpenSUSE, etc). In the same way to shut down or stop WSL select the STOP option.
Method 2: Powershell to Restart LxssManager
If you don’t want to use the above step then simply use the command given below in PowerShell as Admin.
1. Right-click on the Windows 10 Start button.
2. Select the Windows PowerShell (Admin)
3. Type the below command and press the Enter button.
Get-Service LxssManager | Restart-Service
As soon as you use the above command, it restarts the Lxssmanager service in Windows 10 services to further restart the windows subsystem for Linux.