Skip to main content

novnc for jlab

Project description

jupyterlab-novnc

Github Actions StatusBinder

jupyterlab-novnc viewer running

This package adds a novnc viewer to JupyterLab. It's a simple extension that just runs noVNC in an iframe.

You can configure noVNC connections in the settings panel. You probably want to configure at least host and port. Additionally you can add a name to your connection to make it easier to find.

This extension is composed of a Python package named jupyterlab-novnc for the server extension and a NPM package named jupyterlab-novnc for the frontend extension.

Icons made by Smartline from www.flaticon.com

Settings

You need to open the Advanced Settings menu of JupyterLab and configure jupyterlab-novnc. Add your desired configurations to the "configured_endpoints" setting as a list.

After configuration is done, you'll have one icon per configured endpoint:

Icons showing up in JupyterLab

The noVNC panel can also be opened from the command pallet.

For example:

{
    "configured_endpoints": [
    {
        "name": "Robot",
        "host": "localhost",
        "port": 6080,
        "resize": "scale",
        "password": "mycrazycomplicatedpassword"
    },
    {
      ...
    }
}

Allowed settings values for each item are:

{
  name: string; // optional name, otherwise host is used
  // autoconnect - Automatically connect as soon as the page has finished loading.
  autoconnect: boolean;
  // reconnect - If noVNC should automatically reconnect if the connection is dropped.
  reconnect: boolean;
  // reconnect_delay - How long to wait in milliseconds before attempting to reconnect.
  reconnect_delay: number;
  // host - The WebSocket host to connect to.
  host: string;
  // port - The WebSocket port to connect to.
  port: number;
  // encrypt - If TLS should be used for the WebSocket connection.
  encrypt?: boolean;
  // path - The WebSocket path to use.
  path?: string;
  // password - The password sent to the server, if required.
  password?: string;
  // repeaterID - The repeater ID to use if a VNC repeater is detected.
  repeaterID?: string;
  // shared - If other VNC clients should be disconnected when noVNC connects.
  shared?: boolean;
  // bell - If the keyboard bell should be enabled or not.
  bell?: boolean;
  // view_only - If the remote session should be in non-interactive mode.
  view_only?: boolean;
  // view_clip - If the remote session should be clipped or use scrollbars if it cannot fit in the browser.
  view_clip?: boolean;
  // resize - How to resize the remote session if it is not the same size as the browser window. Can be one of off, scale and remote.
  resize?: "off" | "scale" | "remote";
  // quality - The session JPEG quality level. Can be 0 to 9.
  quality?: number;
  // compression - The session compression level. Can be 0 to 9.
  compression?: number;
  // show_dot - If a dot cursor should be shown when the remote server provides no local cursor, or provides a fully-transparent (invisible) cursor.
  show_dot?: boolean;
  // logging - The console log level. Can be one of error, warn, info or debug.
  logging?: "error" | "warn" | "info" | "debug";
}

Requirements

  • JupyterLab >= 3.0

Install

pip install jupyterlab-novnc

Troubleshoot

If you are seeing the frontend extension, but it is not working, check that the server extension is enabled:

jupyter server extension list

If the server extension is installed and enabled, but you are not seeing the frontend extension, check the frontend extension is installed:

jupyter labextension list

Contributing

Development install

Note: You will need NodeJS to build the extension package.

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

# Clone the repo to your local environment
# Change directory to the jupyterlab_novnc directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# If using a server extension, it must be manually installed in develop mode
jupyter server extension enable <extension_name>
# Rebuild extension Typescript source after making changes
jlpm run build

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

By default, the jlpm run build command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

jupyter lab build --minimize=False

Uninstall

pip uninstall jupyterlab_novnc

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

jupyterlab-novnc-0.2.0.tar.gz (716.5 kB view details)

Uploaded Source

Built Distribution

jupyterlab_novnc-0.2.0-py3-none-any.whl (730.2 kB view details)

Uploaded Python 3

File details

Details for the file jupyterlab-novnc-0.2.0.tar.gz.

File metadata

  • Download URL: jupyterlab-novnc-0.2.0.tar.gz
  • Upload date:
  • Size: 716.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.2

File hashes

Hashes for jupyterlab-novnc-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2299b17e7e8df2bc9d6c794ba3962ae8aa65b80f0c7a01bdb1a380b5b91ff02e
MD5 fe35f9bad2f49cd658ed2cbbbd54597f
BLAKE2b-256 42734d6df1c64153eb54f723694bce9bceffadadf4a2e650c9549160665f78a1

See more details on using hashes here.

File details

Details for the file jupyterlab_novnc-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: jupyterlab_novnc-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 730.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.2

File hashes

Hashes for jupyterlab_novnc-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f60f2f25e33be29935078166c8dab463571772df678694f7f960bdea8853b1a4
MD5 7d29774cf9eb3ef915bef4e87c2ea358
BLAKE2b-256 4639fbe839cc6251afa8a9542a62e5489e87149d1da79df26b9082e6164e842d

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