After a bit of investigation, I was able to start a standalone Jupyter Notebook on the WSL 2 side
and run an .ipynb file, using the Cadabra 2 kernel, in a browser on the Windows 10 side.
I've listed the steps below should it be of interest to other users.
1/ WLS 2 side. If not already installed, install wslu.
https://github.com/wslutilities/wslu
As I'm running Ubuntu 18.04,
sudo apt update
sudo apt install ubuntu-wsl
wslview --register
The last command registers wslu as the browser.
2/ WLS 2 side. In ~/.bashrc, append a line setting the BROWSER environment variable
export BROWSER=wslview
3/ WLS 2 side. cd to the directory with the .ipynb file(s) of interest and enter the standard
command
jupyter notebook --no-browser
A message such as the following should be generated, with no "tty" error message.
[I 05:18:22.050 NotebookApp] Writing notebook server cookie secret to /home/audrius/.local/share/jupyter/runtime/notebook_cookie_secret
[I 05:18:24.296 NotebookApp] JupyterLab extension loaded from /home/audrius/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 05:18:24.296 NotebookApp] JupyterLab application directory is /home/audrius/anaconda3/share/jupyter/lab
[I 05:18:24.305 NotebookApp] Serving notebooks from local directory: /mnt/c/projects/hamiltonian
[I 05:18:24.305 NotebookApp] The Jupyter Notebook is running at:
[I 05:18:24.305 NotebookApp] http://localhost:8888/?token=d2192d44165fd0f7a3162f6e6528425c838d27edb7b8d681
[I 05:18:24.306 NotebookApp] or http://127.0.0.1:8888/?token=d2192d44165fd0f7a3162f6e6528425c838d27edb7b8d681
[I 05:18:24.306 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 05:18:24.317 NotebookApp]
To access the notebook, open this file in a browser:
file:///home/audrius/.local/share/jupyter/runtime/nbserver-29930-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=d2192d44165fd0f7a3162f6e6528425c838d27edb7b8d681
or http://127.0.0.1:8888/?token=d2192d44165fd0f7a3162f6e6528425c838d27edb7b8d681
4/ Windows 10 side. Start the browser and enter the above url with token into the address bar.
In this case, I would enter
http://127.0.0.1:8888/?token=d2192d44165fd0f7a3162f6e6528425c838d27edb7b8d681
The browser should now display the WSL 2 side directory with the .ipynb files of interest.
5/ Windows 10 side. Left-click on the .ipynb file of interest. A new browser tab/window should
appear with the kernel set to Cadabra. Run the cell to view the Latex/MathML output in the browser.
WSL 2 side only. No success in running Cadabra in VS Code.