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

wsltty exits immediately after Windows 11 update KB5032190 #343

Closed
analytic-garden opened this issue Nov 15, 2023 · 56 comments
Closed

wsltty exits immediately after Windows 11 update KB5032190 #343

analytic-garden opened this issue Nov 15, 2023 · 56 comments

Comments

@analytic-garden
Copy link

wsltty 3.7.0 starts and immediately exits with no error message. wsltty worked prior to latest Windows update.

Launching C:\Users\bbth\AppData\Local\wsltty\bin\mintty.exe produces the following message:
/bin/bash: Exit 126.
Failed to run '/bin/bash': No such file or directory

/bin/bash exists.

Launching wsl from Windows terminal works. Launching other terminal programs such as Gnome-terminal or xfce4-terminal work under WSL.

Windows info
Windows 11 Pro Version 10.0.22631 Build 22631
2023-11 Cumulative Update for Windows 11 Version 23H2 for x64-based Systems (KB5032190)

PS C:\Users\bbth> wsl --version
WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.2715

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy

@mintty
Copy link
Owner

mintty commented Nov 15, 2023

Possibly duplicate of #342. What does wsl -l -v say? Please try to change one WSL distribution to WSL 1 and test it.

@gvl2023
Copy link

gvl2023 commented Nov 15, 2023

Same issue.

C:\Users\zzz>wsl --version
WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.2283

C:\Users\zzz>wsl -l -v
NAME STATE VERSION

  • Ubuntu-22.04 Running 2

@analytic-garden
Copy link
Author

PS C:\Users\bbth> wsl -l -v
NAME STATE VERSION

  • Ubuntu Running 2

@analytic-garden
Copy link
Author

In addition, running
C:\Users\bbth\AppData\Local\wsltty\bin\mintty.exe --WSL=Ubuntu --configdir="C:\Users\bbth\AppData\Roaming\wsltty" -~ -h always -

opens a window with the following text:

/bin/wslbridge2: Exit 1.
r process.

@haard
Copy link

haard commented Nov 15, 2023

Same,

C:\Users\xxx>wsl --version
WSL-version: 2.0.9.0
Kernelversion: 5.15.133.1-1
WSLg-version: 1.0.59
MSRDC-version: 1.2.4677
Direct3D-version: 1.611.1-81528511
DXCore-version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows-version: 10.0.22621.2715

C:\Users\xxx>wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu-20.04           Running         2
  docker-desktop-data    Running         2
  docker-desktop         Running         2

Emacs28 runs happily, and runs /bin/bash in ansi-term.

@mintty
Copy link
Owner

mintty commented Nov 15, 2023

C:\Users\xxx>wsl -l -v
NAME STATE VERSION

  • Ubuntu-20.04 Running 2

What I meant above is: please try wsl --set-version Ubuntu-20.04 1

@tanminivan
Copy link

Forcing WSLv1 allows wsltty to run again without issue for me.

More details, hopefully this helps for troubleshooting:

I have a similar issue, although I do not appear to have KB5032190 installed. In fact, I am on Windows 10, version 22H2. wsltty had been working just fine until this morning. The only Windows update patch that I see was recently installed is KB4023057, aside from Microsoft Defender updates. I am using wsltty 3.7.0.

Executing wslbridge2.exe shows this message which looks similar to analytic-garden's previous comment, just not trimmed:

C:\Users\xxx\AppData\Local\wsltty\bin>wslbridge2.exe
ERROR: GetVmId:294: CreateLxProcess: The process cannot access the file because it is being used by another process.

This is with WSLv2:

C:\Users\xxx>wsl --list --verbose
  NAME            STATE           VERSION
* Ubuntu-20.04    Running         2

WSL version:

C:\Users\xxx\AppData\Local\wsltty\bin>wsl --version
WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.3570

@gvl2023
Copy link

gvl2023 commented Nov 16, 2023

One other oddity, which may or may not be related, my hand-crafted /etc/resolv.conf was obliterated at the same time wsltty issues started. I had previously configured WSL to not generate this file on startup, which it did not, so I ended up with no /etc/resolv.conf at all.

@mintty
Copy link
Owner

mintty commented Nov 16, 2023

I've added a hint to use WSL V1 to the project page.

@xuefer
Copy link

xuefer commented Nov 16, 2023

/bin/wslbridge2: Exit 1.
it is being used by another process.

@pnetherwood
Copy link

Recntly I've been getting the following error launching wslbridge.exe:

ERROR: ComInit:83: CoCreateInstance: The supplied kernel information version is invalid.

WSL Version:

WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.2506

I think it might be down to KB5031455 Windows update as WSLtty still works ok on another machine without this update.

Windows version:

OS Name:                   Microsoft Windows 11 Business
OS Version:                10.0.22621 N/A Build 22621

@mikelue
Copy link

mikelue commented Nov 16, 2023

I have same issue(have tried WSLTTY 3.6.5 or 3.7.0).

I try to start wslbridge2.exe and got following error message:

For state of WSL instance is Stopped

note: wsl.exe output: Failed to attach disk 'C:\WSL\Ubuntu\ext4.vhdx' to WSL2: The process cannot access the file because it is being used by another process.
Error code: Wsl/Service/CreateInstance/MountVhd/HCS/ERROR_SHARING_VIOLATION

For state of WSL instance is Running

ERROR: GetVmId:294: CreateLxProcess: The process cannot access the file because it is being used by another process.

If the state is Stopped, but you got ...CreateLxProcess... error, try to close process by task manager.


My WSL Version:

WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.2715

WSL: 1.2.5.0 is working.
WSL: 1.3.17.0 is working.

You can download WSL releases release for older version.

@ktabata
Copy link

ktabata commented Nov 18, 2023

Hello! Downgrading WSL to 1.3.17.0 worked for me.
Reinstallation of Windows11 was needed, though.
Thank you very much for your useful information @mikelue !

The implementation of COM API CreateLxProcess() seems aparently changed.
We need to modify this code https://github.com/Biswa96/wslbridge2/blob/master/src/GetVmId.cpp#L227

@Satanepigone
Copy link

same issue here with WSL v2

@ghost
Copy link

ghost commented Nov 19, 2023

I have the same issue with WSL v2

ERROR: ComInit:83: CoCreateInstance: 提供されたカーネル情報のバージョンが無効です。

which should be the same (japanese) message as "The supplied kernel information version is invalid" in #343 (comment)

WSL バージョン: 2.0.9.0
カーネル バージョン: 5.15.133.1-1
WSLg バージョン: 1.0.59
MSRDC バージョン: 1.2.4677
Direct3D バージョン: 1.611.1-81528511
DXCore バージョン: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows バージョン: 10.0.22631.2715

which also should be the same versions as in #343 (comment)

@analytic-garden
Copy link
Author

I have a Cygwin terminal installed. It is mintty 3.1.0. It works with WSL2.

@MaxwellWibert
Copy link

Same issue here with Ubuntu 20.04.6 LTS on WSL v2. Downgrading to WSL v1 is kind of a non-starter for me. I have little choice but to go with another terminal until such time as this one is fixed (which is unfortunate as this is my favorite WSL terminal by a country mile!)

@ktabata
Copy link

ktabata commented Nov 20, 2023

@MaxwellWibert
You don't have to downgrade to WSL1. We mean that WSL2 v1.3 works well.
The following are the steps:

  • Uninstall the Windows Subsystem for Linux package from your Windows (in the store and the system features)
  • Download the v1.3.17 from https://github.com/microsoft/WSL/releases/tag/1.3.17
  • Run a Power Shell terminal as an admin
  • Navigate to your Downloads directory and type:
Add-AppxPackage .\Microsoft.WSL_1.3.17.0_x64_ARM64.msixbundle

Hope this helps. We don't need to give up such a wonderful terminal!

@bluddy
Copy link

bluddy commented Nov 20, 2023

As a user who prefers wsltty to other terminals, there's no way I'm messing with WSL to keep wsltty. I'll have to learn to deal with another terminal until you guys can fix the problem.

@ktabata
Copy link

ktabata commented Nov 20, 2023

I'm not a developer of wsltty, just a heavy user of it. I just needed a workaround because I can't work without Emacs on wsltty.
To fix wslbridge2, a developer would have to receive information from Microsoft about the undocumented API CreateLXProcess(). There is another way to do it, which is to analyze the COM binary, but I shouldn't write about it here.
To me, the current version of wsltty is more valuable than the latest WSL2 v2.0.

@mintty
Copy link
Owner

mintty commented Nov 20, 2023

Thanks for pointing out the 1.3.17 release as a workaround, I've updated the project page to reflect this.

For an adaptation (which I wouldn't call a fix as it's not really broken, rather Windows API documentation is broken), I don't know what @Biswa96 likes to do; my approach would be to go without any specific Windows functions instead.

@bluddy
Copy link

bluddy commented Nov 20, 2023

I'm not a developer of wsltty, just a heavy user of it. I just needed a workaround because I can't work without Emacs on wsltty. To fix wslbridge2, a developer would have to receive information from Microsoft about the undocumented API CreateLXProcess(). There is another way to do it, which is to analyze the COM binary, but I shouldn't write about it here. To me, the current version of wsltty is more valuable than the latest WSL2 v2.0.

That's fine for now, but this is not a long-term solution, since WSL is deeply tied into Windows and MS does global updates. We can't get stuck on any particular version of WSL.

@kafkafuura
Copy link

My current workaround to use WSL2 with mintty is to run 'mintty -e wsl &' from an existing cygwin installation — this works without wslbridge, though I am not sure if there is a performance hit using this method.

@mintty
Copy link
Owner

mintty commented Nov 20, 2023

Running mintty wsl imposes functional limitations on the terminal, see #342 (comment)

@hori87
Copy link

hori87 commented Nov 21, 2023

Thx to @kafkafuura. I decided to use 'mintty -e wsl' as a workaround after trying Tabby and Windows Terminal. Then I realized the output of 'duf' command is colored on mintty which was not in color on wsltty. Using mintty 3.7.0 for both cases.

@mintty
Copy link
Owner

mintty commented Nov 21, 2023

What is duf?

@Biswa96
Copy link
Contributor

Biswa96 commented Nov 21, 2023

What is duf?

https://github.com/muesli/duf

@l1n3n01z
Copy link

I built wslbridge2 with cygwin and placed it in the wsltty bin folder and now wsltty starts.

I did the same and it works for me too.

For cygwin you will need to install gcc-g++ and make. The correct headers for winapi will be installed during setup of gcc

@xuefer
Copy link

xuefer commented Nov 22, 2023

i wish the github workflow use cygwin for building

@Biswa96
Copy link
Contributor

Biswa96 commented Nov 22, 2023

i wish the github workflow use cygwin for building

Yes, I agree and shall add that also.

@Biswa96
Copy link
Contributor

Biswa96 commented Nov 22, 2023

i wish the github workflow use cygwin for building

@xuefer Here is the first nightly build of wslbridge2 compiled in cygwin https://github.com/Biswa96/wslbridge2/actions/runs/6954957979

@ktabata
Copy link

ktabata commented Nov 22, 2023

@Biswa96
I've confirmed that the nightly works perfectly with WSL2 2.0.9.0 on Windows 11.
Thank you very much for your hard work. Your patch really made my day!

@xuefer
Copy link

xuefer commented Nov 22, 2023

i wish the github workflow use cygwin for building

@xuefer Here is the first nightly build of wslbridge2 compiled in cygwin https://github.com/Biswa96/wslbridge2/actions/runs/6954957979

Cool, good job. Nicely done. Everything's fine as far as i see

@ElvenSpellmaker
Copy link

ElvenSpellmaker commented Nov 22, 2023

FWIW it used to work pre the 23H2 with WSL 2.x, it's just since that update. I believe people have found the issues now, but as extra info typing wsl into a mintty terminal does work, so whatever wsltty is up to seems strange if it works in mintty.

EDIT: Is there any way to get mintty to start up as exec wsl? Then I wouldn't even need wsltty? Or is there something special about wsltty vs mintty?

@mintty
Copy link
Owner

mintty commented Nov 22, 2023

See reference above to explain that wslbridge (as involved in wsltty) is a much better gateway to WSL than wsl.exe which limits terminal functionality.
Was WSL 2.x introduced with 23H2?
Anyway, as there is a workaround now, I'll release an update as soon as there's a new release of wslbridge2 (modulo a few days that I may be on travel...).

@ElvenSpellmaker
Copy link

ElvenSpellmaker commented Nov 22, 2023

See reference above to explain that wslbridge (as involved in wsltty) is a much better gateway to WSL than wsl.exe which limits terminal functionality. Was WSL 2.x introduced with 23H2? Anyway, as there is a workaround now, I'll release an update as soon as there's a new release of wslbridge2 (modulo a few days that I may be on travel...).

Was WSL 2.x introduced with 23H2?

Nope I've been running 2.x for ages on both Windows 10 and 11.
WSL 1.x is not recommended by MS unless you have a specific use-case: https://learn.microsoft.com/en-us/windows/wsl/compare-versions#exceptions-for-using-wsl-1-rather-than-wsl-2

than wsl.exe which limits terminal functionality.

What terminal functionality does it limit out of interest? So far everything I've done with exec wsl runs perfectly fine in mintty, such as colours and title bar escape sequences.

@xuefer
Copy link

xuefer commented Nov 22, 2023

See reference above to explain that wslbridge (as involved in wsltty) is a much better gateway to WSL than wsl.exe which limits terminal functionality. Was WSL 2.x introduced with 23H2? Anyway, as there is a workaround now, I'll release an update as soon as there's a new release of wslbridge2 (modulo a few days that I may be on travel...).

Was WSL 2.x introduced with 23H2?

Nope I've been running 2.x for ages on both Windows 10 and 11. WSL 1.x is not recommended by MS unless you have a specific use-case: https://learn.microsoft.com/en-us/windows/wsl/compare-versions#exceptions-for-using-wsl-1-rather-than-wsl-2

i suppose @ktabata is right about "You don't have to downgrade to WSL1. We mean that WSL2 v1.3 works well.". which mean v1.3 is WSL2, the version number is confusing

So are you sure you're using WSL2 v2.x for ages?

when @mintty said "Was WSL 2.x introduced with 23H2" he meant WSL2 v2.x (instead of WSL2 v1.x)

than wsl.exe which limits terminal functionality.

What terminal functionality does it limit out of interest? So far everything I've done with exec wsl runs perfectly fine in mintty, such as colours and title bar escape sequences.

@ElvenSpellmaker
Copy link

ElvenSpellmaker commented Nov 22, 2023

@xuefer I'm not sure what you mean quite, but this is my output for wsl -l -v:

$ wsl -l -v
  NAME                    STATE           VERSION
* fedoraremix             Running         2
  rancher-desktop         Running         2
  rancher-desktop-data    Stopped         2

Are you saying there's a 2.x of WSL 2? Because I haven't changed anything and wsltty was working with VERSION as 2 before the 23H2 update, but now doesn't open with no message (the window closes immediately and no message is shown). I haven't run any wsl --update command for example for ages.

For completeness:

$ wsl --version
WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.2506

It's all very confusing!

I'm on Windows 11 and yet that says Windows 10.x? Seems like nothing here makes much sense. But if a fix is found and will be releaseed soon I'll continue to use exec wsl as it works for me.

But for me exec mintty works fine for the stuff I do day-to-day and has been my workaround since I noticed this as a bug (I just assumed I'd broken something somehwere and would look into it later, which turned out to be tonight).

@xuefer
Copy link

xuefer commented Nov 22, 2023

Are you saying there's a 2.x of WSL 2? Because I haven't changed anything and wsltty was working with VERSION as 2 before the 23H2 update, but now doesn't open with no message (the window closes immediately and no message is shown). I haven't run any wsl --update command for example for ages.

you're on 2.x of WSL 2 already. but what they said about "2.x" is not about "WSL2 vs WSL1", since you (and me) are confused when you mention https://learn.microsoft.com/en-us/windows/wsl/compare-versions#exceptions-for-using-wsl-1-rather-than-wsl-2
well, forget about it, since it's a little bit of off topic

about "default to exec wsl.exe" thing: you may try to copy wsl.exe as bash.exe (or sh.exe) and put it beside mintty.exe, or to ....\bin, the exact name and path depends on which variant version of mintty you're using, be it cygwin or msys2 assume itself (mintty) in different folder, finding /bin/bash (or /bin/sh)

@ElvenSpellmaker
Copy link

@xuefer Yeah it seems there's some confusion around all of this for sure 🙃

@Biswa96
Copy link
Contributor

Biswa96 commented Nov 22, 2023

Here is the new release of wslbridge2 https://github.com/Biswa96/wslbridge2/releases/tag/v0.12. The wslbridge2-cygwin can be drag-and-drop in existing wsltty installation.

@mintty
Copy link
Owner

mintty commented Nov 22, 2023

Released 3.7.0.2.

@mintty mintty closed this as completed Nov 22, 2023
@CoeJoder
Copy link

I fully uninstalled the old version, installed new version, but same issue. It crashes at startup

@Biswa96
Copy link
Contributor

Biswa96 commented Nov 23, 2023

What WSL version are you using? Does wsl.exe work?

@CoeJoder
Copy link

CoeJoder commented Nov 23, 2023

What WSL version are you using? Does wsl.exe work?

Yes I am able to run wsl.exe from the built-in terminal.
C:\Users\CoeJoder>wsl --version
WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.2715

@mintty
Copy link
Owner

mintty commented Nov 23, 2023

And did you install wsltty 3.7.0.2 (released last night)?

@KiKoS0
Copy link

KiKoS0 commented Nov 23, 2023

I did install 3.7.0.2 as well and it's still occurring for me too.
image

❯ wsl --version
Version WSL : 2.0.9.0
Version du noyau : 5.15.133.1-1
Version WSLg : 1.0.59
Version MSRDC : 1.2.4677
Version direct3D : 1.611.1-81528511
Version de DXCore : 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Version de Windows : 10.0.19045.3693

@Biswa96
Copy link
Contributor

Biswa96 commented Nov 23, 2023

It looks like a valid issue but I can not reproduce it in my system using latest Windows 11 and WSL 2.0.11.0. Have you tried the x86_64 wsltty installer? Do you have any setting in wsl.conf or .wslconfig file? Are you using docker for windows?

@CoeJoder
Copy link

CoeJoder commented Nov 23, 2023

And did you install wsltty 3.7.0.2 (released last night)?

Yes, I installed using wsltty-3.7.0.2-i686-install.exe after fully uninstalling the previous version, having removed both the ...\AppData\Roaming\wsltty and ...\AppData\Local\wsltty folders first. I'm running bare metal Windows 11.

@mintty
Copy link
Owner

mintty commented Nov 23, 2023

Please use wsltty-3.7.0.2-x86_64-install.exe instead, assuming you have a 64-bit system.
Maybe I should drop the 32-bit installers, it was just requested for some obscure Intel Windows on ARM processor configuration, don't know if that's really still a use case.

@CoeJoder
Copy link

Please use wsltty-3.7.0.2-x86_64-install.exe instead, assuming you have a 64-bit system.

That worked! Thanks

@tsangwpx
Copy link

tsangwpx commented Nov 23, 2023

I did install 3.7.0.2 as well and it's still occurring for me too. image

Sometimes WSL2 state seems broken and even wsl command report error. wsl --shtudown does not help. Restart "WSL Service" in services.msc or reboot the machine.

@KiKoS0
Copy link

KiKoS0 commented Nov 23, 2023

I restarted, installed the 64-bit version and it worked. Thank you!

@Sieboldianus
Copy link

Sieboldianus commented Feb 14, 2024

I can confirm, wsltty-3.7.0.2 solved the issue for me. I first tried to overwrite installed files from Chocolatey in C:\ProgramData\chocolatey\lib\wsltty\... (because choco is still on 3.6.4), but this did not work. I had to uninstall and install manually:

  • uninstall wsltty with chocolatey
  • install https://github.com/mintty/wsltty/releases/tag/3.7.0.2
    • wsltty-3.7.0.2-x86_64-install.exe
  • go to %LOCALAPPDATA%\wsltty
    • run add default to context menu
    • run add to context menu
    • run configure WSL shortcuts
  • right click, open WSL2 shortcut
    --> WSL2 Works again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests