martes, 12 de mayo de 2026

Open web browser from wsl

Add these lines to .bashrc

# Open URLs in the Windows default browser from WSL
export BROWSER=wslview


Run this once (needs your password):
sudo apt-get update && sudo apt-get install -y wslu


Then reload your shell:
source ~/.bashrc


Verify:
wslview https://example.com 
# should open in Windows Firefox 

echo $BROWSER 
# should print: wslview

How this fixes your AWS SSO flow
wslu provides wslview, which hands URLs to Windows' default browser via cmd.exe.

Setting BROWSER=wslview is what the AWS CLI (and most tools) check first when they want to open a URL.

xdg-open on Ubuntu/WSL also delegates to $BROWSER for http(s):// URLs, so your earlier xdg-open error will be gone too.