microsoft / WSL

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

missing dll when trying to install debian #3456

Closed numEricL closed 6 years ago

numEricL commented 6 years ago

Windows Version 10.0.16299.551

I'm unable to install debian gnu\linux from the microsoft store. Installation fails immediately and debian.exe throws a system error: code execution cannot proceed because api-ms-win-core-console-l2-2-0.dll was not found.

derousse commented 6 years ago

I have a similar issue but I had debian working fine previously. I'm not certain it's related, but I did some driver updates through the Lenovo Vantage utility earlier today and now I get this exact same error when trying to start a bash window. image

I tried uninstalling Debian, turning off Windows Subsystem for Linux and then turning it back on and reinstalling Debian. I'm still getting the same error.

derousse commented 6 years ago

I just installed Ubuntu and it works fine. Still no luck with Debian though...

0xbadfca11 commented 6 years ago

debian.exe was updated few days ago. ubuntu.exe is not. Lenovo software does not matter. https://www.virustotal.com/#/file/b11a6b5812df69e70dc04e7812a64a54d946e3680f4e051cd99566c93efd3eca/details https://www.virustotal.com/#/file/a4309682690a8dc9b02b4df07654b7991c3d84e60a7ba6b01ae6d61f97dddcd6/details The difference between them is the version of MSVC used.

Biswa96 commented 6 years ago

Yes, there are some new commits in GitLab Debian-WSL project. @rhaist may help. How about compiling the debian.exe with multi-threaded option (/MT) to remove VC runtime dependency? Though it will increase the file size.

rhaist commented 6 years ago

I did update the Debian store app to use some of the new upstream features and bug fixes.

Can you post your current WIn10 build version? (https://support.microsoft.com/en-gb/help/13443/windows-which-operating-system)

As I also had to bump the WindowsTargetPlatformMinVersion you might have to update your base system: https://salsa.debian.org/rhaist-guest/WSL/blob/v2/DistroLauncher-Appx/DistroLauncher-Appx.vcxproj#L10

stabidlo commented 6 years ago

i'm running 16299, same problem - checked again few minutes ago

raghavk92 commented 6 years ago

i tried to open debian today and i got the same error(api-ms-win-core-console-l2-2-0.dll not found. Its asking me to reinstall but as i see above reinstall wont help and if i reinstall i will loose all the packages i have installed . So should i wait for the solution or should i do something. I didnt update anything .

Currently running windows 10 1709

Jotune commented 6 years ago

I've done a windows update yesterday and my Debian isn't working anymore. I have same issue than the one mentioned above.

It's a shame because the popup tells us to reinstall (lose all previous config) and it actually doesn't fix the issue....

Also running on W10 1709.

rhaist commented 6 years ago

I am sorry you all have problems with the latest release. I have no clue why this happens for some people atm., as I don't know much of the inner workings of this pretty new WIN10 feature.

I will try to reproduce the problem, but this might take some time.

benhillis commented 6 years ago

I'll look into this as well. Likely a compiler setting when the app was built.

Biswa96 commented 6 years ago

@rhaist The function SetConsoleTitleW(), in DistroLauncher.cpp file, imported from api-ms-win-core-console-l2-2-0.dll, the real files are KernelBase.dll and ucrtbase.dll.

You may add the multithreaded option /MT in DistroLauncher.vcxproj file as follows

<ClCompile>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>

Or compile the Debian.exe file with gcc in mingw-w64 toolset. Or this may work to set console tittle:

std::cout << "\033]0;" << title << "\007";
benhillis commented 6 years ago

@rhaist - If you bumped the WindowsTargetPlatformMinVersion in the visual studio solution, you will also need to change your TargetPlatformMinVersion in your appx manifest. Why Visual Studio lets you do this is a very good question, but I think that's the issue you are running into.

ijustlovemath commented 6 years ago

Glad I'm not the only one seeing this error. I'm up to date, running Win10 Pro, on a Lenovo T530

LordWolfenstein commented 6 years ago

It says I am missing "api-ms-win-core-console-l2-0-0.dll" when trying to start Debian. Uninstall and reinstall did not fix the problem.

Aheleos commented 6 years ago

I too am unfortunately having this problem. I have installed Ubuntu for now, but it has extra complications for what I'm doing that has some of my work impacted. My personal server is Debian as well so I am really looking forward to the fix.

I am also happy to help in any way (testing, info, etc).

Running Windows 10 Education Edition Version 1709 OS Build 16299.547

Biswa96 commented 6 years ago

Just use wsl.exe or bash.exe. Debian.exe (and others) eventually executes wsl.exe with standard I/O handles via WslLaunch() and WslLaunchInteractive() functions.

If someone has multiple distributions installed in WSL then use wslconfig.exe /s Debian to make Debian a default distribution. Alternatively, latest insider builds have wsl.exe --distribution option, copy only that wsl.exe binary and execute it.

Aheleos commented 6 years ago

Thank you for the tip. That definitely brings up a window. Unfortunately it's to my Ubuntu installation. I would rather not uninstall that and lose what I have if I don't have to.

benhillis commented 6 years ago

@Aheleos - You can use wslconfig.exe to change your default distribution.

Aheleos commented 6 years ago

I was really excited at the idea of that and looked up wslconfig to read through the options, but since I tried to uninstall and reinstall Debian before, it's now installed, but unregistered and not on the list.

Thank you guys for the quick response and help with this.

ijustlovemath commented 6 years ago

To be clear, this is NOT a fix for the issue, merely a workaround for those who haven't already uninstalled Debian/installed Ubuntu, which according to the suggestion made by the program, is probably very few people

rhaist commented 6 years ago

Thank you all for bearing with me. I am just uploading an update to the Debian app recompiled for target version Build 16299 (Fall Creators Update, Version 1709).

I hope this will solve your problems.

Aheleos commented 6 years ago

Thank you. I really appreciate the effort.

rhaist commented 6 years ago

Store submission went through really fast this time. You should receive the updated app now if you search for updates in the Windows Store App.

Please tell me if it works.

waltersom commented 6 years ago

I was having this problem, a few minutes ago my Debian app updated, and now it works. Thanks for the quick fix!

On Wed, 15 Aug 2018 at 09:54, Robert Haist notifications@github.com wrote:

Store submission went through really fast this time. You should receive the updated app now if you search for updates in the Windows Store App.

Please tell me if it works.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Microsoft/WSL/issues/3456#issuecomment-413028736, or mute the thread https://github.com/notifications/unsubscribe-auth/AD9tM5wYvp85m36wMFPmriJlFckxkNZwks5uQ0cTgaJpZM4V4go8 .

numEricL commented 6 years ago

Confirmed working on build 16299. Thanks much!

ijustlovemath commented 6 years ago

Also works for me! Thanks @rhaist

Aheleos commented 6 years ago

Awesome. Thank you @rhaist, @Biswa96, @benhillis and everyone else that contributed to the discussion.

TWXjm commented 6 years ago

Working for me too, thank you all. The output of uname -a is quite different from the screenshot on the store though. It seems my kernel is much older. Any ideas on how to upgrade it? "apt-get dist-upgrade" shows no upgrades available. Do I need to add another repository?

$ uname -a Linux box1 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 GNU/Linux

Windows 10 Enterprise, version 1709, OS Build 16299.492

benhillis commented 6 years ago

@TWXjm - There is no Linux kernel in WSL, thus no way to upgrade it. The driver that handles the syscall translation is tied to your Windows build number.

TWXjm commented 6 years ago

Hi @benhillis, It seems I need to read up on how WSL works. thank you.

WSLUser commented 6 years ago

@rhaist Is there a way for you to add some logic (or did you already) so that the newer Store infrastructure functionalities you adopted can be used if you're using a newer version of Windows that supports it?

Biswa96 commented 6 years ago

@DarthSpock He followed BenHillis's suggestion. There are some specific rules that should be maintained in project files so that Visual Studio can build the correct AppxManifest file *. See this commit, only the Windows Version was changed in project files.

* It can also be written just by typing

WSLUser commented 6 years ago

Yes I see. Thanks for the info.