microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.24k stars 811 forks source link

WSL2 does not changes state from Stopped to Running #5406

Open robe007 opened 4 years ago

robe007 commented 4 years ago

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 commented 4 years ago

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

See if that takes at least.

robe007 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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

benhillis commented 4 years ago

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 commented 4 years ago

@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

organom commented 3 years ago

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:

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 commented 3 years ago

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

axccod commented 3 years ago

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 commented 2 years ago

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

GilHyeon commented 2 years ago

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 commented 2 years ago

@GilHyeon 한국분 반갑습니다.

GilHyeon commented 2 years ago

@GilHyeon 한국분 반갑습니다.

@newbiediver 반갑습니다

isrishtisingh commented 2 years ago

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 commented 2 years ago

had this issue when i tried uninstalling zsh with this command

sudo apt-get --purge remove zsh

sisrfeng commented 2 years ago

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 commented 2 years ago

Please report the issue in that move-wsl repository.

yeaktas commented 1 year ago

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 commented 1 year ago

I am getting this error , please help image

satyasonu commented 1 year ago

wsl -d ubuntu

This saved my life to start WSL Ubuntu

CJzhangjing commented 6 months ago

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 commented 3 weeks ago

This did it for me :

Get-Service vmcompute | Restart-Service

wsl -d ubuntu