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將不需要任何修改才能工作。