Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL2 - "The Windows Subsystem for Linux instance has terminated." #5110

Open
Some1OnLine opened this issue Apr 20, 2020 · 107 comments
Open

WSL2 - "The Windows Subsystem for Linux instance has terminated." #5110

Some1OnLine opened this issue Apr 20, 2020 · 107 comments
Labels
failure-to-launch failure to launch

Comments

@Some1OnLine
Copy link

Some1OnLine commented Apr 20, 2020

  • Your Windows build number: (Type ver at 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_command is failing, then run strace -o some_command.strace -f some_command some_args, and link the contents of some_command.strace in a gist here).

  • For WSL launch issues, please collect detailed logs.

lxcore_service.zip

@Some1OnLine Some1OnLine changed the title WSL v2 - "The Windows Subsystem for Linux instance has terminated." WSL2 - "The Windows Subsystem for Linux instance has terminated." Apr 20, 2020
@martinfojtik
Copy link

martinfojtik commented Apr 29, 2020

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.

@ludzzz
Copy link

ludzzz commented May 5, 2020

@martinfojtik Thank you so much, Got the exact same issue, but I didn't thoughts about the mounted folder through VPN.
It's kinda obvious when you know it.

@Welquer
Copy link

Welquer commented May 12, 2020

wsl command was failing for me, but after ejecting my external HD it worked fine and WSL has been started.

@kreczko
Copy link

kreczko commented May 19, 2020

Similarly here.

The Windows Subsystem for Linux instance has terminated.
[process exited with code 4294967295]

I think it might be due to changes to /etc/fstab I'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:

logman.exe create trace lxcore_kernel -p "{0CD1C309-0878-4515-83DB-749843B3F5C9}" -mode 0x00000008 -ft 10:00 -o .\lxcore_kernel.etl -ets
logman.exe create trace lxcore_user -p "{D90B9468-67F0-5B3B-42CC-82AC81FFD960}" -ft 1:00 -rt -o .\lxcore_user.etl -ets
logman.exe create trace lxcore_service -p "{B99CDB5A-039C-5046-E672-1A0DE0A40211}" -ft 1:00 -rt -o .\lxcore_service.etl -ets

→ Event Viewer info is barren.

@wisepotato
Copy link

same here, i think its my fstab, but no way to edit it without starting wsl.. bit of a catch 22..

@kreczko
Copy link

kreczko commented May 26, 2020

same here, i think its my fstab, but no way to edit it without starting wsl.. bit of a catch 22..

Had to convert back to WSL 1, edit the fstab, then convert again to WSL 2.

@boblitex
Copy link

same here, i think its my fstab, but no way to edit it without starting wsl.. bit of a catch 22..

Had to convert back to WSL 1, edit the fstab, then convert again to WSL 2.

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

@wisepotato
Copy link

same here, i think its my fstab, but no way to edit it without starting wsl.. bit of a catch 22..

Had to convert back to WSL 1, edit the fstab, then convert again to WSL 2.

oh god.

@wisepotato
Copy link

same here, i think its my fstab, but no way to edit it without starting wsl.. bit of a catch 22..

Had to convert back to WSL 1, edit the fstab, then convert again to WSL 2.

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

i mean you are running an insider preview, this is bound to happen. Wait until actual release and it'll probably be buttery smooth

@kreczko
Copy link

kreczko commented May 28, 2020

how did you manage to do this, having the same issue here.

wsl --set-version Ubuntu-18.04 1
# edit fstab
wsl --set-version Ubuntu-18.04 2

where Ubuntu-18.04 is 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.

Had to convert back to WSL 1, edit the fstab, then convert again to WSL 2.

oh god.

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.

@liudonghua123
Copy link

After I Updated the WSL 2 Linux kernel, the problem fixed.

image

Notice, Need to download and install the latest package on https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel.

@nikhildaga
Copy link

Still facing this issue

@gerardojbaez
Copy link

This is becoming really annoying. 😢 I get this error every time I turn on the PC and open the WSL console (Ubuntu-18.04).

@chuyangliu
Copy link

Facing the same issue when using WSL 2 with Docker Desktop

@ttutko
Copy link

ttutko commented Jun 17, 2020

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?

@MJLHThomassen-Sorama
Copy link

Facing the same issue when using WSL 2 with Docker Desktop

Same here

@hsakkout
Copy link

I can't install the WSL kernel update either, as the installer is assuming I don't have WSL.

@brunswick42
Copy link

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.

This happened to me twice as well, and I'm tired of starting over. I want to WSL2, but I can't use it if it breaks and I lose everything each week. I could even live with this for a while if there was a way to recover from the failure. But as it stands it is not clear if anyone is looking into it, or if there is anything we can do to help solve the problem.

@ttutko
Copy link

ttutko commented Jun 22, 2020

To add some more information to the madness that I am experiencing as well as some of you have also been experiencing:

I exported my broken wsl2 distro then imported it again under a different name to try some things out. Of course, the copy did not work. I then tried to convert it to wsl1 which hung. After a reboot, my original wsl2 distro was still broken but I was able to convert the copy to version 1. After conversion to version 1, the copy was able to start. I removed an entry from /etc/fstab as some people seemed to indicate issues with mounting drives fixed their problem. I then tried converting to version 2. After conversion to version 2, it wouldn't start and was broken again. I decided to go convert back to version 1 and just live with that for now until hopefully we get some answers so I kicked off the conversion to version 1 (of the copy, the original distro was still left alone). While the copy was converting back to version 1, I clicked to open a new tab in windows terminal with the intention of opening powershell core. I accidentally clicked on my original broken wsl2 distro though and IT STARTED. I'm so thoroughly confused :(

@brunswick42
Copy link

I have no idea what happened, but yesterday on a whim, I ran wsl in PowerShell, which seemed to start the instance, and I've been able to use it ever since.

@gerardojbaez
Copy link

gerardojbaez commented Jun 23, 2020

Windows 10 Home Insider Preview. Build 20150.rs_prerelease.200612-1734

Today, after turning on my PC and opening Windows Terminal, the Ubuntu console got stuck on an empty screen (nothing showed up). I closed it and opened an instance of PowerShell, I executed wsl, and got "An error occurred mounting one of your file systems. Please run 'dmesg' for more details.". I ran dmesg and this is the result:

image

This is a clean boot, no program was opened before opening the Windows Terminal, so plenty of memory were available. No VPN, no Docker for Windows (installed only inside WSL2).

This is becoming really annoying. No word from Windows or the WSL team, not even a workaround or an explanation of the issue/cause.

The only solution, for now, is to restart the PC until WSL2 is able to start.

At this point, I'm considering switching to a dual-boot with Ubuntu and use that as my development machine while this issue is solved.

I post this on this thread because I feel it is a related issue.

@enthusiast
Copy link

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!

@FabienNeibaf
Copy link

I had the same issue. And I tried to run again the command wsl --set-default-version 2 on 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.

@kzlsakal
Copy link

kzlsakal commented Jul 9, 2020

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:
image

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 wsl and gives the following error:

The virtual machine or container was forcefully exited

Then I do wsl --shutdown and 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 running wsl again, it gives me the same error:

The virtual machine or container was forcefully exited

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.

@debosmit-git
Copy link

exiting docker, opening a new wsl window and restarting docker gets me out of this loop

@amaria
Copy link

amaria commented Jul 24, 2020

I've found that if I wait a few minutes and try opening the terminal again (maybe a couple more times), it works.

@softveda
Copy link

softveda commented Aug 6, 2020

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

@aMozejko1
Copy link

aMozejko1 commented Aug 7, 2020

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]

@edte
Copy link

edte commented Jul 29, 2022

sometimes wsl will stuck, and after some minutes, when i try to enter new terminal, it will show The Windows Subsystem for Linux instance has terminated.

@news-ttt
Copy link

news-ttt commented Aug 1, 2022

sometimes wsl will stuck, and after some minutes, when i try to enter new terminal, it will show The Windows Subsystem for Linux instance has terminated.

The default one you set is that. Is it convenient to tell

@news-ttt
Copy link

news-ttt commented Aug 1, 2022

sometimes wsl will stuck, and after some minutes, when i try to enter new terminal, it will show The Windows Subsystem for Linux instance has terminated.

Is it convenient to provide the list you obtained

@edte
Copy link

edte commented Aug 1, 2022

image

@news-ttt
Copy link

news-ttt commented Aug 1, 2022

Is the version too high,You can try downloading a lower version as the default

image

@edte
Copy link

edte commented Aug 1, 2022

i download it from microsoft store😰

@dcharlespyle
Copy link

dcharlespyle commented Aug 1, 2022

I usually wait for Ubuntu releases until it is at least xx.04.1 or higher. Earlier releases tend to be a bit buggy. At least that has been my experience over the years. May need to add some libraries, too. It's pretty much a bare-bones install image on the Store. I'm on 20.04.4 LTS and see none of the termination errors I saw before. I'm also using WSL Preview, also from the store, and I don't use Docker. These kinds of termination errors seem to occur more frequently when using Docker than without.

@news-ttt
Copy link

news-ttt commented Aug 1, 2022

My version is also 20.04.4

@dcharlespyle
Copy link

My version is also 20.04.4

Seeing the same crashes? Are you using Docker?

On my WSL installation, I use a script on the Linux side to start a few services. I also keep a couple scripts on the Windows side to terminate WSL, restart the service associated with WSL, and then call the script on the Linux side to start services again. I don't use it often but perhaps it might help you. Following is the Windows side script that terminates and restarts WSL.

@echo off

REM - Shutdown and terminate Linux WSL VM.

echo Shutting down running WSL Linux instance...

wsl --shutdown

echo WSL Linux session terminated...

TIMEOUT 5

REM - Restart LxssManager Service

echo Restarting LxssManager Service...

powershell -Command "Restart-Service -Name LxssManager -PassThru -Force"

TIMEOUT 10

REM - Start Linux WSL VM and services.

"C:\Users\Public\Public Virtual Machines\Scripts\StartWSL.cmd"

REM - Uncomment below line to troubleshoot.
REM - pause

exit 0

Following is the script that starts WSL (it has elements for use with both a third-party XServer and Windows' standard.

@echo off

REM - Start XServer.
REM - "C:\Program Files\VcXsrv\vcxsrv.exe" +bs -ac -multiwindow -multimonitors -wgl -swrastwgl

REM - Allow XServer time to start.
REM - timeout /t 10 /nobreak >NUL

REM - Update WSL Kernel and components.
REM - C:\Windows\System32\wsl.exe --update

REM - Allow update process to close.
REM - timeout /t 5 /nobreak >NUL

echo Starting WSL Linux...

:RETRY

REM - Run some WSL Services.

REM - C:\Windows\System32\wslg.exe -d Ubuntu -- /usr/bin/start-wsl-services

C:\Windows\System32\wslg.exe -d Ubuntu -- /usr/bin/start-wsl-services

REM - IF %ERRORLEVEL% NEQ 0 (GOTO RETRY)

REM - Allow time to see all results.
timeout /t 2 /nobreak >NUL

REM - Uncomment below line for troubleshooting.
REM - pause

exit 0

Following is the script on the Linux side.

#!/bin/bash

# Check for and run System-wide DBus service.
SERVICE="dbus-daemon"
if pgrep -x "$SERVICE" >/dev/null
then
    pgrep -a "$SERVICE"
else
    sudo /etc/init.d/dbus start
    pgrep -a "$SERVICE"
fi

# Check for and run CUPS Printing Service.
SERVICE="cupsd"
if pgrep -x "$SERVICE" >/dev/null
then
    pgrep -a "$SERVICE"
else
    sudo /etc/init.d/cups start
    pgrep -a "$SERVICE"
fi

# Check for and start Freshclam CLAMAV Update service.
SERVICE="freshclam"
if pgrep -x "$SERVICE" >/dev/null
then
    pgrep -a "$SERVICE"
else
    sudo /etc/init.d/clamav-freshclam start
    pgrep -a "$SERVICE"
fi

# Check for and start SANED Scanner service.
SERVICE="saned"
if pgrep -x "$SERVICE" >/dev/null
then
    pgrep -a "$SERVICE"
else
    sudo /etc/init.d/saned start
    pgrep -a "$SERVICE"
fi

# Check for and start Preload service.
SERVICE="preload"
if pgrep -x "$SERVICE" >/dev/null
then
    pgrep -a "$SERVICE"
else
    sudo /etc/init.d/preload start
    pgrep -a "$SERVICE"
fi

# Start LibreOffice and terminate for faster loading.
/usr/bin/libreoffice --terminate_after_init

# Check for error, make sure all functions called and run, and pass the result on to calling process.
if [[ $? -ne 0 ]] ; then
    exit 1
else
    exit 0
fi

@edte
Copy link

edte commented Aug 1, 2022

I am indeed using docker desktop

@dcharlespyle
Copy link

Make sure that Docker Desktop is fully updated as well as WSL. Also check to make sure that the default is set to WSL2. Other than that, not sure what else can help. As I said, I don't use Docker for my configuration.

@Dacesilian
Copy link

Dacesilian commented Aug 1, 2022

I've set all mentioned here (default WSL2, swap, memory) and Ubuntu crashed again. Yes, I'm using Docker, also fully updated. I don't know why Microsoft and Docker don't cooperate and work on this issue. It must be a problem for a huge amount of people :(

image

@dcharlespyle
Copy link

I haven't seen that "WARNING: Waiting for service. 'LxssManager (LxssManager)'..." error for a very long time. And, fortunately, that error has nothing to do with Docker. Whenever you see that error, use Windows Task Manager to find the PID of the service.

image

Use Resource Monitor to find the same process PID.

image

End Process Tree for the process PID. Then start the LxssManager service and run WSL again.

@rvanlaak
Copy link

rvanlaak commented Aug 4, 2022

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 --update nicely updated me to that version.

Regarding the changelog:

Fix 9p filesystem regressions since the last v5.10 WSL2 kernel

Would that be related to our long awaited fix?

Also, did anyone try the PATH workaround in the discussion? #7869

@Toastzam
Copy link

shibal wsl

@HenTorgeman
Copy link

Hi! I had the same issue, the below steps solved it for me 👍

  1. pause docker-engine
  2. close all apps accessing Linux files (e.g. vscode)
  3. Power shall ( to check the distro name): $ wsl -l -v
  4. Power shall ( to start the WSL distributuion again): $ wsl -d Ubuntu-18.04

@johny-mnemonic
Copy link

Not sure I am having the same issue, but I am getting this same error from vscode and also when I try to execute any command in new shell, i.e.:

wsl -d Ubuntu-20.04 -e uptime
The Windows Subsystem for Linux instance has terminated.

But in the terminal where I started wsl I am logged in and everything seems to work.

COMPUTER :: c/Users/USER » uptime
 16:02:24 up 12:11,  2 users,  load average: 0.02, 0.07, 0.02

Also I have xrdp running in my wsl distro and I am connected there (KDE UI) and everything seems to work normally.
When I try to list running wsl distros it is also reported as running:

C:\WINDOWS\System32\wsl.exe -l --running
Windows Subsystem for Linux Distributions:
Ubuntu-20.04 (Default)

So I am really confused what is going on 🤯

@zeeshananjumjunaidi
Copy link

I ran
wsl --shutdown
then
wsl
and it started working again.

@johny-mnemonic
Copy link

I ran wsl --shutdown then wsl and it started working again.

Well, "fixing" computer issues by restarting it is always an option, but when you have a lot of open work it is a nuisance 🤷‍♂️
I know I can kill that running OS and start it again, but it means I will loose my open work and it also takes time as I am using genie to have fully working systemd in my Ubuntu...

@wenjoy
Copy link

wenjoy commented Oct 1, 2022

I ran wsl --shutdown then wsl and it started working again.

This is the way.

@Dacesilian
Copy link

But symbolic link share is not restored, so all applications are freezed and you must reboot whole computer.

I think this problem is somehow connected with filesystem activity or files count... It freezes more often when doing git commit, copying files etc.

@johny-mnemonic
Copy link

I ran wsl --shutdown then wsl and it started working again.

This is the way.

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? 🙄

@dcharlespyle
Copy link

I ran wsl --shutdown then wsl and it started working again.

This is the way.

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? 🙄

Well, truth be told, if this is Dell hardware a reboot actually can be a correct answer. For some Dell hardware I supported over the years, one had first to turn off the device, unplug the device from power for 15 seconds, and then plug it back in and boot up the computer again. Had much experience with Dell hardware in a College computer Math Lab that had issues with dropping packets until that was done. All of the computers would do it. Had to do this about every couple of weeks or so with the 3Com hubs and switches that were in use at the time. And it was similar with the Wifi hardware. I don't what it was about the Dells at that time, but it was a regular occurrence. They all were Optiplex models, but I no longer recall the specific model numbers. Some Dell Inspirons would do the same with their Wifi hardware. It did not matter what settings were used. Even worse, some Dell models were certified for Ubuntu, but the Wifi hardware always had issues with dropping packets until rebooted (in which case it would be fine for a few days before problems would start up again), and we never could get hibernation to work properly on those systems supposedly certified for Ubuntu Linux!

Long rant about the way things were, but I also have found that when there are troubles with WSL, shutting it down and starting it up again would fix the troubles with interoperability. After some updates, the problem came back with a vengeance, and I found I had to run the command several times a day. So, I just wrote a couple of scripts so that when it occurs, I just double click a shortcut to the main script, click to allow elevation, and let it shutdown WSL, restart the service, and then restart WSL and run a few services from the Linux side (such as CUPS, saned, and systemwide DBus). This is the script I now am using (until changes to WSL require modification):

@echo off

REM - Shutdown and terminate Linux WSL VM.

echo Shutting down running WSL Linux instance...

wsl --shutdown

echo WSL Linux session terminated...

TIMEOUT 5

REM - Restart LxssManager Service.

echo Restarting LxssManager Service...

powershell -Command "Restart-Service -Name LxssManager -PassThru -Force"

TIMEOUT 10

REM - Start Linux WSL VM and services.

"C:\Users\Public\Public Virtual Machines\Scripts\StartWSL.cmd"

REM - Uncomment below line to troubleshoot.
REM - pause

exit 0

The Start WSL script is as follows (the script can be adjusted for either use of WSLg or the third party XServer I was using):

@echo off

REM - Start XServer.
REM - "C:\Program Files\VcXsrv\vcxsrv.exe" +bs -ac -multiwindow -multimonitors -wgl -swrastwgl

REM - Allow XServer time to start.
REM - timeout /t 10 /nobreak >NUL

REM - Update WSL Kernel and components.
REM - C:\Windows\System32\wsl.exe --update

REM - Allow update process to close.
REM - timeout /t 5 /nobreak >NUL

echo Starting WSL Linux...

:RETRY

REM - Run some WSL Services.

REM - C:\Windows\System32\wslg.exe -d Ubuntu -- /usr/bin/start-wsl-services

C:\Windows\System32\wslg.exe -d Ubuntu -- /usr/bin/start-wsl-services

REM - IF %ERRORLEVEL% NEQ 0 (GOTO RETRY)

REM - Allow time to see all results.
timeout /t 2 /nobreak >NUL

REM - Uncomment below line for troubleshooting.
REM - pause

exit 0

And on the Linux side of WSL, I use the following script (with several available options) named start-wsl-services in /usr/bin/:

#!/bin/bash

# Check for and run System-wide DBus service.
SERVICE="dbus-daemon"
if pgrep -x "$SERVICE" >/dev/null
then
    pgrep -a "$SERVICE"
else
    sudo /etc/init.d/dbus start
    pgrep -a "$SERVICE"
fi

# Check for and run CUPS Printing Service.
SERVICE="cupsd"
if pgrep -x "$SERVICE" >/dev/null
then
    pgrep -a "$SERVICE"
else
    sudo /etc/init.d/cups start
    pgrep -a "$SERVICE"
fi

# Check for and start Freshclam CLAMAV Update service.
SERVICE="freshclam"
if pgrep -x "$SERVICE" >/dev/null
then
    pgrep -a "$SERVICE"
else
    sudo /etc/init.d/clamav-freshclam start
    pgrep -a "$SERVICE"
fi

# Check for and start SANED Scanner service.
SERVICE="saned"
if pgrep -x "$SERVICE" >/dev/null
then
    pgrep -a "$SERVICE"
else
    sudo /etc/init.d/saned start
    pgrep -a "$SERVICE"
fi

# Check for and start Preload service.
SERVICE="preload"
if pgrep -x "$SERVICE" >/dev/null
then
    pgrep -a "$SERVICE"
else
    sudo /etc/init.d/preload start
    pgrep -a "$SERVICE"
fi

# Start LibreOffice and terminate for faster loading (uncomment to use).
# /usr/bin/libreoffice --terminate_after_init

# Check for error, make sure all functions called and run, and pass the result on to calling process.
if [[ $? -ne 0 ]] ; then
    exit 1
else
    exit 0
fi

@imPankajShaw
Copy link

Quick solution:
(1):

  • Check the state of the wsl instance (wsl --list --verbose)
  • if your wsl instance state is 'running' then terminate (wsl -t DISTRO_NAME)
  • then shutdown the instance (wsl --shutdown)
  • now the instance should work fine.

(2):

  • Check the state of the wsl instance (wsl --list --verbose)
  • if your wsl instance state is 'stopped' then shutdown the instance (wsl --shutdown)
  • restart the instance, it should work fine.

@ankurga
Copy link

ankurga commented Jun 26, 2023

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.

@hoggatt
Copy link

hoggatt commented Sep 22, 2023

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.

As I like to say: Microsoft problems require Microsoft solutions.

@sollyucko
Copy link

Quitting Docker Desktop fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failure-to-launch failure to launch
Projects
None yet
Development

No branches or pull requests