jupyter remote desktop proxy
1.0.0
在Jupyter上运行XFCE(或其他桌面环境)。
这基于https://github.com/ryanlovett/nbnovnc。
启动此扩展程序时,它将在Jupyter单用户服务器上运行Linux桌面,并通过Jupyter使用VNC将其委托给您的浏览器。
此扩展名需要在系统上安装VNC服务器(可能在容器映像中)。测试最多的VNC服务器是TigervNC,而TurboVNC也有效。将使用$PATH中的任何VNC服务器,因为将使用vncserver ,但是在这些服务器之外没有进行实际测试。
例如,请参见此存储库中安装TigervNC和XFCE4的Dockerfile 。
使用PyPI的pip安装此软件包本身:
pip install jupyter-remote-desktop-proxy安装提供VNC服务器和实际Linux桌面环境所需的软件包。您需要选择一个桌面环境(有很多!) - 以下是使用tigervnc和Ubuntu上的轻量级XFCE4桌面环境的软件包22.04:
dbus-x11
xfce4
xfce4-panel
xfce4-session
xfce4-settings
xorg
xubuntu-icon-theme
tigervnc-standalone-server
tigervnc-xorg-extension
安装这些安装的推荐方法是您所选的Linux系统软件包管理器(例如APT)。
旋转这样的笔记本首先构建容器:
$ docker build -t $( whoami ) / $( basename ${PWD} ) .现在您可以运行图像:
$ docker run --rm --security-opt seccomp=unconfined -p 8888:8888 $( whoami ) / $( basename ${PWD} )
Executing the command: jupyter notebook
[I 12:43:59.148 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[I 12:44:00.221 NotebookApp] JupyterLab extension loaded from /opt/conda/lib/python3.7/site-packages/jupyterlab
[I 12:44:00.221 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 12:44:00.224 NotebookApp] Serving notebooks from local directory: /home/jovyan
[I 12:44:00.225 NotebookApp] The Jupyter Notebook is running at:
[I 12:44:00.225 NotebookApp] http://924904e0a646:8888/ ? token=40475e553b7671b9e93533b97afe584fa2030448505a7d83
[I 12:44:00.225 NotebookApp] or http://127.0.0.1:8888/ ? token=40475e553b7671b9e93533b97afe584fa2030448505a7d83
[I 12:44:00.225 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 12:44:00.229 NotebookApp]
To access the notebook, open this file in a browser:
file:///home/jovyan/.local/share/jupyter/runtime/nbserver-8-open.html
Or copy and paste one of these URLs:
http://924904e0a646:8888/ ? token=40475e553b7671b9e93533b97afe584fa2030448505a7d83
or http://127.0.0.1:8888/ ? token=40475e553b7671b9e93533b97afe584fa2030448505a7d83
* snip *现在,前往显示的URL,您将使用XFCE桌面来表现出色。
请注意--security-opt seccomp=unconfined参数 - 这对于启动守护程序(例如dbus,pulseaudio等)是必要的,而Linux桌面才能工作。这是Kubernetes默认运行的选项,因此大多数基于Kubernetes的JupyterHubs将不需要任何修改才能工作。