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

Wont run on latest windows insider build (for WSL 2) #1930

Open
identityope opened this issue Jun 15, 2019 · 58 comments
Open

Wont run on latest windows insider build (for WSL 2) #1930

identityope opened this issue Jun 15, 2019 · 58 comments

Comments

@identityope
Copy link

I've upgraded to WSL 2 and ConEmu can't be started

image

https://devblogs.microsoft.com/commandline/wsl-2-is-now-available-in-windows-insiders/

Versions

ConEmu build: 190331 x64
OS version: Windows 10 Pro Build 18917

@Maximus5
Copy link
Owner

Maximus5 commented Jun 15, 2019

Please report this to wslbridge maintainer. ConEmu just run wslbridge to run wsl.
https://github.com/rprichard/wslbridge

Have you tried to run wsltty itself?

@Maximus5
Copy link
Owner

Perhaps you have done something with /mnt prefix and wslbridge fails to run its backend

@identityope
Copy link
Author

It seems like wslbridge is broken after this update, related issues here:
rprichard/wslbridge#44
mintty/wsltty#171

@Maximus5
Copy link
Owner

The problem is that I'm on slow insider ring and have not received an update yet, so I can't help with fixing

@Maximus5
Copy link
Owner

I think I need to force PTY API support and abandon wslbridge

@siennathesane
Copy link

I think I need to force PTY API support

I don't think it should be a problem so long as you version lock it to >1903. I'm on 18922, so I can help test it if you need.

@LostInBrittany
Copy link

I had the same problem today after installing WSL2, but I've found a nice (and surprisingly simple) workaround: if I change the {Bash:bash} task commands simply to

wsl.exe

it works as intended :)

@tomaspaseka
Copy link

I had the same problem today after installing WSL2, but I've found a nice (and surprisingly simple) workaround: if I change the {Bash:bash} task commands simply to

wsl.exe

it works as intended :)

I did the same, but arrow keys are not working in vim.

@LostInBrittany
Copy link

I had the same problem today after installing WSL2, but I've found a nice (and surprisingly simple) workaround: if I change the {Bash:bash} task commands simply to

wsl.exe

it works as intended :)

I did the same, but arrow keys are not working in vim.

I have just tested on my computer, they are working for me

@LesterCovax
Copy link

To add to @LostInBrittany 's solution, I'd recommend running wsl ~ instead of just wsl. That way you'll start in your WSL home directory instead of your Windows home directory.

I had a hell of a time trying to figure out how to pass commands through using the -e and -- flags mentioned in the --help entry, as they don't seem to work as I expected (and documentation is limited).

This is my new task definition:

  • chcp 65001 & set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & wsl.exe ~ -- boot.sh -cur_console:t:"Ubuntu"

And this is my old one using the WSL bridge:

  • chcp 65001 & set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt -cur_console:t:"Ubuntu" -t boot.sh

I originally had the chcp 65001 in there to make ANSI support work correctly, but I'm not so sure it's necessary anymore. The cur_console portion is to label the tab "Ubuntu". The boot.sh file contains code (cat /<pathToConEmu>/ConEmu/boot.ans) to echo some ANSI sequences (might not be necessary anymore) to initialize the session correctly. echo -e <ANSI escape sequences> can also be used. Then I have an ANSI splashscreen I made displayed via screenfetch.

LesterWslSplash

@inossidabile
Copy link

@LesterCovax nice workaround, thanks. However it's not working too well with Zsh and its magic.

@LesterCovax
Copy link

@inossidabile I found out yesterday that it's not working correctly for me either. I was wondering why my color palettes were all screwed up, but it appears if I start the console directly in the account I want, powerline is orange > green > grey like in my previous GIF. If I start the console tab as root in WSL, then su - saitei, it sets it correctly. Not sure if it's a powerline thing or something deeper since all other colors render correctly, and I confirmed the palettes haven't changed.

Incorrect:
image
Correct:
image

@Maximus5
Copy link
Owner

Maximus5 commented Sep 4, 2019

@LesterCovax
There may be reason for such behavior.
If your prompt used 256/true-colors than their support are limited to certain areas https://conemu.github.io/en/Xterm256Colors.html#xterm_256_color_mode_requirements
If not - that may be some palette issues or settings.

@LesterCovax
Copy link

@Maximus5 it's the same prompt/settings in both scenarios though. The only difference is the entry point...whether I start WSL as root, or directly as my user.

@Biswa96
Copy link

Biswa96 commented Sep 14, 2019

@Maximus5 I have made wslbridge2 project. Those works like in-place replacement of old wslbridge, also works in mintty. But I can't run in ConEmu. May you suggest any steps for that?

There are some bugs (static linking) but I shall fix them quickly.

@fpqc
Copy link

fpqc commented Sep 27, 2019

@Biswa96 Maximus would need to recompile his connector against the wslbridge2 project.

@pacanukeha
Copy link

I did the same, but arrow keys are not working in vim.

Same for me

@AurelienCordonnier
Copy link

AurelienCordonnier commented Dec 17, 2019

In agreement with @LesterCovax, edit the task definition by replacing %ConEmuBaseDirShort%\conemu-cyg-64.exe by wsl.exe in Cmder Settings/Startup/Tasks works fine. Probably that don't realy solve the "wslbridge error" encountered directly, but that gives an answer. I don't know if it is the same result as well...
I have to mention that works also with debian.exe and I think it will be the same for other distributions.

@Prunoideae
Copy link

It worked, but with certain bugs messing with GNU-screen and others.

image

The whole console was just messed up when using ctrl-A + | or other things alike to split screens, and also things like vim is not functional as expected.
Also, I tried tmux, upgraded it to version 2.8 and later, but it seemed to be the same as what screen does.

@IPWright83
Copy link

@tomaspaseka did you ever get arrow keys working? I've noticed that they start putting garbage to the console :(

@jlschuncke
Copy link

jlschuncke commented May 28, 2020

FWIW, the only obvious issue I've discovered in about 10 minutes bashing (literally) around with WSL2 and ConEmu (invoking WSL directly, without a WSL bridge) is thatt less doesn't repaint a screen correctly when backing up a page.

@gousaiyang
Copy link

I've just upgraded to Win10 2004, still using WSL1 and see the following error:

wslbridge error: failed to start backend process
note: backend error output: -v: -c: line 0: unexpected EOF while looking for matching `''
-v: -c: line 1: syntax error: unexpected end of file

Arrow keys also don't work in vim when I bypass the wslbridge and directly launch wsl.exe.

(I'm using Cmder with ConEmu 191012).

@bkraul
Copy link

bkraul commented May 28, 2020

With the arrows not working in vim, I found you can still use Alt + [Arrow] to achieve the use of the arrow keys without problems.

@jarni-ua
Copy link

jarni-ua commented Jun 2, 2020

Just updated to 2004 build and enabled WSL2. Some of issues as above are same. Neither vim nor less work correctly both adding some random amount of blank lines after exit. But arrow keys work in vim. Colors are somewhat messed up too.

@PurplProto
Copy link

I had the same problem today after installing WSL2, but I've found a nice (and surprisingly simple) workaround: if I change the {Bash:bash} task commands simply to

wsl.exe

it works as intended :)

Worked for getting WSL2 launching, but sadly no backscroll now 😢

@JakubJachym
Copy link

I've fixed the issue by doing this:

  1. Download latest cygwin1-20200531.dll.xz from https://cygwin.com/snapshots/ and unpack the file as cygwin1.dll into ConEmu\wsl\ (replacing the original file there)
  2. Download @Biswa96's wslbridge2 from https://github.com/Biswa96/wslbridge2/releases and unpack to the same directory
  3. Replacing {WSL::bash} task's Command with:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe %ConEmuBaseDirShort%\wsl\wslbridge2.exe -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l

I can now access my Ubuntu under W10 just like before the W10 upgrade. Backscroll and arrows in VIM work as expected.

@sarim
Copy link

sarim commented Jun 6, 2020

I think I need to force PTY API support and abandon wslbridge

Was this implemented in conemu? In this microsoft blog about conpty they mentioned your name.

Edit: After a bit more researching in relevant projects, it seems like cgywin implemented conpty support, so tools from cgywin, ex mintty can run wsl.exe without the previous issues. Is that true? I need to research a bit more and test to understand how & if these parts connect successfully. But does that mean we can discard wslbridge, and run wsl.exe from cgywin connector and have fully functional wsl terminal in conemu?

@saurabh7248
Copy link

This works great for me too. Anyone know how to set the starting directory?

You can try the following two alternatives:

-w <windows starting folder path>

or

-W <wsl starting folder path>

@vishy2907
Copy link

This works great for me too. Anyone know how to set the starting directory?

You can try the following two alternatives:

-w <windows starting folder path>

or

-W <wsl starting folder path>

Thanks!!!

@uchagani
Copy link

I've fixed the issue by doing this:

1. Download latest `cygwin1-20200531.dll.xz` from https://cygwin.com/snapshots/ and unpack the file as `cygwin1.dll` into `ConEmu\wsl\` (replacing the original file there)

2. Download @Biswa96's `wslbridge2` from https://github.com/Biswa96/wslbridge2/releases and unpack to the same directory

3. Replacing `{WSL::bash}` task's Command with:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe %ConEmuBaseDirShort%\wsl\wslbridge2.exe -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l

I can now access my Ubuntu under W10 just like before the W10 upgrade. Backscroll and arrows in VIM work as expected.

FYI, after ConEmu updates you have to reapply this patch.

@hyj1991
Copy link

hyj1991 commented Jul 1, 2020

I've fixed the issue by doing this:

  1. Download latest cygwin1-20200531.dll.xz from https://cygwin.com/snapshots/ and unpack the file as cygwin1.dll into ConEmu\wsl\ (replacing the original file there)
  2. Download @Biswa96's wslbridge2 from https://github.com/Biswa96/wslbridge2/releases and unpack to the same directory
  3. Replacing {WSL::bash} task's Command with:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe %ConEmuBaseDirShort%\wsl\wslbridge2.exe -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l

I can now access my Ubuntu under W10 just like before the W10 upgrade. Backscroll and arrows in VIM work as expected.

Thx!!!

@ronindesign
Copy link

I run zsh with Oh-My-Zsh, etc and can confirm the above works great (including arrow keys, vim functionality, mouse wheel scrolling in screen, etc). I followed the solutions above, but had simple issues with spaces in the dir paths, so I used quotes. I also created a new folder wsl2 so I can continue to use WSL (ver 1).

I created a new task {Bash::wsl2} with the following commands:

set "PATH=%ConEmuBaseDirShort%\wsl2;%PATH%" & "%ConEmuBaseDirShort%\conemu-cyg-64.exe" "%ConEmuBaseDirShort%\wsl2\wslbridge2.exe" -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l

@qurvax
Copy link

qurvax commented Jul 16, 2020

When I installed WSL2 and used workaround mentioned above, my WSL1 entry broke. Since there now is some issues with v2, i very much needed v1 running, and without wslbridge i'd get no arrow-keys and other stuff. So I somehow managed to get v1 going by trial_and_error method. Solution to run v1 with v2 installed and wslbridge2 solution applied:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe %ConEmuBaseDirShort%\wsl\wslbridge2.exe -d ubuntu-v1 -u v1username -V 1 -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l

@yihuajack
Copy link

I had the same problem today after installing WSL2, but I've found a nice (and surprisingly simple) workaround: if I change the {Bash:bash} task commands simply to

wsl.exe

it works as intended :)

Just as supplementary, for the case (WSL1)

note: backend error output: -v: -c: line 0: unexpected EOF while looking for matching `''
-v: -c: line 1: syntax error: unexpected end of file


ConEmuC: Root process was alive less than 10 sec, ExitCode=0.
Press Enter or Esc to close console...

this configuration also works!

@yihuajack
Copy link

I've fixed the issue by doing this:

  1. Download latest cygwin1-20200531.dll.xz from https://cygwin.com/snapshots/ and unpack the file as cygwin1.dll into ConEmu\wsl\ (replacing the original file there)
  2. Download @Biswa96's wslbridge2 from https://github.com/Biswa96/wslbridge2/releases and unpack to the same directory
  3. Replacing {WSL::bash} task's Command with:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe %ConEmuBaseDirShort%\wsl\wslbridge2.exe -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l

I can now access my Ubuntu under W10 just like before the W10 upgrade. Backscroll and arrows in VIM work as expected.

In addition, if showing path error

{PID:575} failed to run shell (2): No such file or directory
{PID:575} shell: `D:\Program` `Files\ConEmu\ConEmu\wsl\wslbridge2.exe` `-eConEmuBuild` `-eConEmuPID` `-eConEmuServerPID` `-l`
{PID:575}   dir: `/cygdrive/c/Users/<username>`

Just add two pairs of quote marks as:

set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe "%ConEmuBaseDirShort%\wsl\wslbridge2.exe" -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l

@Freelensia
Copy link

Freelensia commented Aug 27, 2020

I had the same problem today after installing WSL2, but I've found a nice (and surprisingly simple) workaround: if I change the {Bash:bash} task commands simply to

wsl.exe

it works as intended :)

Thanks a lot. Yes it works.
Also if you wanna start with dual consoles then do this:
wsl.exe -cur_console:pm:/mnt
wsl.exe -new_console:s50H -cur_console:pm:/mnt

@silencej
Copy link

wsl.exe

@LostInBrittany Thanks for the hint. A question: entering by "wsl.exe" and type "exit", there will be confirmation waiting:

ConEmuC: Root process was alive less than 10 sec, ExitCode=0.
Press Enter or Esc to close console...

How do you solve this?

@silencej
Copy link

wsl.exe

@LostInBrittany Thanks for the hint. A question: entering by "wsl.exe" and type "exit", there will be confirmation waiting:

ConEmuC: Root process was alive less than 10 sec, ExitCode=0.
Press Enter or Esc to close console...

How do you solve this?

Ok, I figured out it myself thanks to #1556

The solution is:

wsl.exe -new_console:n

@whindes
Copy link

whindes commented Sep 13, 2020

For anyone who is using zsh...these 3 options worked for me. HINT: the -- bash # is the magic to get zsh to run ~/.bashrc which calls zsh in my setup.

run> wsl -l -v #To get -d and -V values

=== OPTION 1 ===
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe "%ConEmuBaseDirShort%\wsl\wslbridge2.exe" -W ~ -V 1 -d Ubuntu-18.04 -u <your_v1_user> -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l -- bash

OR
=== OPTION 2 ===
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & wsl.exe wslbridge2.exe -W ~ -V 1 -d Ubuntu-18.04 -u <your_v1_user> -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l -- bash

OR
=== OPTION 3 ===
wsl.exe -- bash

@jgarrison-evine
Copy link

For anyone who hasn't already resolved this for themselves - I found that installing the version 3.3.0 of wslbridge from https://github.com/mintty/wsltty/releases/tag/3.3.0 resolved my issues.

NOTE: I did already have a special wsltty task setup (maybe I started using wsltty before official support was there in conemu?)
Command for the task is: %USERPROFILE%\AppData\Local\wsltty\bin\mintty.exe --WSL="Ubuntu-18.04" --configdir="%USERPROFILE%\AppData\Roaming\wsltty" -~

@ryanmaclean
Copy link

Worked perfectly for me, thanks @jgarrison-evine!

I'm on Ubuntu 20.04, so the command is ever-so-slightly different:

%USERPROFILE%\AppData\Local\wsltty\bin\mintty.exe --WSL="Ubuntu-20.04" --configdir="%USERPROFILE%\AppData\Roaming\wsltty" -~

@sarim
Copy link

sarim commented Nov 26, 2020

It seems that only mouse scrolling in tmux by "Send mouse events to console" doesn't work with this wslbridge2 solution (just nothing happens although selecting by mouse seems to work). Not a big problem for me, just a reference.

yeah and there are other little stuffs too. Like when tab completing a filename in bash, somehow terminal is not aware of its full width, and line breaks abnormally. Progress bars like apt/wget breaks and starts to print each new % update in new lines.... But these are hard to reproduce, I guess somehow things break after working on a terminal for some time and running different tools creates those side effects .....

Right now i'm using wsltty (mintty), feels very constrained after using conemu.....

So because of these issues I described before around Jun, I moved to wsltty (mintty). Few weeks ago I came back to conemu as wslbridge2 had some updated in the meantime. Seems like most of the issues are fixed, but I managed to capture one issue. This has been happening fairly regularly.

image

Here I pressed Ctrl + R, then I typed ssh. Look at [2] marked arrow, the ss is in line 1, and the h is in line 2. Bash found a command for ss, but it was not rendered properly. Rest of is cut of, marked by arrow [1] . then for ssh, the command rendered broken in line 2.

Here is another two screenshot from wsltty. Here everything rendered properly.

image

image

Edit: The two number in [ : ] in my bash prompt is \$COLUMNS:\$LINES. I added it recently to see if bash really knows it has a big window.

@sarim
Copy link

sarim commented Nov 26, 2020

@Biswa96 This doesn't happen in wsltty / mintty. You would not be able to reproduce it in mintty. This happens only in conemu.

This is the conemu task

set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe %ConEmuBaseDirShort%\wsl\wslbridge2.exe -cur_console:pm:/mnt -new_console:C:"C:\Program Files\WindowsApps\CanonicalGroupLimited.Ubuntu18.04onWindows_2020.1804.7.0_x64__79rhkp1fndgsc\ubuntu1804.exe" -eConEmuBuild -eConEmuPID -eConEmuServerPID -l

wslbridge2.exe is downloaded from https://github.com/Biswa96/wslbridge2/releases/tag/v0.7. Contents of that zip was unzipped into C:\Program Files\ConEmu\ConEmu\wsl

Conemu uses a cgywin bridge -> conemu-cyg-64.exe to communicate. So conemu -> conemu-cyg-64.exe -> wslbridge2.exe -> wsl2/bash. Thats the whole pipeline. Not sure where the issue is.

@earshinov
Copy link

I've fixed the issue by doing this:

  1. Download latest cygwin1-20200531.dll.xz from https://cygwin.com/snapshots/ and unpack the file as cygwin1.dll into ConEmu\wsl\ (replacing the original file there)
  2. Download @Biswa96's wslbridge2 from https://github.com/Biswa96/wslbridge2/releases and unpack to the same directory
  3. Replacing {WSL::bash} task's Command with:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe %ConEmuBaseDirShort%\wsl\wslbridge2.exe -cur_console:pm:/mnt -eConEmuBuild -eConEmuPID -eConEmuServerPID -l

Can someone please help me with this solution? I get

-sh: 6: export: Files/ConEmu/ConEmu/Scripts:/mnt/c/Program: bad variable name

and the running shell is sh instead of bash... I have no idea where line 6 mentioned in the error message comes from.

@Maximus5
Copy link
Owner

@earshinov This looks like badly formed PATH variable. I don't know who is doing that bad transfer (wslbridge2 or wsl itself).
As a quick fix you may try to configure Environment eliminating all paths containing spaces. E.g. replace %ConEmuBaseDir%\Scripts; with %ConEmuBaseDirShort%\Scripts;. But I bet there are other paths with spaces in your system PATH variable (those from C:\Program Files\...).

@earshinov
Copy link

earshinov commented Jan 10, 2021

I am not sure what it was, but:

  • I discovered that running WSL shell (not inside ConEmu) produced the same error
  • after Googling a little bit, I managed to fix this with chsh -s /bin/bash inside WSL…

@sarim
Copy link

sarim commented Jan 28, 2021

I see in @Maximus5's recent commits, conemu is creating wsl distro tasks with wsl.exe. Is it stable than wslbridge2? Is microsoft's ConPTY (and its integration in conemu) good enough that we don't need cygwin/wslbridge bridges anymore?

@LesterCovax
Copy link

LesterCovax commented Feb 5, 2021 via email

@PrestonTaylor
Copy link

PrestonTaylor commented May 11, 2021

For anyone who hasn't already resolved this for themselves - I found that installing the version 3.3.0 of wslbridge from https://github.com/mintty/wsltty/releases/tag/3.3.0 resolved my issues.

NOTE: I did already have a special wsltty task setup (maybe I started using wsltty before official support was there in conemu?)
Command for the task is: %USERPROFILE%\AppData\Local\wsltty\bin\mintty.exe --WSL="Ubuntu-18.04" --configdir="%USERPROFILE%\AppData\Roaming\wsltty" -~

This is like magic. Forget WSLbridge(2), this solves all issues for me including vim wiping out my buffer, scrolling, arrow keys, vim colors flashing depending on cursor position and more. The number of hours I've spent futzing with wslbridge1/2... ugh. Thank you!!!

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

No branches or pull requests