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 does not changes state from Stopped to Running #5406

Open
robe007 opened this issue Jun 14, 2020 · 22 comments
Open

WSL2 does not changes state from Stopped to Running #5406

robe007 opened this issue Jun 14, 2020 · 22 comments
Labels
failure-to-launch failure to launch

Comments

@robe007
Copy link

robe007 commented Jun 14, 2020

Environment

Windows build number: [run [Environment]::OSVersion for powershell, or ver for cmd]:

Microsoft Windows [Versión 10.0.19041.329]

Your Distribution version: [On Debian or Ubuntu run lsb_release -r in WSL]:

Ubuntu

Whether the issue is on WSL 2 and/or WSL 1: [run cat /proc/version in WSL]:

WSL1 and WSL2

Steps to reproduce

Yesterday I updated Windows 10 from 1909 to 2004 to install WSL2. I did these steps:

  1. Typed this on PowerShell as Administrator: Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

  2. Reboot Windows

  3. Installed this as Administrator: wsl_update_x64.msi

  4. Reboot Windows

  5. Typed this on PowerShell as Administrator: wsl --set-default-version 2

  6. Typed this on PowerShell as Administrator: wsl --set-version Ubuntu 2

  7. Typed this on PowerShell as Administrator: wsl --list --verbose

After I did all the steps above, I got this:

check-wsl2-windows-10-powershell 1

Expected behavior

WSL starts normally, but it does not.

Actual behavior

I typed wsl on PowerShell, and nothing happens.

I clicked on the WSL-Ubuntu icon on Dekstop, and a command line windows appear, and closes immediately.

Never I can see State: Running when I typed: wsl --list --verbose. Always is Stopped.

@therealkenc
Copy link
Collaborator

WAG, doing your steps 5-7 as administrator could be problematic. Try this:

  • As user 'you' from either PS or CMD, do wsl --set-default-version 2.
  • Then install Ubuntu-18.04 from the store.
  • Go through the set username/password steps on first launch of Ubuntu-18.04 from the start menu
  • Open PS as user 'you'. Do a wsl -l -v. You should see your current nonworking 'Ubuntu', but also 'Ubuntu-18.04'.
  • From the same commandline, launch it with wsl -d Ubuntu-18.04

See if that takes at least.

@robe007
Copy link
Author

robe007 commented Jun 16, 2020

@therealkenc Thanks for the answer. I have tried all your steps, and I have this:

Sin título

The Ubuntu-18.04 is working, but the Ubuntu it's still not working.

What I can do now?

@therealkenc
Copy link
Collaborator

What I can do now?

Short answer: push forward with Ubuntu-18.04. You can post detailed logs of the wsl.exe -d Ubuntu silent exit. That may shed some light on the fail, but not the answer to your question. Maybe subscribe #5416 to the extent there are takers over there, although that one has the same short answer, as of this writing anyway.

@panda361
Copy link

lxcore_log.zip
This is my lxcore_log. I wonder what cause the failure:(

@benhillis
Copy link
Member

Any interesting prints in dmesg while you try to run the Ubuntu distro? You can check this by running the below commands:

start wsl -d ubuntu-18.04 dmesg -w
wsl -d ubuntu

@robe007
Copy link
Author

robe007 commented Jun 27, 2020

@benhillis Yes it says:

[ 121.781263] EXT4-fs (sdc): VFS: Can't find ext4 filesystem
[ 121.781333] ERROR: MountExt4:1659: mount(/dev/sdc) failed 22

@microsoft microsoft deleted a comment from loneregister Aug 17, 2020
@organom
Copy link

organom commented Nov 19, 2020

Interestingly enough, i had the same problem after playing a bit with enabling and disabling hyper-v and virtual machines support (while trying to configure virtualbox to work with wsl2).

No success on the virtualbox side (probably will look into vmware workstation or play with direct hyper-v machines), but for the wsl2 none of the solutions above worked (also because i didn't want to loose my fully configured ubuntu instance).

What worked for me was:

  • in Turn windows features o/off, disable Hyper-V, Virtual Machines Platform, Windows Hypervisor Platform and Windows subsystem for Linux.
  • Reboot
  • Install again wsl2 (in administrative powershell)
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Probably just running wsl in and administrative powershell would have made it work to start with, but the above steps is what I made to make mine work again. Hope it helps someone in the same situation

@dundadevelop
Copy link

dundadevelop commented Dec 6, 2020

Hi.
You can use MSI installation and next command (silent installation into custom folder):

MsiExec.exe /i DockerDesktop.msi INSTALLDIR=E:\Docker /qn

You must download MSI installation of Docker desktop:

https://hub.docker.com/editions/community/docker-desktop-ent

@therealkenc therealkenc added the failure-to-launch failure to launch label May 6, 2021
@axccod
Copy link

axccod commented Jul 11, 2021

Windows ver: Microsoft Windows [Versión 10.0.19042.1083]
In my case wasn't necessary to: reinstall, restart WSL or specify the wsl version 2 to installed distro, what i did to reset the functionality of the Arch.exe distro using file .exe by yuk7 user https://github.com/yuk7/ArchWSL/releases/latest on VM. The problem started when stopping the distro newly installed , next steps it has worked for me...

I deleted old folder with the virtual image in this case: C:\Arch also needed to remove entry, unregister the distribution: wsl --shutdown and wsl --unregister Arch now unzip back to windows root directory, change to unziped dir, right click on Arch.exe like admin and reinstall distro.

@creditsoftware
Copy link

Hello. Try with this. It works for me.
wsl --unregister Ubuntu

@GilHyeon
Copy link

I tried all the methods suggested above, but wsl, which I used well, does not start.
image

This issue occurred after running Windows Update (KB5007215). It was working fine before this update. How can we solve this problem? Or is there a way to revert back to before the update?

@newbiediver
Copy link

@GilHyeon 한국분 반갑습니다.

@GilHyeon
Copy link

@GilHyeon 한국분 반갑습니다.

@newbiediver 반갑습니다

@isrishtisingh
Copy link

Probably just running wsl in and administrative powershell would have made it work to start with, but the above steps is what I made to make mine work again. Hope it helps someone in the same situation

Your last step was enough to make mine work after so much debugging, thank you so much!

@Jkudjo
Copy link

Jkudjo commented May 19, 2022

had this issue when i tried uninstalling zsh with this command

sudo apt-get --purge remove zsh

@sisrfeng
Copy link

sisrfeng commented Jul 17, 2022

Hello. Try with this. It works for me. wsl --unregister Ubuntu

I used https://github.com/pxlrbt/move-wsl and move ubuntu to E:\wsl, then there was E:\wsl\ext4.vhdx.
I issued wsl --list --verbose and could find ubuntu but its state was "stop".
When I issued wsl, a window flashed out and I can not get into ubuntu.

Then I try wsl --unregister Ubuntu

Now wsl --list shows nothing, but E:\wsl\ext4.vhdx is still there.
How can I use the E:\wsl\ext4.vhdx? I have important files in that ubuntu distro

@Biswa96
Copy link

Biswa96 commented Jul 17, 2022

Please report the issue in that move-wsl repository.

@yeaktas
Copy link

yeaktas commented Sep 18, 2022

Interestingly enough, i had the same problem after playing a bit with enabling and disabling hyper-v and virtual machines support (while trying to configure virtualbox to work with wsl2).

No success on the virtualbox side (probably will look into vmware workstation or play with direct hyper-v machines), but for the wsl2 none of the solutions above worked (also because i didn't want to loose my fully configured ubuntu instance).

What worked for me was:

  • in Turn windows features o/off, disable Hyper-V, Virtual Machines Platform, Windows Hypervisor Platform and Windows subsystem for Linux.
  • Reboot
  • Install again wsl2 (in administrative powershell)
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Probably just running wsl in and administrative powershell would have made it work to start with, but the above steps is what I made to make mine work again. Hope it helps someone in the same situation

I tried all of these. then i reinstalled ubuntu and the problem was solved. ty

@rohan2734
Copy link

I am getting this error , please help
image

@satyasonu
Copy link

wsl -d ubuntu

This saved my life to start WSL Ubuntu

@CJzhangjing
Copy link

1.in Turn windows features o/off, disable Hyper-V, Virtual Machines Platform, Windows Hypervisor Platform and Windows subsystem for Linux.
2.Reboot
3.Install again wsl2 (in administrative powershell)
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
4.install update package https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
5.Reboot

then it worked.

@magp18
Copy link

magp18 commented Aug 22, 2024

This did it for me :

Get-Service vmcompute | Restart-Service

wsl -d ubuntu

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