This article will show how to fix The Windows Subsystem for Linux instance has terminated error in WSL. Usually, this error is associated with WSL2. The affected users are not able to use Ubuntu Distro in Windows Subsystem for Linux on Windows 11/10 due to this error. If you are in such a situation, you can use the suggestions provided in this article.
The Windows Subsystem for Linux instance has terminated
If you encounter The Windows Subsystem for Linux instance has terminated error while using WSL, use the following fixes to resolve this error.
- Shut down WSL and start a new session
- Make sure that you are using the latest version of the WSL Linux Kernel
- Check for Windows Update
- Remove the NAS storage entry in fstab (if applicable)
- Did you mount the folder through a VPN?
Let’s see all these fixes in detail.
1] Shut down WSL and start a new session
We suggest you use this fix before following other fixes. End the session by shutting down the Windows Subsystem for Linux and start the session again. To end the session in WSL, use the following command:
wsl --shutdown
Now, start a new session in WSL and see if the error occurs.
2] Make sure that you are using the latest version of the WSL Linux Kernel
Check if an update for the WSL Linux Kernel is available or not. If yes, install the update. Launch the Command Prompt as an administrator and execute the following command.
wsl --update
After executing the above command, Windows will start checking for updates and apply the update automatically (if available).
3] Check for Windows Update
Usually, this error occurs while using WSL2. Therefore, you can try downgrading WSL2 to WSL1 and see if it works. If you have used the following command to install Linux distributions in WSL, by default, version 2 will be installed on your system.
wsl --install
You can also check the version of WSL by using the following command:
wsl -l -v
If you are on WSL2, you can downgrade it to WSL1. You can refer to the official Microsoft documentation to know more about WSL installation, WSL upgrade, WSL downgrade, etc.
If this works, a Windows Update can fix the issue. We suggest you check for Windows Update manually and install the same if available.
4] Remove the NAS storage entry in fstab (if applicable)
This error may occur if you have mounted the NAS storage through /etc/fstab. /etc/fstab is a file where you can declare other filesystems, like an SMB share. Thus, you can mount the filesystems automatically in WSL on start-up. In such a case, you will receive this error when the NAS storage fails.
Remove the NAS storage entry from the /etc/fstab and then see if the error persists or not. If this fixes the problem, there may be some issue with your NAS storage or you may have to configure it again.
5] Did you mount the folder through a VPN?
SSHFS is a filesystem in user space that uses the SSH file transfer protocol (SFTP) to mount a remote filesystem. If you have used this command to mount a remote file system and the mounted file or folder is in the VPN network, you will get this error if the VPN is not started. Therefore, make sure that the VPN is started (if this is the case with you).
I hope this helps.
Why is my WSL not working?
There can be many reasons for why your WSL is not working. You need to investigate the cause . Some possible causes include an outdated version of the WSL Linux Kernel, the WSL is not shut down properly, etc.
How do I restart WSL?
You can restart WSL by shutting it down. To shut down WSL, you can use the command “wsl –shutdown.” Before shutting down WSL, save your progress. After doing this, your WSL will automatically be restarted the next time you launch a WSL application.
Read next: WSL2 is not working on Windows.