The integration between the Windows Subsystem for Linux (aka WSL) and Windows works spectacularly most of the time, but occasionally things get a little troublesome. One such case was a change in browser behaviour that I noticed recently after upgrading to a new laptop.

On my old machine, I had an Ubuntu environment running under WSL2 and any time a browser was needed, it would open in the Windows environment. One common scenario was authentication, running az login when working with Azure.

After upgrading to my new laptop, I kept getting errors from xdg-open that indicated it was unable to open a browser.

A temporary workaround was to use --use-device-code with az login, but that wasn’t a satisfactory solution because I never remembered to use it first time.

It turns out the package wslu was pre-installed on earlier Ubuntu builds, but is not on the latest versions. Installing wslu via sudo apt install wslu fixed the issue.

One of the interesting things I found while investigating the problem was this post from one of the authors of Azure CLI authentication.


blog comments powered by Disqus
Prior Post
Factory methods and functions  05 Mar 2023
Related Posts
Factory methods and functions  05 Mar 2023
Using Constructors  27 Feb 2023
An Inconvenient API  18 Feb 2023
Method Archetypes  11 Sep 2022
A bash puzzle, solved  02 Jul 2022
A bash puzzle  25 Jun 2022
Improve your troubleshooting by aggregating errors  11 Jun 2022
Improve your troubleshooting by wrapping errors  28 May 2022
Keep your promises  14 May 2022
When are you done?  18 Apr 2022
March 2024