Git Product home page Git Product logo

docker-novnc's Introduction

noVNC Display Container

This image is intended to be used for displaying X11 applications from other containers in a browser. A stand-alone demo as well as a Version 2 composition.

Image Contents

  • Xvfb - X11 in a virtual framebuffer
  • x11vnc - A VNC server that scrapes the above X11 server
  • noNVC - A HTML5 canvas vnc viewer
  • Fluxbox - a small window manager
  • xterm - to demo that it works
  • supervisord - to keep it all running

Usage

Variables

You can specify the following variables:

  • DISPLAY_WIDTH=<width> (1024)
  • DISPLAY_HEIGHT=<height> (768)
  • RUN_XTERM={yes|no} (yes)
  • RUN_FLUXBOX={yes|no} (yes)

Stand-alone Demo

Run:

$ docker run --rm -it -p 8080:8080 theasp/novnc

Open a browser and see the xterm demo at http://<server>:8080/vnc.html

V2 Composition

A version of the V2 docker-compose example is shown below to illustrate how this image can be used to greatly simplify the use of X11 applications in other containers. With just docker-compose up -d, your favorite IDE can be accessed via a browser.

Some notable features:

  • An x11 network is defined to link the IDE and novnc containers
  • The IDE DISPLAY environment variable is set using the novnc container name
  • The screen size is adjustable to suit your preferences via environment variables
  • The only exposed port is for HTTP browser connections
version: '2'
services:
  ide:
    image: psharkey/intellij:latest
#    image: psharkey/netbeans-8.1:latest
    environment:
      - DISPLAY=novnc:0.0
    depends_on:
      - novnc
    networks:
      - x11
  novnc:
    image: theasp/novnc:latest
    environment:
      # Adjust to your screen size
      - DISPLAY_WIDTH=1600
      - DISPLAY_HEIGHT=968
      - RUN_XTERM=no
    ports:
      - "8080:8080"
    networks:
      - x11
networks:
  x11:

If the IDE fails to start simply run docker-compose restart <container-name>.

On DockerHub / GitHub


Thanks


This is based on the alpine container by @psharkey: https://github.com/psharkey/docker/tree/master/novnc Based on wine-x11-novnc-docker and octave-x11-novnc-docker.

docker-novnc's People

Contributors

mettbrot avatar sakurai-youhei avatar theasp 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  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  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  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

docker-novnc's Issues

Problem: Second Container does not detect the display

Hi, first i have to mention that I am a docker starter.

I tried to run firefox that runs in a different container.
But I always receive the following error message:
Unable to init server: Broadway display type not supported: novnc:0.0

Error: cannot open display: novnc:0.0

Use novnc with `network_mode: host`

If I set
network_mode: host
in docker-compose file, the http://localhost:8080/vnc.html does not work anymore
here is my setup

version: '2'
services:
  ide:
    image: psharkey/intellij:latest
    network_mode: host
    environment:
      - DISPLAY=novnc:0.0
    depends_on:
      - novnc
  novnc:
    image: theasp/novnc:latest
    network_mode: host
    environment:
      # Adjust to your screen size
      - DISPLAY_WIDTH=1600
      - DISPLAY_HEIGHT=968
      - RUN_XTERM=no

Publish for multiple architectures?

There isn't a NoVNC container image published to Docker Hub that supports arm64 (e.g., new Macs or Raspberry Pis). (The treehouse/novnc image is completely, and honestly quite impressively, broken.)

I was able to build yours and run it just fine on a Raspberry Pi 4. It would be great if you could publish the images for multiple platforms so it doesn't have to be rebuilt.

You would need to tweak your CircleCI config to use docker buildx build, something like this:

docker buildx build --platform linux/amd64,linux/arm64 --push -t theasp/novnc:latest -f Dockerfile .

The downside is that you have to build and push in a single step. And you probably need to figure out how to configure qemu-user-static and binfmt_msc -- not sure how easy that is to do on CircleCI.

[Question] Setting up password on NoVNC

Hi,

How can I set password while accessing the novnc through browser? Right not directly clicking connect works.

Also, I'm trying to set this up on heroku.

having trouble getting the example working

Start Failed: Failed to initialize graphics environment

java.awt.AWTError: Can't connect to X11 window server using 'novnc:0.0' as the value of the DISPLAY variable.

I am using the example docker compose. Any ideas?

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.