Skip to content

cc861010/headless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ubuntu Docker container images with "headless" VNC session

  • start :

    docker run -d --net=host --shm-size=256m cc861010/headless

  • enjoy :

    open container_host:5901 with vncviewer in full-screen mode

    Alt + Enter , enjoy!

Usage

  • Run command with mapping to local port 5901 (vnc protocol) and 6901 (vnc web access):

    docker run -d -p 5901:5901 -p 6901:6901 cc861010/headless
    
  • Change the default user and group within a container to your own with adding --user $(id -u):$(id -g):

    docker run -d -p 5901:5901 -p 6901:6901 --user $(id -u):$(id -g) cc861010/headless
    
  • If you want to get into the container use interactive mode -it and bash

    docker run -it -p 5901:5901 -p 6901:6901 cc861010/headless bash
    
  • Build an image from scratch:

    build.sh
    

Connect & Control

If the container is started like mentioned above, connect via one of these options:

Hints

3) Override VNC environment variables

The following VNC environment variables can be overwritten at the docker run phase to customize your desktop environment inside the container:

  • VNC_COL_DEPTH, default: 24
  • VNC_RESOLUTION, default: 1280x1024
  • VNC_PW, default: my-pw
  • USRE_NAME, default: bear
  • USRE_PASSWORD, default: bear

3.1) Example: Override the VNC password

Simply overwrite the value of the environment variable VNC_PW. For example in the docker run command:

docker run -it -p 5901:5901 -p 6901:6901 -e VNC_PW=my-pw cc861010/headless

3.2) Example: Override the VNC resolution

Simply overwrite the value of the environment variable VNC_RESOLUTION. For example in the docker run command:

docker run -it -p 5901:5901 -p 6901:6901 -e VNC_RESOLUTION=800x600 cc861010/headless

4) View only VNC

Since version 1.2.0 it's possible to prevent unwanted control via VNC. Therefore you can set the environment variable VNC_VIEW_ONLY=true. If set, the startup script will create a random password for the control connection and use the value of VNC_PW for view only connection over the VNC connection.

 docker run -it -p 5901:5901 -p 6901:6901 -e VNC_VIEW_ONLY=true cc861010/headless

5) Known Issues

5.1) Chromium crashes with high VNC_RESOLUTION (#53)

If you open some graphic/work intensive websites in the Docker container (especially with high resolutions e.g. 1920x1080) it can happen that Chromium crashes without any specific reason. The problem there is the too small /dev/shm size in the container. Currently there is no other way, as define this size on startup via --shm-size option, see #53 - Solution:

docker run --shm-size=256m -it -p 6901:6901 -e VNC_RESOLUTION=1920x1080 cc861010/headless chromium-browser http://map.norsecorp.com/