JupyterLab from on WSL2

I am trying to run Jupyter Lab on WSL2 (setup as per doc) from docker-stacks images.

When I run:

$ docker run --rm -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes -v "$PWD":/home/xxxxxx/ds jupyter/datascience-notebook
Executing the command: jupyter lab
[I 2021-02-22 18:23:55.427 ServerApp] jupyterlab | extension was successfully linked.
[W 2021-02-22 18:23:55.435 NotebookApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-22 18:23:55.435 NotebookApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-02-22 18:23:55.435 NotebookApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[I 2021-02-22 18:23:55.450 ServerApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/jupyter_cookie_secret
[I 2021-02-22 18:23:55.922 ServerApp] nbclassic | extension was successfully linked.
[I 2021-02-22 18:23:56.044 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.8/site-packages/jupyterlab
[I 2021-02-22 18:23:56.044 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
:
 :
 [I 2021-02-22 18:23:56.066 ServerApp] http://8b96140dffc0:8888/lab?token=1d06a5d6d5c523fa14a34420e5df678b619326d04648cbc6
[I 2021-02-22 18:23:56.066 ServerApp]  or http://127.0.0.1:8888/lab?token=1d06a5d6d5c523fa14a34420e5df678b619326d04648cbc6
[I 2021-02-22 18:23:56.066 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 2021-02-22 18:23:56.079 ServerApp] **No web browser found: could not locate runnable browser.**
[C 2021-02-22 18:23:56.080 ServerApp]

    To access the server, open this file in a browser:
        file:///home/jovyan/.local/share/jupyter/runtime/jpserver-7-open.html
    Or copy and paste one of these URLs:
        http://8b96140dffc0:8888/lab?token=1d06a5d6d5c523fa14a34420e5df678b619326d04648cbc6
     or http://127.0.0.1:8888/lab?token=1d06a5d6d5c523fa14a34420e5df678b619326d04648cbc6

I am not able to access JupyterLab from Chrome or Firefox . I have tried setting :
a. wslview --register
b. export BROWSER=wslview

But still encountering the issue.

regards,
Thomas

There are lots of reported issues with port-forwarding localhost with WSL2, for instance:

Maybe one of those has a workaround that will work for you?

1 Like