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

WSL2 no longer working after windows update #2014

Closed
bmarkovic opened this issue Nov 13, 2019 · 13 comments
Closed

WSL2 no longer working after windows update #2014

bmarkovic opened this issue Nov 13, 2019 · 13 comments

Comments

@bmarkovic
Copy link

Versions

ConEmu build: 191012 [64]
OS version: Windows 10.0.19013.1122 x64
Used shell version: WSL (bash, ubuntu)

Problem description

I've upgraded Windows Insider build today. Since the upgrade, ConEmu WSL task no longer works. It exits with 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


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

This is my {WSL:Bash} task command line:

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

Please note that WSL works ok when started as "Ubuntu" in Start Menu, and it works fine with the new Windows Terminal. The only software that has the issue is ConEmu at the moment.

Also, other console types (Git Bash, Windows CMD, Powereshell) all work fine. The only combination that doesn't work is ConEmu with WSL.

I also tried moving the ConEmu.xml to a different location and starting fresh -- to exact same results.

@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

@bmarkovic
Copy link
Author

Thank you. This does indeed work. You don't need to specify the user (the default one, that corresponds to the Windows user, will be used), but you do need to specify the distro (at least in my case, otherwise it doesn't work and exits with "working less than 10 seconds" error).

So, essentially, as little as:

set PATH="%ConEmuBaseDirShort%\wsl";%PATH% & wsl -d ubuntu

is enough.

@LesterCovax
Copy link

Can confirm that the username isn't needed. I think I assumed it was necessary due to me creating a different username for WSL than my Windows account. I suppose it's only necessary if you have multiple user accounts in your WSL distro. The additional -cur_console:t:"Ubuntu" is simply to name the tab. I then set the tab icon with /icon "%USERPROFILE%\AppData\Local\lxss\bash.ico" in the 'Task parameters' field.

Now I just need to figure out how to get rid of the annoying extra entry in the 'Create New Console' dialogue. Been having that issue for years now and have just lived with it :goberserk: .

Screenshot_9

@bmarkovic
Copy link
Author

You probably haven't named the task so it shows up like that. You can edit all your tasks by opening Settings and going to Startup -> Tasks (yes, it doesn't make too much sense for it to be under Startup, which is probably something for another minor issue report).

You can name that task however you want, (the topmost, unlabeled input box) and you can delete any task by selecting it in the list on the left and clicking on the minus (i.e. -) key below the list.

@LesterCovax
Copy link

@bmarkovic The highlighted text there is actually the contents of the bash::WSL task right below it. Guess I should have specified that. All of my tasks are always named/categorized. Would love any other ideas, otherwise it may be time to submit my own issue for it. Cheers.

@sporton
Copy link

sporton commented May 31, 2020

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

Lester where do you place bash.sh in order for it to be found when opening a new window? I'd like to do something similar and have tried in in several location but keep getting the error "/bin/bash: bash.sh: command not found"

Thanks!

@LesterCovax
Copy link

Can't currently look up my setup but I believe it's in the vendor\console\ConEmu directory. You could also try using a fully qualified path (e.g. /mnt/c/someDir/script.sh).
Admittedly, I've had issues finding out which boot.sh was actually being used, as I had one in many directories to troubleshoot your problem.

@evoelker
Copy link

The code in @bmarkovic worked for for me with a minor adjustment:
set PATH="%ConEmuBaseDirShort%\wsl";%PATH% & wsl -d ubuntu
set PATH="%ConEmuBaseDirShort%\wsl";%PATH% & wsl -d <wsl_Image_Name>

For my install of Ubuntu 20.04, it worked with this:
set PATH="%ConEmuBaseDirShort%\wsl";%PATH% & wsl -d Ubuntu-20.04

You can get the Linux image name with the following:
wsl --list

@standin000
Copy link

@evoelker thanks, ubuntu doesn't work, Ubuntu with version works.

@gjws
Copy link

gjws commented Aug 18, 2020

I've given up and moved to Windows Terminal, everything works out of the box for my particular setup

@Maximus5 Maximus5 changed the title WSL no longer working after windows update WSL2 no longer working after windows update Aug 24, 2020
@Maximus5
Copy link
Owner

Duplicate: #1930

@PrestonTaylor
Copy link

Is it not possible to maintain the benefits of cygwin and work around this bug?

@gnaggnoyil
Copy link
Contributor

I believe this bug should be fixed with latest Win 10 21H1 and (possibly) Win 11 release. If anyone was having trouble before updating your OS to latest release should solve your problem.

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

9 participants