GithubHelp home page GithubHelp logo

nbnovnc's Introduction

nbnovnc

This project is deprecated. Please see jupyter-desktop.

--

nbnovnc provides Jupyter server and notebook extensions to proxy a notebook-side VNC session using noVNC, enabling users to run non-web applications within their Jupyter notebook server. This is mostly useful for hosted Jupyter environments such as JupyterHub or Binder.

This is proof-of-concept. I'm working on 1) porting it to the latest jupyter-server-proxy and 2) use tigervnc and its UNIX socket support.

Installation

Install Dependencies

The extension requires nbserverproxy and currently uses an opinionated VNC environment comprised of TightVNC server, noVNC, supervisord, and websockify.

On Debian/Ubuntu:

apt install tightvncserver novnc websockify supervisor xinit

websockify compatibility

nbnovnc requires websockify version 0.8.0 for python2. There is a bug in websockify 0.8.0 under python3 which has since been addressed in websockify master. However, nbnovnc is not yet compatible with websockify master.

Install nbnovnc

Install the library:

pip install nbnovnc

Either install the extensions for the user:

jupyter serverextension enable  --py nbnovnc
jupyter nbextension     install --py nbnovnc
jupyter nbextension     enable  --py nbnovnc

Or install the extensions for all users on the system:

jupyter serverextension enable  --py --sys-prefix nbnovnc
jupyter nbextension     install --py --sys-prefix nbnovnc
jupyter nbextension     enable  --py --sys-prefix nbnovnc

Configuration

The following traitlets are available:

  • NBNoVNC.geometry: The desktop geometry, e.g. 1024x768.
  • NBNoVNC.depth: The color depth, e.g. 24.
  • NBNoVNC.novnc_directory: The path to noVNC's web assets.
  • NBNoVNC.vnc_command: The command to launch the VNC server. Contains replacement fields for display, depth, and geometry, e.g. xinit -- /usr/bin/Xtightvnc :{display} -geometry {geometry} -depth {depth}
  • NBNoVNC.websockify_command = The websockify command. Contains replacement fields. e.g. websockify --web {novnc_directory} --heartbeat {heartbeat} {port} localhost:{vnc_port}

You can set these in a jupyter_notebook_config.py in one of the config paths from jupyter --paths. For example:

c.NBNoVNC.novnc_directory = "/usr/local/src/novnc"

You may configure the desktop environment by altering ~/.xinitrc. For example:

#!/bin/bash

. /etc/X11/xinit/xinitrc

Security

In a shared environment where one user may freely connect to the host running another user's VNC server, you should make sure that the VNC server authenticates connections. For example, in jupyter_notebook_config.py:

import os
rfb_auth_file = os.path.join(os.environ['HOME'], '.vnc', 'passwd')
c.NBNoVNC.vnc_command = "xinit -- /usr/bin/Xtightvnc :{display} -geometry {geometry} -depth {depth}" + " -rfbauth " + rfb_auth_file

This requires that the user sets a password via vncpasswd.

nbnovnc's People

Contributors

ogiorgis avatar ryanlovett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nbnovnc's Issues

Move past proof-of-concept

Again, thanks for taking the initiative to throw this together! I've gotten a great response in some demos I've run lately, and I've been asked to put some effort into moving this from proof-of-concept to something we're comfortable deploying at some kind of beta level. So I'd like to propose a roadmap for doing that.

  • As you observe in #2 the extension should be less opinionated and more configurable (through traitlets?)
  • Apropos of this, test with other VNC implementations (I'll probably be targeting tightVNC here)
  • As mentioned in #1 see about adding some kind of heartbeat to keep the channel open
  • #4 and #5 are good to address but simply making the display port configurable is probably enough for now

Thoughts? I will be working along these lines over the next few weeks, but it would be great to coordinate and try to avoid duplication of effort and/or working in conflicting directions.

prone to server disconnects

Not sure yet if this is an issue with the proxy, the choice of packages, or...

After I start the VNC session, I am usually kicked out pretty quickly with the message:

Server disconnected (code: 1005)

Right-clicking on the desktop is a pretty reliable way (maybe 30% chance each time) to prompt the disconnect, although other actions may trigger it too. This does not happen when I use the notebook that starts the session by hand as here: https://mybinder.org/v2/gh/ryanlovett/binder-novnc/master?filepath=start_vnc.ipynb

add overrides for Xtightvnc invocation

So I've just gotten this working on a CentOS system. For reasons beyond my understanding, Debian derivatives ship with TightVNC, but RedHat derivatives use TigerVNC. This results in different executable naming (/usr/bin/Xvnc vs /usr/bin/Xtightvnc) and different defaults. In particular, TigerVNC defaults to security settings that wind up requiring the user to input a (not existing) password.

In my CentOS container I got around this by creating a /usr/bin/Xtightvnc shell script like:

#!/bin/sh
exec /usr/bin/Xvnc $@ -localhost -SecurityTypes=None

But it would be nicer to be able to either configure the command that supervisor runs, or at least drop a script like that in a less-hardcoded location.

No Option in JupyterLab

Hello,

I came across this jupyter extension, and it seems very promising. I'm currently working on building a new research computing HPC cluster, and we use jupyterhub with this batch spawner extension which creates a new jupyterlab session.

I was working on installing nbnovnc, but after following the instructions in the readme, I don't seem to have any kind of option relating to a VNC session in jupyterlab. I tried adding a configuration option as defined in the readme, and no errors were thrown, and I can confirm the extension is enabled by running jupyter nbextension list. Any ideas on this?

JupyerLab Version: 1.1.4, running on Ubuntu 18.04

Supervisor isn't the proxied service

SuperviseAndProxyHandler is supervising circus for us, but is actually proxying novnc. I need to configure circus to open the socket for novnc.

binder demo broken

I suspect the binder configuration needs some version pins added somewhere. I tried the binder link today, and while it worked a couple of months ago, now the VNC handshake never completes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.