Notebook: Launching notebook to browser on WSL

Created on 26 Apr 2019  Â·  36Comments  Â·  Source: jupyter/notebook

WSL = Windows Subsystem for Linux aka "Bash on Ubuntu on Windows" or "Running Linux on Windows".

Currently, in order for WSL to recognise Windows browsers, the $BROWSER environment variable needs to be set:
export BROWSER='/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'

However, the following text printed after calling jupyter notebook helps explain my issue.

    To access the notebook, open this file in a browser:
        file:///home/thomasaar/.local/share/jupyter/runtime/nbserver-5243-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=0276d3335ad5a259bd29effdbd1716f4591c85a10674501f

Currently, the browser window opens with the first of those two links. And since Chrome is a windows browser, that address doesn't exist for it.

My questions are:

  1. Is there a better way of doing this?
  2. If not, is there a way to feed chrome the second address (which does work if I manually paste it).

Most helpful comment

What it works for me is as follows:
I first created an alias for chrome on bash on Ubuntu on Windows by typing:
alias chrome="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe".
Then I configured jupyter_notebook_config.py file by adding:
c.NotebookApp.browser = u'/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe %s' line.
Then, I launch jupyter-notebook on bash and it launched a new chrome tab on http://localhost:8888/tree.
Hope it works for you too.
@salihyanikgonul
I tried that but the browser still opens on
file:///home/username/.local/share/jupyter/runtime/nbserver-4601-open.html
just like @thomasaarholt said.
How do you managed for the browser to open on http://localhost:8888/tree???

@juankikushima I am having the same issue in that my browser will automatically open, but it will try and open on the file rather than the URL! Anyone got any ideas how to fix that @salihyanikgonul ?

I have found how to fix this - i..e to have jupyter notebook launch from WSL in a windows web browser. There is a setting in the jupyter_notebook_config.py to force notebook to launch using the URL, not a redirect file.

c.NotebookApp.use_redirect_file = False
(default is True)

If you have your browser environment variable set, then running 'jupyter notebook' should now open it with http://localhost:8888/tree instead of the redirect file by default.

All 36 comments

I tried fixing it by typing the following command and then run 'jupyter notebook'
export BROWSER='/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'
The chrome still says 'unable to connect to host'

Kindly help.

A solution is to download firefox or chrome in your WSL
By downloading the browser you will need to use Xlaunch or another visual hoster.

This should work, make sure to test that you have the browser working after installing before testing with jupyter notebook.

Here go more details to launch from a native browser on WSL:

  • Browser: I used Firefox as Chrome turned out to be a hassle to install on WSL
sudo apt install firefox
  • Jupyter config: update the setting in ~/.jupyter/jupyter_notebook_config.py once firefox is callable from WSL
c.LabApp.browser = '/usr/bin/firefox --new-window %s'
  • Get a proper X-server for Windows (I use X410) and set up the following in your default shell (usually bash, unless you change it to zsh or something else).
export DISPLAY=localhost:0.0

Caveats: per my testing, new windows got opened up _automatically_ after putting in the settings listed above. Yet, the Firefox window is "oversized," and I needed to look for it and resize it properly. Please advise if you have a better way to rescale the auto-started Firefox by jupyter lab command.


A bit more echoing for the original posting:

Before switching to firefox on WSL, jupyter notebook did not launch at all when I got the browser configured to be the local Chrome on Windows. Instead, jupyter lab got me the reported troublesome behavior, since May 2019 or so. I clearly recall that such starting trouble did not exist back in 2018.

I installed firefox using the command 'sudo apt install firefox'.
I tried to open firefox from the terminal using the following commands. 'firefex' and /usr/bin/firefox. But it gave me the following error.

Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Broadway display type not supported: localhost:8888
Error: cannot open display: localhost:8888

I am not sure how to proceed. My windows firewall is also turned off. Kindly help.

Thanks.

@raghavven Let's try to start simple: how about simply start firefox from terminal? Does it give you an error?

  • If so, you will need to configure two things: 1. put export DISPLAY=localhost:0.0 into your ~/.bashrc (or whatever dotfile for your shell); and 2. run a local X-server on Windows. Xming is free and should work out of the box.

Then, it seems that your WSL did not install Firefox to /user/bin/firefox. No worries. You will then want to look up where it is by issuing which firefox in your command line. Then, you want to update the ~/.jupyter/jupyter_notebook_config.py accordingly.

Dear IIinfeng

I installed firefox and is found in the path (after typing the command"type -a firefox"), '/usr/bin/firefox'.

When I try to start firefox by simply typing 'firefox' in the terminal, I get the following error.

Error: no DISPLAY environment variable specified.

Kindly help.

Thanks.

How about you try to run the following command in your WSL terminal: export DISPLAY=localhost:0.0?

Then, within the same terminal session, try to run firefox directly? If it did not work, please write back with what you see from echo $DISPLAY command.

Please note, the performance of these firefox running on WSL can be another hassle: depending on your X-server, things may or may not work smoothly. I still think that there should be some option to tune, native to ~/.jupyter/jupyter_notebook_config.py, that shall save us the trouble of setting up a WSL-booted Firefox browser.

I first ran the command 'export DISPLAY=localhost:0.0' and then ran the following commands
'firefox' and '/usr/bin/firefox'. It gave me the following error for both.

"irefox
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Broadway display type not supported: localhost:0.0
Error: cannot open display: localhost:0.0"

I understand , what you are saying. I should be able to simply copy past the jupyter notebook link on firefox or chrome and it should work. I am just unable to understand what is wrong.

Thanks.

@raghavven I suggest that you may start Googling around and testing different parameters for the DISPLAY variable. This is more of a WSL issue now. Sorry for not able to help further. With the listed settings, I have been able to set up a good number of WSL installations that has "GUI support" (via X-forwarding).

@llinfeng IIinfeng

I understand, thanks for your help. really appreciate it.

@thomasaarholt When you set $BROWSER, beware that spaces in your path should translated to \, otherwise it will not be recognised:
export BROWSER='/mnt/c/Program\ Files\ (x86)/Google/Chrome/Application/chrome.exe'
This should do the job.

Dear @martin2384798

I do as you recommended, that
export BROWSER='/mnt/c/Program\ Files\ (x86)/Google/Chrome/Application/chrome.exe'

but Jupyter notebook aslo cannot launch Chrome. Do you have any other Ideas?

Thank

@thangckt Start jupyter notebook service by running jupyter notebook in WSL, then try visit 127.0.0.1:8888 in Chrome (8888 is the default port used by jupyter notebook service), will it show a webpage of jupyter notebook?

@martin2384798 ... yes, it correctly opens jupyter notebook webpage. So how I can make such address (i.e. 127.0.0.1:8888) to be opened automatically by typing "jupyter notebook"?
Thank.

Donno, did research before but no method found.

On Tue, Aug 6, 2019 at 1:48 PM thangckt notifications@github.com wrote:

@martin2384798 https://github.com/martin2384798 ... yes, it correctly
opens jupyter notebook webpage. So how I can make such address (i.e.
127.0.0.1:8888) to be opened automatically by typing "jupyter notebook"?
Thank.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jupyter/notebook/issues/4594?email_source=notifications&email_token=ADA3OF6J7NCD7EYRCSLKJJ3QDEGBHA5CNFSM4HIVXE52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3T552Q#issuecomment-518512362,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADA3OF52KAQIMV2PGF2X6ADQDEGBHANCNFSM4HIVXE5Q
.

Hi @thomasaarholt !

I recently decided to try WSL and also wanted to solve this. My solution includes creating a "Jupyter Notebook here" button in my context menu, which basically points to a terminal of choice (I use cmder) and runs a jupyter_notebook.sh script therein.

There is still a caveat. Because of some permission misshap, the jupyter notebook will not work in some folders especially dear to windows, such as your user folder. It still works in subfolders.

I share the code below for those interested.

Best regards,
Alberto.

This is the Cmder task, which is added to the windows registry key command.

set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl /mnt/c/users/aeljarrat/test/jupyter_notebook_here.sh -cur_console:pm:/mnt

The jupyter_notebook_here.sh script will open a jupyter notebook from wsl. You want to save it in a file that wsl can access and chmod +x that file at the linux side. The script is:

#! /bin/bash

# I need to source conda
source ~/anaconda3/bin/activate base

# Find the interesting output in stderr 
mycmd='jupyter notebook --no-browser'
exec 3< <($mycmd 2>&1)
a=$(grep -o -m1 'http://localhost.*' <&3)
echo $a

# Use preferred browser here
/mnt/c/Program\ Files/Mozilla\ Firefox/firefox.exe "$a"

# This keeps the terminal alive as we get the rest of the output
cat <&3

You can also use this script to open a notebook from the windows side, for instance;

wsl jupyter_notebook_here.sh

@AEljarrat Not sure if small world, or if we're just very vocal.
That's neat, thanks for the script!

@martin2384798 The main issue is that calling the jupyter notebook command opens a browser window with the file:///home/thomasaar/.local/share/jupyter/runtime/nbserver-5243-open.html path. Windows doesn't recognise the "file:/// prefix, nor does it know where the rest of the path is.

I'm tempted to suggest a change to the code so as to have the option of defaulting to open the IP path (localhost) or the nbserver html file. The launch_browser call is here in the code.

What it works for me is as follows:
I first created an alias for chrome on bash on Ubuntu on Windows by typing:

alias chrome="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe".

Then I configured jupyter_notebook_config.py file by adding:
c.NotebookApp.browser = u'/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe %s' line.

Then, I launch jupyter-notebook on bash and it launched a new chrome tab on http://localhost:8888/tree.

Hope it works for you too.

l just type jupyter notebook in WSL and manually open a new chrome tab in Windows to do so, but thanks @salihyanikgonul may be try this method next time.

What it works for me is as follows:
I first created an alias for chrome on bash on Ubuntu on Windows by typing:

alias chrome="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe".

Then I configured jupyter_notebook_config.py file by adding:
c.NotebookApp.browser = u'/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe %s' line.

Then, I launch jupyter-notebook on bash and it launched a new chrome tab on http://localhost:8888/tree.

Hope it works for you too.
@salihyanikgonul
I tried that but the browser still opens on
file:///home/username/.local/share/jupyter/runtime/nbserver-4601-open.html
just like @thomasaarholt said.
How do you managed for the browser to open on http://localhost:8888/tree???

What it works for me is as follows:
I first created an alias for chrome on bash on Ubuntu on Windows by typing:

alias chrome="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe".

Then I configured jupyter_notebook_config.py file by adding:
c.NotebookApp.browser = u'/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe %s' line.

Then, I launch jupyter-notebook on bash and it launched a new chrome tab on http://localhost:8888/tree.

Hope it works for you too.

Chrome for me is installed on my User account instead of Program Files, so using the correct path, the solution worked very nicely. Thank you @salihyanikgonul

@AEljarrat, your script worked like a charm for me. Thanks for sharing.

The only tweak I made was to use the wslview utility (https://github.com/wslutilities/wslu/wiki/wslview), which then just opens the jupyter notebook in the default browser of Windows:

# Use preferred browser here
wslview "$a"

What it works for me is as follows:
I first created an alias for chrome on bash on Ubuntu on Windows by typing:
alias chrome="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe".
Then I configured jupyter_notebook_config.py file by adding:
c.NotebookApp.browser = u'/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe %s' line.
Then, I launch jupyter-notebook on bash and it launched a new chrome tab on http://localhost:8888/tree.
Hope it works for you too.
@salihyanikgonul
I tried that but the browser still opens on
file:///home/username/.local/share/jupyter/runtime/nbserver-4601-open.html
just like @thomasaarholt said.
How do you managed for the browser to open on http://localhost:8888/tree???

@juankikushima I am having the same issue in that my browser will automatically open, but it will try and open on the file rather than the URL! Anyone got any ideas how to fix that @salihyanikgonul ?

What it works for me is as follows:
I first created an alias for chrome on bash on Ubuntu on Windows by typing:
alias chrome="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe".
Then I configured jupyter_notebook_config.py file by adding:
c.NotebookApp.browser = u'/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe %s' line.
Then, I launch jupyter-notebook on bash and it launched a new chrome tab on http://localhost:8888/tree.
Hope it works for you too.
@salihyanikgonul
I tried that but the browser still opens on
file:///home/username/.local/share/jupyter/runtime/nbserver-4601-open.html
just like @thomasaarholt said.
How do you managed for the browser to open on http://localhost:8888/tree???

@juankikushima I am having the same issue in that my browser will automatically open, but it will try and open on the file rather than the URL! Anyone got any ideas how to fix that @salihyanikgonul ?

I have found how to fix this - i..e to have jupyter notebook launch from WSL in a windows web browser. There is a setting in the jupyter_notebook_config.py to force notebook to launch using the URL, not a redirect file.

c.NotebookApp.use_redirect_file = False
(default is True)

If you have your browser environment variable set, then running 'jupyter notebook' should now open it with http://localhost:8888/tree instead of the redirect file by default.

What it works for me is as follows:
I first created an alias for chrome on bash on Ubuntu on Windows by typing:
alias chrome="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe".
Then I configured jupyter_notebook_config.py file by adding:
c.NotebookApp.browser = u'/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe %s' line.
Then, I launch jupyter-notebook on bash and it launched a new chrome tab on http://localhost:8888/tree.
Hope it works for you too.
@salihyanikgonul
I tried that but the browser still opens on
file:///home/username/.local/share/jupyter/runtime/nbserver-4601-open.html
just like @thomasaarholt said.
How do you managed for the browser to open on http://localhost:8888/tree???

@juankikushima I am having the same issue in that my browser will automatically open, but it will try and open on the file rather than the URL! Anyone got any ideas how to fix that @salihyanikgonul ?

I have found how to fix this - i..e to have jupyter notebook launch from WSL in a windows web browser. There is a setting in the jupyter_notebook_config.py to force notebook to launch using the URL, not a redirect file.

c.NotebookApp.use_redirect_file = False
(default is True)

If you have your browser environment variable set, then running 'jupyter notebook' should now open it with http://localhost:8888/tree instead of the redirect file by default.

Hi @acse-ogb119 but I got this message when I try your suggestion:

Config option use_redirect_file not recognized by NotebookApp.

Do you know what I might be doing wrong?

I have found how to fix this - i..e to have jupyter notebook launch from WSL in a windows web browser. There is a setting in the jupyter_notebook_config.py to force notebook to launch using the URL, not a redirect file.

c.NotebookApp.use_redirect_file = False
(default is True)

For reference, you can also set use_redirect_file via a command line argument.

jupyter notebook:

BROWSER=/mnt/c/path/to/firefox.exe jupyter notebook --NotebookApp.use_redirect_file=False

jupyter lab:

BROWSER=/mnt/c/path/to/firefox.exe jupyter-lab --LabApp.use_redirect_file=False

What it works for me is as follows:
I first created an alias for chrome on bash on Ubuntu on Windows by typing:
alias chrome="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe".
Then I configured jupyter_notebook_config.py file by adding:
c.NotebookApp.browser = u'/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe %s' line.
Then, I launch jupyter-notebook on bash and it launched a new chrome tab on http://localhost:8888/tree.
Hope it works for you too.
@salihyanikgonul
I tried that but the browser still opens on
file:///home/username/.local/share/jupyter/runtime/nbserver-4601-open.html
just like @thomasaarholt said.
How do you managed for the browser to open on http://localhost:8888/tree???

@juankikushima I am having the same issue in that my browser will automatically open, but it will try and open on the file rather than the URL! Anyone got any ideas how to fix that @salihyanikgonul ?

I have found how to fix this - i..e to have jupyter notebook launch from WSL in a windows web browser. There is a setting in the jupyter_notebook_config.py to force notebook to launch using the URL, not a redirect file.
c.NotebookApp.use_redirect_file = False
(default is True)
If you have your browser environment variable set, then running 'jupyter notebook' should now open it with http://localhost:8888/tree instead of the redirect file by default.

Hi @acse-ogb119 but I got this message when I try your suggestion:

Config option use_redirect_file not recognized by NotebookApp.

Do you know what I might be doing wrong?

Try using @cmfcmf 's suggestion, that also works for me and is neater! Note that I have my BROWSER environment variable set in .bashrc so do not need to preceed the command with BROWSER=...

Hope it works!

What it works for me is as follows:
I first created an alias for chrome on bash on Ubuntu on Windows by typing:
alias chrome="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe".
Then I configured jupyter_notebook_config.py file by adding:
c.NotebookApp.browser = u'/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe %s' line.
Then, I launch jupyter-notebook on bash and it launched a new chrome tab on http://localhost:8888/tree.
Hope it works for you too.
@salihyanikgonul
I tried that but the browser still opens on
file:///home/username/.local/share/jupyter/runtime/nbserver-4601-open.html
just like @thomasaarholt said.
How do you managed for the browser to open on http://localhost:8888/tree???

@juankikushima I am having the same issue in that my browser will automatically open, but it will try and open on the file rather than the URL! Anyone got any ideas how to fix that @salihyanikgonul ?

I have found how to fix this - i..e to have jupyter notebook launch from WSL in a windows web browser. There is a setting in the jupyter_notebook_config.py to force notebook to launch using the URL, not a redirect file.
c.NotebookApp.use_redirect_file = False
(default is True)
If you have your browser environment variable set, then running 'jupyter notebook' should now open it with http://localhost:8888/tree instead of the redirect file by default.

Hi @acse-ogb119 but I got this message when I try your suggestion:
Config option use_redirect_file not recognized by NotebookApp.
Do you know what I might be doing wrong?

Try using @cmfcmf 's suggestion, that also works for me and is neater! Note that I have my BROWSER environment variable set in .bashrc so do not need to preceed the command with BROWSER=...

Hope it works!

I've tried this, and it still doesn't work. It seems like no matter how I try to use NotebookApp.use_redirect_file=False, it just simply doesn't work.

The terminal displays:
Config option 'use_redirect_file' not recognized by 'NotebookApp'.

Would appreciate help with this issue.

@AEljarrat, your script worked like a charm for me. Thanks for sharing.

The only tweak I made was to use the wslview utility (https://github.com/wslutilities/wslu/wiki/wslview), which then just opens the jupyter notebook in the default browser of Windows:

# Use preferred browser here
wslview "$a"

wslview going to handling file:/// protocol in version 3.0.0 (wslu issue #66), after that, we can solve this problem just by update jupyter config:
c.NotebookApp.browser = 'wslview %s'
Before they finished, I write a script to handle it manually.
This script use wslpath to change unix path after file URI to windows path, then use wslview to open it. Set jupyter notebook browser to this script, it can open browser correctly in WSL.

#!/bin/bash
url=$1
if [ -n "$url" ] && expr match $url 'file://*'; then
    url="file://`wslpath -am ${url:7}`"
    echo "opening...\n$url"
fi
wslview "$url"

What it works for me is as follows:
I first created an alias for chrome on bash on Ubuntu on Windows by typing:
alias chrome="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe".
Then I configured jupyter_notebook_config.py file by adding:
c.NotebookApp.browser = u'/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe %s' line.
Then, I launch jupyter-notebook on bash and it launched a new chrome tab on http://localhost:8888/tree.
Hope it works for you too.
@salihyanikgonul
I tried that but the browser still opens on
file:///home/username/.local/share/jupyter/runtime/nbserver-4601-open.html
just like @thomasaarholt said.
How do you managed for the browser to open on http://localhost:8888/tree???

@juankikushima I am having the same issue in that my browser will automatically open, but it will try and open on the file rather than the URL! Anyone got any ideas how to fix that @salihyanikgonul ?

I have found how to fix this - i..e to have jupyter notebook launch from WSL in a windows web browser. There is a setting in the jupyter_notebook_config.py to force notebook to launch using the URL, not a redirect file.
c.NotebookApp.use_redirect_file = False
(default is True)
If you have your browser environment variable set, then running 'jupyter notebook' should now open it with http://localhost:8888/tree instead of the redirect file by default.

Hi @acse-ogb119 but I got this message when I try your suggestion:

Config option use_redirect_file not recognized by NotebookApp.

Do you know what I might be doing wrong?

Please upgrade your notebook version because that option requires notebook 6.0.2 or above. After upgrading, I could solve the problem that a redirect file is launched 😂

What it works for me is as follows:
I first created an alias for chrome on bash on Ubuntu on Windows by typing:

alias chrome="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe".

Then I configured jupyter_notebook_config.py file by adding:
c.NotebookApp.browser = u'/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe %s' line.

Then, I launch jupyter-notebook on bash and it launched a new chrome tab on http://localhost:8888/tree.

Hope it works for you too.

Work good for me even without the alias, for opening jupyter lab on WSL with the new Edge browser on Windows. Much thanks!

A combination of all of the advice above worked for me. I'm running Ubuntu 18.04 in WSL1. I'm launching jupyter notebook from a Python/Django project. Here are all the steps I followed:

  1. Make sure django-extensions, ipython, and jupyter are all installed in the Python environment.
  2. Add django-extensions to the INSTALLED_APPS of the project.
  3. Set the environment variable DJANGO_ALLOW_ASYNC_UNSAFE=true as per this tutorial - https://davit.tech/django-jupyter-notebook/ Don't do this in production, but it's fine for local dev.
  4. apt install wslu to get the wslview program installed.
  5. Set the environment variable BROWSER=wslview to make wslview the default Linux browser. I did this with an export statement in my bashrc.
  6. Generate a jupyter notebook config file using jupyter notebook --generate-config
  7. Set c.NotebookApp.use_redirect_file = False in the config file that was just generated.
  8. Start a new WSL shell and verify the environment variables are set with env.
  9. ./manage.py shell_plus --notebook and the notebook opens in my native default Windows browser. Chrome and Firefox both work. Success!

Hi sachika. Please open a separate issue as your problem is unrelated to this one.

What it works for me is as follows:
I first created an alias for chrome on bash on Ubuntu on Windows by typing:

alias chrome="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe".

Then I configured jupyter_notebook_config.py file by adding:
c.NotebookApp.browser = u'/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe %s' line.

Then, I launch jupyter-notebook on bash and it launched a new chrome tab on http://localhost:8888/tree.

Hope it works for you too.

I didn't use the alias. Simply just these two and I can launch Jupyter Notebook from WSL.

c.NotebookApp.browser = u'/mnt/c/Program\ Files/BraveSoftware/Brave-Browser/Application/brave.exe %s'
c.NotebookApp.use_redirect_file = False

Cheers

@thomasaarholt When you set $BROWSER, beware that spaces in your path should translated to \, otherwise it will not be recognized:
'export BROWSER='/mnt/c/Program\ Files\ (x86)/Google/Chrome/Application/chrome.exe'
This should do the job.
This should be the correct answer. It worked great and was easy to configure.
To clarify, just type 'nano .bashrc' and then paste:
'export BROWSER='/mnt/c/Program\ Files\ (x86)/Google/Chrome/Application/chrome.exe' at the bottom of the file.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itoed picture itoed  Â·  3Comments

arbaazsama picture arbaazsama  Â·  3Comments

uolter picture uolter  Â·  3Comments

arilwan picture arilwan  Â·  3Comments

cmesro picture cmesro  Â·  3Comments