Problem:

When I launched Ubuntu 20.04, it pops up: "Press any key to continue...", and then if I press any key, it exits immediately. This prevents me from using (typing any command) in Ubuntu WSL. (It occurred suddenly today. For the last couple of days it has been working properly.)

Screenshot: Press any key to continue pops up after startup

Attempts Tried:

  • LxssManager service is running. But LxssManagerUser and LxssManagerUser_60d78 are stopped. Manually starting the two services doesn't help as they automatically stop themselves right afterwards.

  • Hyper-V service is set to auto. Virtualization mode is enabled (task manager -> performance -> CPU)

  • Trying to re-run the update from here https://learn.microsoft.com/en-us/windows/wsl/wsl2-kernel, but it shows WSL not installed (which is weird since I have been using it for a long time before)

Environment:

  • OS: Microsoft Windows 10 Family, Insider Preview

  • Version: 10.0.20152 Version 20152

  • System Type: x64 based

9

Best Answer


From https://github.com/microsoft/WSL/issues/4177#issuecomment-597736482

There is a conflict between wsl.exe and Proxifier.

Developers of Proxifier gave a solution.

Thanks for the info.

We have reproduced this issue. Apparently, wsl.exe displays this errorif Winsock LSP DLL gets loaded into its process.

The easiest solution is to use WSCSetApplicationCategory WinAPI callfor wsl.exe to prevent this. Under the hood the call creates an entryfor wsl.exe atHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\AppId_CatalogThis tells Windows not to load LSP DLLs into wsl.exe process.

We have a tool that can make this call:www.proxifier.com/tmp/Test20200228/NoLsp.exe

Please just run as admin with the full path to wsl.exe as theparameter: NoLsp.exe c:\windows\system32\wsl.exe

This has fixed the problem in my case.

Please let me know how it works for you.

And it works well for me!

I'd accidentally mounted the WSL virtual disk image by double-clicking it in explorer, and it remained mounted to my machine even though it reported an error that made having it mounted useless. Unmounting the vdisk from Disk Management resolved the issue for me.

This worked magic! Go to the Windows Command Prompt and run the following command:

netsh winsock reset

Then Restart your computer. NB: Don't Shutdown since it did not work for me. Instead, Restart!

More answers can be found here.

This is what worked for me

  1. Close the Ubuntu window
  2. Start windows powershell with elevated priviledges
  3. Shutdown the wsl
  4. Unregister ubuntu on the wsl
  5. install Ubuntu and register it back on the same wsl

Here are the commands

wsl --shutdownwslconfig /unregister Ubuntuwsl install --distibution Ubuntu

I solved by downloading the https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msimsi and excuting it.

see https://learn.microsoft.com/en-us/windows/wsl/wsl2-kernel

I went into the bios and had to enable virtualization from there

if you got this error:

An operation was attempted on something that is not a socket.

there is something wrong with windows sockets and try this command in cmd administrator mode to reset windows sockets.

1. netsh winsock reset catalog2. netsh int ipv4 reset reset.log3. netsh int ipv6 reset reset.log4. Restart the computer.

Maybe not relevant for TO but I had the same issue and just had to run in Windows Terminal:

wsl --shutdown

After that Ubuntu worked again.

  1. powershell => type "wsl --shutdown" => error message

  2. ctrl-alt-del => services => HvHost => right button => restart (think to stop all hyperv virtual machines before ?)

  3. powershell => type "wsl" => OK

  4. restart hyperv virtual machines