Open browser in host system from Windows Subsystem for Linux?

Install wslu and use 'BROWSER=wslview'


You can set the BROWSER variable. There is a long article explaining how to set environment variables.

If you want to set the variable for the current terminal session you can use:

export BROWSER='/mnt/c/Program Files/Firefox/firefox.exe'

(assuming you want to use Firefox and have it installed in C:\Program Files\Firefox\firefox.exe)

If you want this to be persistent, you can add the above line to the file ~/.bashrc.


For some reason WSL can see the windows file explorer. If you do:

explorer.exe Preview.html 

in the console it should open in the default Windows web browser.


Combining the two answers above, the simplest solution is to set BROWSER to windows file explorer in order to use the default Windows web browser

export BROWSER='/mnt/c/Windows/explorer.exe'

I used sensible-browser http://localhost:8001/ on Ubuntu 20.04 w/ WSL2