Skip to main content

Run a desktop environments on Jupyter

Project description

Jupyter Remote Desktop Proxy

Binder Test Latest PyPI version Issue tracking - GitHub Help forum - Discourse

Run XFCE (or other desktop environments) on Jupyter.

This is based on https://github.com/ryanlovett/nbnovnc.

When this extension is launched it will run a Linux desktop on the Jupyter single-user server, and proxy it to your browser using VNC via Jupyter.

VNC Server

This extension requires a VNC Server to be installed on the system (likely, in the container image). The most tested VNC server is TigerVNC, while TurboVNC also works. Any VNC server available in $PATH as vncserver will be used, but no real testing outside of these servers has been performed.

For an example, see the Dockerfile in this repository which installs TigerVNC and XFCE4.

Installation

  1. Install this package itself, with pip from PyPI:

    pip install jupyter-remote-desktop-proxy
    
  2. Install the websockify dependency. Unfortunately, the PyPI websockify package is broken, so you need to install it either from conda-forge or with apt

  3. Install the packages needed to provide a VNC server and the actual Linux Desktop environment. You need to pick a desktop environment (there are many!) - here are the packages to use TigerVNC and the light-weight XFCE4 desktop environment on Ubuntu 22.04:

    dbus-x11
    xfce4
    xfce4-panel
    xfce4-session
    xfce4-settings
    xorg
    xubuntu-icon-theme
    tigervnc-standalone-server
    tigervnc-xorg-extension
    

    The recommended way to install these is from your Linux system package manager of choice (such as apt).

Docker

To spin up such a notebook first build the container:

$ docker build -t $(whoami)/$(basename ${PWD}) .

Now you can run the image:

$ 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*

Now head to the URL shown and you will be greated with a XFCE desktop.

Note the --security-opt seccomp=unconfined parameter - this is necessary to start daemons (such as dbus, pulseaudio, etc) necessary for linux desktop to work. This is the option kubernetes runs with by default, so most kubernetes based JupyterHubs will not need any modifications for this to work.

Limitations

  1. Desktop applications that require access to OpenGL are currently unsupported.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyter-remote-desktop-proxy-2.0.0.tar.gz (321.2 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file jupyter-remote-desktop-proxy-2.0.0.tar.gz.

File metadata

File hashes

Hashes for jupyter-remote-desktop-proxy-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d1cb421e5f8a45ccf32c988a45a8456ca933cdb662dc52b2f8aefc27176b5449
MD5 98ba4e7d2c82a4663538114bc1efa59a
BLAKE2b-256 bc24fa3dc0d0a3455b2ef8efab1c9249bfd0ba145487b053d5aa5e82077bca2f

See more details on using hashes here.

File details

Details for the file jupyter_remote_desktop_proxy-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_remote_desktop_proxy-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb9dcbb0b4ec3562f39c0dd14d5592a6fc5db59d2209eb877139841a3f1faeb4
MD5 bb22cae9e098c15159cd58894e25f446
BLAKE2b-256 a9cd552bef4b24bec80e16d757f28f0229a15a894f8588e3ea8765ff73ec0062

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page