-
Notifications
You must be signed in to change notification settings - Fork 18
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
zcli login -i / profiles doesn't work on WSL v2 @ Windows #56
Comments
Hey Joel, Just letting you know that I've seen this and will speaking with the appropriate team about it. In regards to your question " it seems a display manager is also expected for this CLI tool (why?)" - a Display Manager is another name for a login manager, when utilizing multiple profiles this is needed to manage / track these profiles. |
Yeah, I run Windows on my work laptop, and as many developers on Windows I have migrated to WSL2, which makes it really neat to work in an environment that is very close to linux. But WSL2 doesn't come with a login mechanism. Try googling how to get a login screen to work on WSL2 for windows and you will find many frustrated users. I feel that the mechanism currently used by zcli to provide the secure cache for the profile feature will therefore not work for the majority of developers using WSL2 on Windows, i.e. a significant portion of windows devs. As many devs that have used WSL2, I really don't want to go back to use nodejs on my windows host, I wouldn't switch back to windows to run zcli either. Now I understand you can still use zcli without the profile feature (I have custom scripts to swap in my different environments and cred stores using ZAT). But if you could take a look at the technology choice here and see if you could find any way to offer this functionality so devs running windows/WSL2 could leverage the very useful profiles, it would be really appreciated. Otherwise I'll have to setup new custom scripts for zcli to provide the profiles functionality, and I would love to just run the zcli provided by you guys without that hazzle. Thanks. |
Bump. Wondering if there was any progress made on this issue? |
Hi @joelhellman as you've probably seen, getting access to the default credential store on WSL is quite difficult and this is an issue flagged with Microsoft themselves on the WSL project. From what I've understood this is because the credential store (gnome-keyring) requires DBus APIs to communicate. DBus itself requires Linux's windowing manager (X11) to automatically start, which doesn't work on Ubuntu on WSL because there is no UI. Typically, to unlock the Keyring in Ubuntu there is a prompt in the GUI. There is a number of workarounds for this, but they are quite convoluted including:
I understand that neither of these workarounds are particularly friendly, however directly integrating with an alternative credential store for WSL users would still require a reasonable amount of system configuration as you would need to install OS level packages for whatever store we chose. However, it does look like this issue may be solved when Microsoft releases support for running Linux GUI applications on WSL which is currently in preview. In the meantime, while we won't discount exploring alternative solutions for the profiles feature on WSL, I would recommend that exploring one of the workarounds or sticking with your custom scripts is probably the best option. |
@zach-anthony thanks for engaging. I understand that decision and I think that's fair given the upcoming support for GUI apps on WSL2. I think the GA + real-life availability for WSL GUI is some time away for most business users (since it requires a new windows update, right now the preview requires windows 11), so probably this warrants a mention to WSL2 users on Windows in the docs. I'll make a pull request to have it added to the README. |
Expectations
Basic command
zcli login -i
works on modern Ubuntu on WSL2 @ WindowsReality
There is some dependencies for the keystore (keytar?) that doesn't play with WSL2 on Windows, and it seems a display manager is also expected for this CLI tool (why?). So it didn't work on my WSL2 setup.
It seemed the only solution was to install some version of X11 on WSL2, I gave up on it, and had to use my own script for profile switching. Right now it's profiles, I assume the keystore could be used to store other things in the future as well.
Please test the tool on WSL2 in the future, many developers running Windows have switched to it. It should be easy to develop Zendesk apps.
After
npm install @zendesk/zcli -g
runningzcli login -i
gave me:error /home/myuser/.local/share/zcli/node_modules/keytar: Command failed
I decided to installed the libsecret dependency (
apt install libsecret-1-dev
on my WSL2 distro), and re-ranzcli login -i
.Then I ended up with the error
Cannot autolaunch D-Bus without X11 $DISPLAY
, after successfully authenticating:From that point I tried various things without installing a whole X11 setup on my WSL2 setup, but I gave up.
Steps to Reproduce
npm install @zendesk/zcli -g
zcli login -i
Error: Cannot autolaunch D-Bus without X11 $DISPLAY
Issue details
Command: zcli login -i
Version: @zendesk/zcli/1.0.0-beta.8 wsl-x64 node-v14.17.0
OS: Ubuntu-20.04 on WSL v2 on Windows
The text was updated successfully, but these errors were encountered: