(WSL error at Startup) Press any key to continue

Viewed 10182

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://docs.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

7 Answers

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 error if Winsock LSP DLL gets loaded into its process.

The easiest solution is to use WSCSetApplicationCategory WinAPI call for wsl.exe to prevent this. Under the hood the call creates an entry for wsl.exe at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\AppId_Catalog This 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 the parameter: 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.

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 catalog
2. netsh int ipv4 reset reset.log
3. netsh int ipv6 reset reset.log
4. 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.

Related