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

Does not work with WSL 2 #44

Open
myoung34 opened this issue Jun 13, 2019 · 22 comments
Open

Does not work with WSL 2 #44

myoung34 opened this issue Jun 13, 2019 · 22 comments

Comments

@myoung34
Copy link

myoung34 commented Jun 13, 2019

Was working perfectly, but just updated windows to the latest insider build for WSL 2 support

C:\Users\3vilp\ver

Microsoft Windows [Version 10.0.18917.1000]
C:\Users\3vilp\AppData\Local\wsltty\bin>wslbridge.exe
wslbridge error: failed to start backend process
note: backend error output: wslbridge-backend: wslbridge-backend.cc:45: int {anonymous}::connectSocket(int, const string&): Assertion `connectRet == 0' failed.
@nightwolfz
Copy link

Are there any alternatives that work?

@Biswa96
Copy link

Biswa96 commented Jul 28, 2019

If you want to test I've done something here: https://github.com/Biswa96/wslbridge2/releases

@BrianInglis
Copy link

Would be friendlier to do a PR against wslbridge, making the minimal changes required to support the pty naming at runtime. Also supporting other Linux flavour ptys e.g. Fedora, SuSE, if different, would be nicer.

@AiOO
Copy link

AiOO commented Jul 30, 2019

A different error occur on WSL 2 with Windows 10 18945.1001.

C:\Users\brigh\AppData\Local\wsltty\bin>wslbridge
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

@Biswa96
Copy link

Biswa96 commented Aug 14, 2019

I've added another method hvpty in my wslbridge2 repository which uses Hyper-V sockets to connect with WSL2, can be used with mintty like terminals.

@ismail
Copy link

ismail commented Aug 14, 2019

I've added another method hvpty in my wslbridge2 repository which uses Hyper-V sockets to connect with WSL2, can be used with mintty like terminals.

In my tests on latest Insider build, hvpty just exits without printing an error but rawpty wsl still works.

@Biswa96
Copy link

Biswa96 commented Aug 30, 2019

Cygwin now has Windows ConPTY support. See this commit. Released in Cygwin 3.1.0-0.3 test build. So, wsl.exe and other Windows console programs can be executed directly in mintty, no need to use wslbridge or winpty related programs.

@BrianInglis
Copy link

So, if mintty is running under Cygwin 3.1.0 or later and Windows supports WSL and a distro is to be launched:

  • if WSL 2 is supported and a distro is to be run which is configed to run under WSL 2,
  • the user login shell can be execed
  • instead of execing wslbridge-backend to fork the user login shell?

@Biswa96
Copy link

Biswa96 commented Aug 31, 2019

I can not understand your query properly. In simple words, mintty becomes similar as CMD technically.

@BrianInglis
Copy link

How should the specification for mintty read to run wsl now: under what conditions, and with which arguments, does mintty invoke wsl, to either skip wslbridge-backend or invoke wslbridge-backend?

@Biswa96
Copy link

Biswa96 commented Sep 1, 2019

Theoratically, No backend, no extra code needed 🎉 Just type wsl.exe. One thing must be noted. The cygwin is now in test build so there are some issues.

@bullmastiffo
Copy link

BTW on build Microsoft Windows [Version 10.0.18975.1000] and for WSL1 I still get

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

it might be related to latest build changes.. is there any options to checkout logs or that backend output?

@Biswa96
Copy link

Biswa96 commented Sep 13, 2019

Try this https://github.com/Biswa96/wslbridge2. See previous comments. Also this mintty/wsltty#186

@dseven
Copy link

dseven commented Sep 14, 2019

Apologies for my ignorance - I don't understand all of the puzzle-pieces well enough. How can I make conemu use wslbridge2? I'm currently on Windows Insider build 18980, and started hitting this problem a few builds back.

@Biswa96
Copy link

Biswa96 commented Sep 14, 2019

@dseven Thank you for the question. I will add a detailed instructions in my repo and let you know.

@LesterCovax
Copy link

I just ended up bypassing the WSL bridge. Tested on WSL 1 & 2.

set PATH="%ConEmuBaseDirShort%\wsl";%PATH% & wsl -d ubuntu -u lester -cur_console:t:"Ubuntu" -- boot.sh

The boot.sh I run is of course optional, and could be removed or replaced with some other command you want to run. I've just used one for a long time with ConEmu to instantiate ANSI support so my powerline and boot splash look puuuurdy (some of it is prob superfluous).

#!/bin/bash
cat /mnt/d/some/long/path/conemu-maximus5/ConEmu/boot.ans
cd ~
screenfetch
bash -l -i

@Smasherr
Copy link

Smasherr commented Mar 20, 2020

I tried that approach bypassing the WSL bridge but have to find out that it works quite laggy in some cases. I think this is related to reading directories and files. For example, I do the following sequence of actions (I am using oh-my-zsh):

  1. Type in vim p
  2. Press <Tab>
  3. See the following file list package.json, package-lock.json and pom.xml
  4. Press <Tab> to select package.json
  5. Press <Enter> to confirm the selection
  6. Press <Enter> to execute vim package.json
  7. Type :q to quit vim

In ConEmu there is a delay after actions 2, 4, 5, 6 and 7, which makes the work quite uncomfortable. In native WSL console, there is no noticeable delay. I am not sure though if that's somehow wslbridge related.

@LesterCovax
Copy link

@Smasherr - Might be related to rendering UTF/ANSI and screen redraws? I think there were some major changes around that on the Windows side.
Have you tried it in the new MS Terminal app? Curious if it lags in that as well.
I would personally enable debugging output to a log file, then run through those same steps. That way you'll be able to see the raw ANSI/etc that's being sent to the session, and any other silent errors/warnings that may be occurring.

@cyberis
Copy link

cyberis commented Aug 23, 2020

Apologies for my ignorance - I don't understand all of the puzzle-pieces well enough. How can I make conemu use wslbridge2? I'm currently on Windows Insider build 18980, and started hitting this problem a few builds back.

I still do not find any instructions on how to use wslbridge2 with conemu. I just updated to windows 2004 and now Conemu crashes per @AiOO comment above.

@hheavener-kyd
Copy link

hheavener-kyd commented Sep 10, 2020

For WSL 1 users (possibly WSL 2 but I don't know), I found a solution that seems to work pretty good. Similar to the answer posted by @LesterCovax, this bypasses the bridge, but it's less complicated. Now, it should be said, this is not my area of expertise and I figured this out with the help of someone in my group who is more savvy but, to my understanding, this uses the Windows terminal to access WSL instead of going through the bridge which seems to be a more efficient route anyway.

Instead of set PATH="%ConEmuBaseDirShort%\wsl...,
use wsl.exe -new_console:d:C:\<path_you_want_to_default_to>.

I hope this helps.

@agirardeau
Copy link

Fyi I started having this problem today on Windows 10.0.18363.1082 (aka release 1909).

Not quite sure how to implement hheavener-kyd's solution as I've been using wsltty. Screenshot: https://imgur.com/a/8Ughyan

@hheavener-kyd
Copy link

Fyi I started having this problem today on Windows 10.0.18363.1082 (aka release 1909).

Not quite sure how to implement hheavener-kyd's solution as I've been using wsltty. Screenshot: https://imgur.com/a/8Ughyan

Odd...my WSL terminal worked just fine but my Cmder-mini was throwing this error. I just plugged the value into the startup scripts for Cmder-mini and it worked. Like I said, though, not really my area of expertise unfortunately.

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