WSL: WSL2 - "The Windows Subsystem for Linux instance has terminated."
-
Your Windows build number: (Type
verat a Windows Command Prompt) Microsoft Windows [Version 10.0.19041.207] -
What you’re doing and what’s happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.) I moved/exported/Imported my WSL2 Debian Distro from an old Computer (AMD A10) to a newer AMD FX8350 based Computer that has a lot more memory, using WSL --import. The export and import was successful but now the distro fails to start with the message “The Windows Subsystem for Linux instance has terminated.” One thing I noticed is that if I convert the Distro from WSL v2 to WSL v1 the distro starts and im able to get into most of it. But a lot of things in the distro dont work. As soon as I convert it back to WSL v2 it fails again. Both the old and new computer are the same build of Windows 10
-
What’s wrong / what should be happening instead: The distro should start.
-
Strace of the failing command, if applicable: (If
some_commandis failing, then runstrace -o some_command.strace -f some_command some_args, and link the contents ofsome_command.stracein a gist here). -
For WSL launch issues, please collect detailed logs.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 14
- Comments: 108 (2 by maintainers)
wsl --shutdown ; wslsolved it for me.I ran
wsl --shutdownthenwsland it started working again.This is becoming really annoying. 😢 I get this error every time I turn on the PC and open the WSL console (Ubuntu-18.04).
Try restarting your
LxssManagerfrom windows services.I have the same problem. My Ubuntu distro stopped working, If I convert it to WSL1 it starts working, but when I move it back to wls 2, I can’t start it again.
EDIT: I founded what caused the problem in my distro. I have mounted folder which require “sshfs” and is in a VPN network. I couldn’t start Ubuntu because my VPN wasn’t started.
Quick solution: (1):
(2):
I’ve seen several issues that seem similar to this and to me the most frustrating things are: 1.) There doesn’t appear to be a good way to see anything that is happening to even begin to troubleshoot this. I know we can collect logs but I haven’t seen a good way to view anything useful from them without having the source code. 2.) The only responses I have seen from Microsoft were asking to submit logs but no acknowledgement of any issues or replies given after those logs were submitted to help anyone get past the issue.
I’ve now had this happen to me twice where I had a great working wsl setup then all of a sudden it just stopped working with this same error. I can export it and re-import it and the same thing happens (this leads me to believe it’s some sort of state in the file system but I have no idea how to track down what saved state to modify in the exported tar file to get it to work after re-import). The second time I should have known better than to mess with things but I saw there was a new kernel update, I installed it, then terminated the distro to get the new kernel version to take affect and it never started up again.
Is there any way to see something like dmesg type output from when an instance (distribution) tries to transition from “Stopped” to Running?
Facing the same issue when using WSL 2 with Docker Desktop
I had this issue recently on my windows and all I did to resolve it was shutdown WSL and start WSL again.
wsl --shutdownthenwsli mean you are running an insider preview, this is bound to happen. Wait until actual release and it’ll probably be buttery smooth
I had the same issue. And I tried to run again the command
wsl --set-default-version 2on PowerShell and hourra it works again. I guess you need to run this command each time you restart your PC to choose the version of wsl you want to run.This is the way.
exiting docker, opening a new wsl window and restarting docker gets me out of this loop
Same here
I have no idea what happened, but yesterday on a whim, I ran
wslin PowerShell, which seemed to start the instance, and I’ve been able to use it ever since.After I Updated the WSL 2 Linux kernel, the problem fixed.
Notice, Need to download and install the latest package on https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel.
The same problem, sometimes I even have to restart 2-3 times a day, which seriously affects my development, i just use
wsl --shutdownNo progress on this? I’ve been experiencing this every 1-2 days, it’s really annoying as i have a lot of stuff that i need to set to get my dev environment running.
that sometimes helps. Sometimes fast to do, sometimes takes time to proceed …
Run as Admin is needed though
Noted little above : https://github.com/microsoft/WSL/issues/5110#issuecomment-672366271
I have the same issue after every clean boot. Using Ubuntu 20.04 with WSL2 on W10 Pro 20152.rs_prerelease.200617-1502.
I run Ubuntu after waiting for the startup processes to finish what they are doing. So no conflict. The terminal gives the specified error:
The next behavior depends on how much I wait after getting this error. If I wait long enough and open a PowerShell as admin, then run
wsl, it starts Ubuntu normally.In other cases, it waits for 30-45 seconds after running
wsland gives the following error:Then I do
wsl --shutdownand if I haven’t waited long enough, it would tell me that the program is being used by another process. If I tried again after 1 minute or so, it executes the command. After that, if I try runningwslagain, it gives me the same error:If I restart Windows after that, I can run Ubuntu just by clicking the Ubuntu button or opening a Linux shell anywhere.
I will try to add the actual screenshots of the errors as this issue reproduces itself circumstantially.
Hi! I had the same issue, the below steps solved it for me 👍
$ wsl -l -v$ wsl -d Ubuntu-18.04Execute
wsl --listto get what you have now, and then executewsl --set default [name], which perfectly solves the problemI’ve been struggling with this issue for the last couple of days as well. For me, it looks like the failure was related to the network shares (all cifs) that I was trying to mount via /etc/fstab
I was able to workaround it as such:
I can’t install the WSL kernel update either, as the installer is assuming I don’t have WSL.
where
Ubuntu-18.04is the distribution I use.Fun fact: all the mounts in the fstab work if I execute them after the machine is up (
sudo mount ...) → feels like a startup order problem.Yeah, debugging functionality in WSL still needs to improve. But at least I can FUSE mount now in WSL 2 which completes the last of my requirements for development on WSL.
wsl command was failing for me, but after ejecting my external HD it worked fine and WSL has been started.
For most of the issues. I just apply what we call a “Microsoft” solution.
Restart of WSL.
Run powershell as admin >>
wsl --shutdown>> Start “Ubuntu on Windows” again from the start button.Close and open VScode again and it’s solved.
Do you realize, that this is like telling someone whose wifi driver is sometimes starting to drop packets to fix the issue by rebooting his laptop? 🙄
https://github.com/microsoft/WSL2-Linux-Kernel/releases/tag/linux-msft-wsl-5.15.57.1
The first 5.15 kernel series was released Aug 2nd, and running
wsl --updatenicely updated me to that version.Regarding the changelog:
Would that be related to our long awaited fix?
Also, did anyone try the PATH workaround in the discussion? https://github.com/microsoft/WSL/discussions/7869
same issue for me. Restarted last night after applying updates and cannot launch a previously working distro.
creating a new distro works as expected.
docker running or not running makes no difference
Microsoft Windows [Version 10.0.19041.388]
Similarly here.
I think it might be due to changes to
/etc/fstabI’ve done - is there a way to edit the file without starting WSL? Or maybe it is because of the docker service.Log capture does not provide any additional information:
→ Event Viewer info is barren.
Serious problem for me is that I have files on Linux “partition”, shared them via \wsl$ to Windows folder and I use it for development. When WSL crashes, InteliJ Idea fails to write file, freezes and file is empty after restart. So my last work is lost and I have to commit more often.
Would this issue be fixed by the
0.60.0release of this week? https://github.com/microsoft/WSL/releases/tag/0.60.0Do we have any update on this? It happens to me over and over, restart computer was quite annoying, guys Can any workaround work for now?
Hi,
Using WSL2 with Ubuntu 20.04 For me it was that I had two versions of docker installed
So I uninstalled docker desktop, and to completely remove the docker version in WSL I followed the steps below. After that reinstalled only docker desktop (and in settings > resources > enabled WSL2 for my distribution
To completely uninstall Docker:
Step 1
dpkg -l | grep -i docker To identify what installed package you have:
Step 2
sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli (##choose the docker from step 1 for me it was docker.io)
sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce
The above commands will not remove images, containers, volumes, or user created configuration files on your host. If you wish to delete all images, containers, and volumes run the following commands:
sudo rm -rf /var/lib/docker /etc/docker sudo rm /etc/apparmor.d/docker sudo groupdel docker sudo rm -rf /var/run/docker.sock You have removed Docker from the system completely.
Install now only docker desktop and > settings > resources > enable WSL2 and select your Distribution
I haven’t seen that error as often as I first did, so I assume that they indeed are working on fixing it and/or improving it. But in the event I do see it again, I have a link on my Desktop at the ready that automatically restarts the service and at the same time clears the error. The shortcut points to a script file in which I have the following content:
I had this issue before when I rebooted my Windows. I think it assuems that the WSL is not running, and tries to start it again. I’ve fixed it by ternimating the running WSL, by running this commad
wsl --list --runningyou will list all running wsl, then run this commandwsl --terminate {YOUR RUNNING WSL}to terminate the wanted WSL. After that you wil get it running again.I am having the same issue suddenly after restarting my machine. Trace files attached. Microsoft Windows [Version 10.0.19041.388] Ubuntu-20.04 lxcore_trace.zip
I had the same problem after switching to WSL2. I launched the bash on Ubuntu shortcut and there was still some setup to be done. After it did that I am able to launch it from the terminal again. Yay!
how did you manage to do this, having the same issue here. WSL 2 sounded very promising with the performance dreams but I don’t know if all this stress is worth it