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

wslbridge2 stops with black screen if wsl shell requires some input to proceed further #37

Open
mkkhg opened this issue Nov 10, 2022 · 7 comments

Comments

@mkkhg
Copy link

mkkhg commented Nov 10, 2022

I use the keychain [1] utility to keep my SSH key with a passphrase in running wsl session. On the first WSL run, keychain asks for the SSH password.

WSLbridge never shows this request and stops with a black screen here.

But, if I start wsl separately and input the passphrase, the subsequent wslbridge2 runs are successful.

Also, if I start wslbridge2 with the -s option, I see a separate WSL window with the keychain pass request. If I put my password, wslbridge2 will continue in the main window.

Please check and fix it if possible.

WSLBridge2 ver:
wslbridge2 v0.8

WSL:

wsl --status
Default Distribution: Ubuntu-20.04
Default Version: 2

Windows Subsystem for Linux was last updated on 01/04/2022
WSL automatic updates are on.

Kernel version: 5.10.102.1

[1] https://manpages.ubuntu.com/manpages/bionic/man1/keychain.1.html

@Biswa96
Copy link
Owner

Biswa96 commented Nov 10, 2022

Can you provide some instructions about how to setup that keychain program? Any article or documentation would be helpful. I can not promise that it will work, but I can try.

@mkkhg
Copy link
Author

mkkhg commented Nov 10, 2022

Here is one of the manuals:

https://esc.sh/blog/ssh-agent-windows10-wsl2/

I use zsh with tpm and powerlevel.

My .zshenv startup looks this way:

export PATH="$PATH:$HOME/bin/"
export EDITOR='vim'

HOST=$(hostname)
/usr/bin/keychain -q --nogui --agents ssh $HOME/.ssh/id_ed25519
source $HOME/.keychain/$HOST-sh

...

I've not tried, but it seems that any shell 'read' input on startup should stop the wslbridge2 run as well.

I'm pretty sure you are aware that the SSH key should have the passphrase, but I just will highlight it here.

@Biswa96
Copy link
Owner

Biswa96 commented Nov 10, 2022

I use zsh with tpm and powerlevel.

Does the program require any specific hardware like TPM or security key?

I'm pretty sure you are aware that the SSH key should have the passphrase

What does the SSH setup looks like? Are you SSH-ing from same host Windows OS to WSL2 VM? Or SSH-ing from WSL2 to another machine?

@mkkhg
Copy link
Author

mkkhg commented Nov 10, 2022

tpm - tmux plugin manager, I've missed adding tmux to the description. It is not relevant, by fact. So no, the keychain does not require any specific hardware, it's just an interface for the SSH agent.

I use WSL2 to ssh to another machine, so the keychain is set up in WSL2, in zsh.

For me, it's enough to add the keychain with password protected SSH key to the startup scripts of your shell in WSL2.

@Biswa96
Copy link
Owner

Biswa96 commented Nov 13, 2022

It's seems to work fine in my setup.

image

From the original post, it seems that you are using older wslbridge2 version. Can you try the newer one? Though there is not a lot of changes in newer version.

@mkkhg
Copy link
Author

mkkhg commented Nov 14, 2022

Nope, no luck. Upgrade did not help.

I use wslbridge2 with wsltty, and I've upgraded the wslbridge2 along with it.

Ok, let's assume it's something with my environment. I'll have to work that around.

By the way, how do you start the wslbridge2? Your cmd prompt looks different from the default setup.

I just run wslbridge2.exe from the 'cmd' prompt. If I start the wsl directly, it shows me the prompt.

So, the prerequisite steps are:

  1. Start a cmd terminal
  2. cd to wslbridge2 directory there.
  3. run 'wsl --shutdown'

If I enter 'wsl' now - I get the password prompt. If I run wslbridge2.exe - I get a blank screen. If I run 'wslbridge2.exe -s' - I get the prompt in the separate 'wsl' window, and if I enter the ssh passphrase there, I get the command prompt in wslbridge2 terminal.

Here is my windows info, if that helps:

OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.19044 N/A Build 19044

@Biswa96
Copy link
Owner

Biswa96 commented Nov 14, 2022

how do you start the wslbridge2?

Run Command Prompt as usual and type wslbridge2.exe.

Your cmd prompt looks different from the default setup.

Because I changed it using PROMPT environment variable. But that does not have any effect in wslbridge2.

I have tried with both zsh and bash in Windows 10 and Windows 11. Though I don't use WSL as a daily driver. Maybe I am missing something. If possible, try with a clean Linux distribution in WSL. You don't have to delete the current one.

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

2 participants