https://github.com/kaiyuhou/ubuntu-web-vnc
1.5K
Run Ubuntu Web VNC within Docker with one command!
Credit: based on ConSol 's Version (achieved)
Current TODOs: changelog and TODOs
Features:
xstartup to start desktop session!kaiyhou/ubuntu-web-vnc:
Xfce4 UI session
Run command with mapping to local port 8001 (vnc protocol) and 8002 (vnc web access):
bash run-container.sh [password]
# the latest tigerVNC server only allows localhost connections. So, 8001 cannot be accessd outside localhost.
# in vnc_startup.sh, add "-localhost no" option to vncserver line would diable this setting.
# TODO: add an option in run-container.sh
Build an image from scratch:
# for single arch
bash build-dev.sh
# for multi arch (amd64, arm64) with proper tags
bash build-multi-arch.sh
If the container is started like mentioned above, connect via one of these options:
noVNC HTML5 full client: http://localhost:8002/vnc.html, default password: VNC_PASSWORD
noVNC HTML5 lite client: http://localhost:8002/?password=VNC_PASSWORD
TODO: connect via VNC viewer localhost:8001, default password: VNC_PASSWORD
All images run as non-root user per default, so if you want to extend the image and install software, you have to switch back to the root user:
## Custom Dockerfile
FROM kaiyhou/ubuntu-web-vnc
# Switch to root user to install additional software
USER 0
## Install a gedit
RUN apt-get install -y gedit \
&& apt-get clean all
## switch back to default user
USER ubuntu
0)Add the --user flag to your docker run command:
docker run -it --user 0 ... kaiyhou/ubuntu-web-vnc
Add the --user flag to your docker run command:
docker run -it --user $(id -u):$(id -g) ... kaiyhou/ubuntu-web-vnc
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: 1600x900VNC_PW, default: VNC_PASSWORDSimply overwrite the value of the environment variable VNC_PW. For example in
the docker run command:
docker run -it -e VNC_PW=my-pw ... kaiyhou/ubuntu-web-vnc
Simply overwrite the value of the environment variable VNC_RESOLUTION. For example in
the docker run command:
docker run -it -e VNC_RESOLUTION=800x600 ... kaiyhou/ubuntu-web-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 -e VNC_VIEW_ONLY=true ... kaiyhou/ubuntu-web-vnc
The problem there is the too small /dev/shm size in the container. Except the solution below, we can also use -v /dev/shm:/dev/shm
docker run --shm-size=256m -it VNC_RESOLUTION=1920x1080 ... kaiyhou/ubuntu-web-vnc
At this point we want to thank all contributors, which helped to move this great project by submitting code, writing documentation, or adapting other tools to play well together with the docker headless container.
The current changelog is provided here: changelog.md
Content type
Image
Digest
Size
773.4 MB
Last updated
almost 5 years ago
docker pull kaiyhou/ubuntu-web-vnc