-
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!
some script from docker-headless-vnc-container
-
Run command with mapping to local port
5901(vnc protocol) and6901(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
-itandbashdocker run -it -p 5901:5901 -p 6901:6901 cc861010/headless bash -
Build an image from scratch:
build.sh
If the container is started like mentioned above, connect via one of these options:
- connect via VNC viewer
localhost:5901, default password:vncpassword - connect via noVNC HTML5 full client:
http://localhost:6901/vnc.html, default password:vncpassword - connect via noVNC HTML5 lite client:
http://localhost:6901/?password=vncpassword
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:24VNC_RESOLUTION, default:1280x1024VNC_PW, default:my-pwUSRE_NAME, default:bearUSRE_PASSWORD, default:bear
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
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
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.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/