Giter Club home page Giter Club logo

tomasalias / docker-ubuntu-novnc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from frederic-boulanger-ups/docker-ubuntu-novnc

0.0 0.0 0.0 16.94 MB

Ubuntu 20.04 in a docker container with display in your web browser

License: Apache License 2.0

Shell 1.72% JavaScript 65.86% Ruby 1.46% Python 14.40% Perl 0.04% C 4.03% Java 0.03% Clojure 0.81% C# 0.32% PowerShell 0.03% CSS 1.68% Makefile 0.62% HTML 7.01% Vue 0.62% Dockerfile 0.54% Roff 0.67% Jinja 0.16%

docker-ubuntu-novnc's Introduction

docker-ubuntu-novnc

Docker image to provide HTML5 VNC interface to access a Ubuntu 20.04 LXDE desktop environment.

Available on Docker hub

The source files are available on GitHub

Based on the work by Doro Wu, see on Docker

Typical usage is:

docker run --rm -d -p 6080:80 -v $PWD:/workspace:rw -e USERNAME=username -e USERID=userid -e RESOLUTION=1680x1050 --name ubuntu-novnc fredblgr/ubuntu-novnc:20.04

Very Quick Start

Run ./startUbuntu.sh, you will have Ubuntu 20.04 in your browser, with the current working directory mounted on /workspace. The container will be removed when it stops, so save your work in /workspace if you want to keep it.

There is a startUbuntu.ps1 for the PowerShell of Windows. You may have to allow the execution of scripts with the command:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser.

Quick Start

Run the docker container and access with port 6080

docker run -p 6080:80 fredblgr/ubuntu-novnc:20.04

Browse http://127.0.0.1:6080/

VNC Viewer

Forward VNC service port 5900 to host by

docker run -p 6080:80 -p 5900:5900 fredblgr/ubuntu-novnc:20.04

Now, open the vnc viewer and connect to port 5900. If you would like to protect vnc service by password, set environment variable VNC_PASSWORD, for example

docker run -p 6080:80 -p 5900:5900 -e VNC_PASSWORD=mypassword fredblgr/ubuntu-novnc:20.04

A prompt will ask password either in the browser or vnc viewer.

HTTP Base Authentication

This image provides base access authentication of HTTP via HTTP_PASSWORD

docker run -p 6080:80 -e HTTP_PASSWORD=mypassword fredblgr/ubuntu-novnc:20.04

SSL

To connect with SSL, generate self signed SSL certificate first if you don't have it

mkdir -p ssl
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ssl/nginx.key -out ssl/nginx.crt

Specify SSL port by SSL_PORT, certificate path to /etc/nginx/ssl, and forward it to 6081

docker run -p 6081:443 -e SSL_PORT=443 -v ${PWD}/ssl:/etc/nginx/ssl fredblgr/ubuntu-novnc:20.04

Screen Resolution

The Resolution of virtual desktop adapts browser window size when first connecting the server. You may choose a fixed resolution by passing RESOLUTION environment variable, for example

docker run -p 6080:80 -e RESOLUTION=1920x1080 fredblgr/ubuntu-novnc:20.04

Default Desktop User

The default user is root. You may change the user and password respectively by USERNAME, USERID and PASSWORD environment variables, for example,

docker run -p 6080:80 -e USERNAME=`id -n -u` -e USERID=`id -u` -e PASSWORD=password fredblgr/ubuntu-novnc:20.04

This way, you will have the same name and uid in the container as on the host machine, which is very convenient when you mount a directory in the container using --volume.

Deploy to a subdirectory (relative url root)

You may deploy this application to a subdirectory, for example /some-prefix/. You then can access application by http://127.0.0.1:6080/some-prefix/. This can be specified using the RELATIVE_URL_ROOT configuration option like this

docker run -p 6080:80 -e RELATIVE_URL_ROOT=some-prefix fredblgr/ubuntu-novnc:20.04

NOTE: this variable should not have any leading and trailing slash (/)

Use as a base image

You may use this image as a base image to benefit from the GUI in a web browser, and install additional software. You can customize the startup process of the container by adding shell scripts to the /etc/startup/ folder. Any readable file with extension .sh placed in this folder will be sourced at this end of the startup process. You may use the following variables in your script:

  • $USER is the user name of the user connected to the session
  • $HOME is the home directory of that user
  • $RESOLUTION, if defined, is the resolution of the display, in the form <width>x<height> in pixels.

License

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/LICENSE-2.0

Original work by Doro Wu

Adapted by Frédéric Boulanger

docker-ubuntu-novnc's People

Contributors

frederic-boulanger-ups avatar dependabot[bot] avatar

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.