-
Notifications
You must be signed in to change notification settings - Fork 869
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 + Ubuntu 22.04.1: xdg-open: no method available for opening "https://www...." #8892
Comments
I think you may have to configure xdg-open to do this, we don't do this by default. |
|
I have the same issue, just installed a fresh Ubuntu 22.04 with service and GUI enabled, and the interop with browser is not working anymore on this version, there is something wired going on when using systemd with new WSL and GUI |
Came accros this one: #8795 |
wslu works. This really feels like a problem WSL should own -- installing the component, ensuring that the user knows the component could be installed, or forcing it to be installed due to some dependency. it's not even mentioned here: https://learn.microsoft.com/en-us/windows/wsl/install. (AdamGlassMS too) |
Same issue here. the WSL 22.04 was working fine this morning. I did a apt-upgrade and then, the console is now broken when trying to do "az login" I did "sudo apt install wslu" like mentioned and it seems to fix it. pretty weird what broke it |
I had a similar issue, considering if installing one of the "not found" packages would help. Haven't found a solution yet. |
Try to add an web browser path with wslpath can also help to covert the path style. Source: https://cgit.freedesktop.org/xdg/xdg-utils/tree/scripts/xdg-open.in |
@Biswa96 Thanks for the workaround! 👍 I had to create a symlink with |
Thanks both of you, it worked having 401 error. |
I am the developer of Azure CLI authentication. Because of this change, Python's built-in module
This affects MSAL's Then affects Azure CLI's |
@jiasli what does that mean ? that we should consider az cli not working properly anymore on WSL 22.04 ? |
@lgmorand $Env:BROWSER = '/mnt/c/Program Files/Google/Chrome/Application/chrome.exe' For bash on wsl to open with your default browser use: export BROWSER 'explorer.exe' |
@kierzorz thanks but that's not the point. WSL is configured and install by MS, az CLI is packaged by MS. Can't we expect either a fix upstream or a built-in workaround. For instance, WSL is installed on Windows where edge is here by default (even if not default browser), so for me, the env could be setup to point to edge install path. it would be sufficient to open a web page for auth |
I just installed Ubuntu 22.04. I had to do 2 things:
|
@leslie-corbalt I had a lot of issues because of |
Without $ sudo apt remove xdg-utils
$ sudo apt install python3.11
$ python3.11 -c "import webbrowser; print(webbrowser.open('https://login.microsoftonline.com/'))"
True
gio: https://login.microsoftonline.com/: Operation not supported |
I'm using this on WSL2 Ubuntu with default Windows integrations (such as ability to run .exe from Linux) enabled: $ sudo apt install xdg-utils
$ export BROWSER="cmd.exe /c start" # add to ~/.profile to make permanent
$ xdg-open https://www.microsoft.com/
'\\wsl.localhost\Ubuntu\home\<username_redacted>'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory. This opens https://www.microsoft.com/ in whatever happens to be my default Windows web browser. |
This work for me. Thanks! |
I'm using WSL2 on Windows using Ubuntu v22.04.5 LTS. --> I just execute $ sudo apt install xdg-utils and the call to a browser was solved and the "gio warning" dissapears |
you can do it like this, with quotes around the part having spaces, but not the full path export BROWSER=/mnt/c/'Program Files (x86)'/Microsoft/Edge/Application/msedge.exe |
For those who are lazy, just copy the displayed link in command line and open it in the browser, the command can still receive feedback after you finish working in the browser. |
Version
Microsoft Windows [´veersion 10.0.19042.1706]
WSL Version
Kernel Version
5.10.102.1
Distro Version
Ubuntu 22.04.1
Other Software
Try
xdg-open https://microsoft.com
result
/usr/bin/xdg-open: 882: www-browser: not found
/usr/bin/xdg-open: 882: links2: not found
/usr/bin/xdg-open: 882: elinks: not found
/usr/bin/xdg-open: 882: links: not found
/usr/bin/xdg-open: 882: lynx: not found
/usr/bin/xdg-open: 882: w3m: not found
xdg-open: no method available for opening 'https://microsoft.com'
Repro Steps
Try
xdg-open https://microsoft.com
Expected Behavior
Open windows browser
Actual Behavior
/usr/bin/xdg-open: 882: www-browser: not found
/usr/bin/xdg-open: 882: links2: not found
/usr/bin/xdg-open: 882: elinks: not found
/usr/bin/xdg-open: 882: links: not found
/usr/bin/xdg-open: 882: lynx: not found
/usr/bin/xdg-open: 882: w3m: not found
xdg-open: no method available for opening 'https://microsoft.com'
Diagnostic Logs
/usr/bin/xdg-open: 882: www-browser: not found
/usr/bin/xdg-open: 882: links2: not found
/usr/bin/xdg-open: 882: elinks: not found
/usr/bin/xdg-open: 882: links: not found
/usr/bin/xdg-open: 882: lynx: not found
/usr/bin/xdg-open: 882: w3m: not found
xdg-open: no method available for opening 'https://microsoft.com'
The text was updated successfully, but these errors were encountered: