Giter VIP home page Giter VIP logo

vncify's Introduction

vncify

Build on top of an existing Docker image to add VNC capabilities.

Build

After cloning or downloading this repository:

cd vncify
docker build -t [image]_vnc:1.0 --build-arg IMAGEBASE=[image] .

In the above command, replace [image] with the name of the base image you want to use.

The default username is assumed to be cmsusr. This can be changed by adding the following to the above command: --build-arg USERNAME=[user].

If Python 2.7 is not available in the base image, browser usage of VNC will fail. This can be avoided by enabling a standalone Python 2.7 installation: --build-arg GETPYTHON=true.

More generic command:
cd vncify
docker build -t [name]:[version] --build-arg IMAGEBASE=[base_name]:[base_version] .

where [name], [version], [base_name], [base_version] can all be specified if desired.

Run

docker run -P -p 5901:5901 -p 6080:6080 ... [image]_vnc:1.0

where ... is the rest of your usual docker run command. (Optionally, a command to run inside the container like /bin/bash can be appended to this command.)

Use VNC

To launch a VNC server, run this command: start_vnc

(For verbose output, use startvnc verbose.)

The first time you start a server, or after a cleanup, you will be asked to setup a password. It must be at least six characters in length.

Configuration Options:

  • You can use the GEOMETRY environment variable to set the size of the VNC window. By default it is set to 1920x1080.
  • If you run multiple VNC servers you can switch desktops by changing the DISPLAY environment variable like so: export DISPLAY=myvnc:1, which will set the display of the remote machine to that of the VNC server.

At this point, you can connect to the VNC server with your favorite VNC viewer (TigerVNC, RealVNC, TightVNC, OSX built-in VNC viewer, etc.). The following are the connection addresses:

Note: On OSX you will need to go to System Preferences > Sharing and turn on "Screen Sharing" if using a VNC viewer, built-in or otherwise. You will not need to do this if using the browser.

There are two additional helper functions:

  • stop_vnc: kill all of the running vnc servers and the noVNC+WebSockify instance
  • clean_vnc: run stop_vnc and clear all temporary files associated with the previous vnc servers

If you'd like more manual control you can use the following commands:

  • vncserver -list: list the available VNC servers running on the remote machine.
  • vncserver -kill :1: kill a currently running VNC server using. :1 is the "X DISPLAY #".
  • pkill -9 -P <process>: kill the noVNC+WebSockify process if you use the PID given when running start_vnc or when starting manually.

Compatibility

The Dockerfile is based on RHEL Linux distributions.

WebSockify only works correctly with Python 2.7 or higher. Images with older Python versions will not support the "web browser" view. (Traditional VNC viewers can still be used, or Python 2.7 can be installed in the image as indicated previously.)

vncify's People

Contributors

kpedro88 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.