Code Monkey home page Code Monkey logo

headless-drawing-g3's Introduction

Headless Ubuntu/Xfce containers with VNC/noVNC for diagramming, image editing and 2D/3D drawing

Project accetto/headless-drawing-g3

Version: G3v5


User Guide - Docker Hub - Changelog - sibling Wiki - sibling Discussions

badge-github-release badge-github-release-date badge-github-stars badge-github-forks badge-github-open-issues badge-github-closed-issues badge-github-releases badge-github-commits badge-github-last-commit


Introduction

This GitHub repository contains resources and tools for building Docker images for headless working.

The images are based on Ubuntu 22.04 LTS and include Xfce desktop, TigerVNC server and noVNC client. The popular web browsers Chromium and Firefox are also included.

The image family provides also selected applications for headless drawing, graphics and modelling.

The generic images and some application images include Mesa3D libraries and VirtualGL toolkit, supporting OpenGL, OpenGL ES, WebGL and other APIs for 3D graphics. They also include the OpenGL test applications glxgears, es2tri and the OpenGL benchmark glmark2.

This User guide describes the images and how to use them.

The content of this GitHub project is intended for developers and image builders.

Ordinary users can simply use the images available in the following repositories on Docker Hub:

There is also a sibling project accetto/ubuntu-vnc-xfce-g3 containing similar images based on Ubuntu 22.04 LTS and 20.04 LTS.

Another sibling project accetto/headless-coding-g3 contains images for headless programming.

Building images

You can execute the individual hook scripts in the folder /docker/hooks/. However, the provided utilities are more convenient.

The script builder.sh builds individual images. The script ci-builder.sh can build various groups of images or all of them at once.

Before building the images you have to prepare and source the file secrets.rc (see example-secrets.rc).

Features that are enabled by default can be explicitly disabled via environment variables. This allows building even smaller images by excluding the individual features (e.g. noVNC).

The resources for building the individual images and their variations (tags) are in the subfolders of the /docker/ folder.

The individual README files contain quick examples of building the images:

Each image also has a separate README file intended for Docker Hub. The final files should be generated by the utility util-readme.sh and then copied to Docker Hub manually.

The following resources describe the image building subject in details:

Image generations

This is the third generation (G3) of my headless images. The second generation (G2) contains the GitHub repository accetto/xubuntu-vnc-novnc. The first generation (G1) contains the GitHub repository accetto/ubuntu-vnc-xfce.

Project versions

This file describes the fifth version (G3v5) of the project.

Remark: The version number G3v4 has been skipped, to align the numbering with the sibling project accetto/ubuntu-vnc-xfce-g3.

The second version (G3v2) and the first version (G3v1, or simply G3) will still be available in this GitHub repository as the branches archived-generation-g3v2 and archived-generation-g3v1. The third version (G3v3) was not archived, because the changes are minor.

The version G3v5 brings only one significant change comparing to the previous version G3v4:

  • The updated script set_user_permissions.sh, which is part of Dockerfiles, skips the hidden files and directories now. It generally should not have any unwanted side effects, but it may make a difference in some scenarios, hence the version increase.

The version G3v3 has brought the following major changes comparing to the previous version G3v2:

  • The updated startup scripts that support overriding the user ID (id) and group ID (gid) without needing the former build argument ARG_FEATURES_USER_GROUP_OVERRIDE, which has been removed.
  • The user ID and the group ID can be overridden during the build time (docker build) and the run time (docker run).
  • The user name, the group name and the initial sudo password can be overridden during the build time.
  • The permissions of the files /etc/passwd and /etc/groups are set to the standard 644 after creating the user.
  • The content of the home folder and the startup folder belongs to the created user.
  • The created user gets permissions to use sudo. The initial sudo password is configurable during the build time using the build argument ARG_SUDO_INITIAL_PW. The password can be changed inside the container.
  • The default id:gid has been changed from 1001:0 to 1000:1000.
  • Features NOVNC and FIREFOX_PLUS, that are enabled by default, can be disabled via environment variables.
  • If FEATURES_NOVNC="0", then
    • image will not include noVNC
    • image tag will get the -vnc suffix (e.g. latest-vnc etc.)
  • If FEATURES_FIREFOX_PLUS="0" and FEATURES_FIREFOX="1", then
    • image with Firefox will not include the Firefox Plus features
    • image tag will get the -default suffix (e.g. latest-firefox-default or also latest-firefox-default-vnc etc.)
  • The images are based on Ubuntu 22.04 LTS (formerly on Ubuntu 20.04 LTS).

The version G3v2 has brought the following major changes comparing to the previous version G3v1:

  • Significantly improved building performance by introducing a local cache (g3-cache).
  • Auto-building on the Docker Hub and using of the GitHub Actions have been abandoned.
  • The enhanced building pipeline moves towards building the images outside the Docker Hub and aims to support also stages with CI/CD capabilities (e.g. the GitLab).
  • The local stage is the default building stage now. However, the new building pipeline has already been tested also with a local GitLab installation in a Docker container on a Linux machine.
  • Automatic publishing of README files to the Docker Hub has been removed, because it was not working properly any more. However, the README files for the Docker Hub can still be prepared with the provided utility util-readme.sh and then copy-and-pasted to the Docker Hub manually.

The changes affect only the building pipeline, not the Docker images themselves. The Dockerfile, apart from using the new local g3-cache, stays conceptually unchanged.

Please refer to the sibling project to learn more about the older project versions.

Project goals

Please refer to the sibling project to learn more about the project goals.

Project features

Please refer to the sibling project to learn more about the project features.

Getting help

If you have found a problem or you just have a question, please check the User guide, Issues and the sibling Wiki first. Please do not overlook the closed issues.

If you do not find a solution, you can file a new issue. The better you describe the problem, the bigger the chance it'll be solved soon.

If you have a question or an idea and you don't want to open an issue, you can use the sibling Discussions.

Credits

Credit goes to all the countless people and companies, who contribute to open source community and make so many dreamy things real.


headless-drawing-g3's People

Contributors

accetto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

headless-drawing-g3's Issues

inkscape not working on unraid server

Hi,
using Unraid.
Installed via apps, setup ports, and docker is started OK. I can login to VNC session and I get XFCE desktop OK.
Trying to run Inkscape I get no response and application does not start.
When I run Version sticker I get:
Wait...
FEATURES_BUILD_SLIM_INKSCAPE=1
FEATURES_BUILD_SLIM_NOVNC=1
FEATURES_BUILD_SLIM_TOOLS=1
FEATURES_BUILD_SLIM_XFCE=1
FEATURES_BUILD_SLIM_XSERVER=1
FEATURES_INKSCAPE=1
FEATURES_NOVNC=1
FEATURES_SCREENSHOOTING=1
FEATURES_THUMBNAILING=1
FEATURES_USER_GROUP_OVERRIDE=
FEATURES_VERSION_STICKER=1
FEATURES_VNC=1
gpg 2.2.19
jq 1.6
Mousepad 0.4.2
nano 4.8
noVNC 1.2.0
Ristretto 0.10.0
Screenshooter 1.9.7
TigerVNC 1.11.0
Ubuntu 20.04.3
websockify 0.9.0
Press ENTER...

I also tried inkscape docker container (without ubuntu...), which works OK, but is outdated.
Best regards.

vglrun no respondence

I met the same problem as described in Container doesn't start with volume .X11-unix:rw.
I follow your advice, manually change the DISPLAY:

docker run -it --rm \
    --device /dev/dri/card0 \
    -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
    -e DISPLAY=:2 \
    -p "35000:5901" \
    -p "35001:6901" \
    -e VNC_PW="" \
    accetto/ubuntu-vnc-xfce-opengl-g3:latest --tail-vnc

After that, I run the command vglrun glmark2, no correspondence.

Then I run the command vglrun -d :2 glmark2, but error occurred like below:

=======================================================
    glmark2 2021.02
=======================================================
    OpenGL Information
    GL_VENDOR:     Mesa/X.org
    GL_RENDERER:   llvmpipe (LLVM 12.0.0, 256 bits)
    GL_VERSION:    3.1 Mesa 21.2.6
=======================================================
[build] use-vbo=false:X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  131 (MIT-SHM)
  Minor opcode of failed request:  3 (X_ShmPutImage)
  Serial number of failed request:  43
  Current serial number in output stream:  44

However, vglrun -d :2 glxgears look like good, and no error reported, but it's slower:

headless@2ba116776775:~$ glxgears
11525 frames in 5.0 seconds = 2304.955 FPS
11898 frames in 5.0 seconds = 2379.447 FPS
X connection to :2.0 broken (explicit kill or server shutdown).
headless@2ba116776775:~$ vglrun -d :2 glxgears
4714 frames in 5.0 seconds = 942.387 FPS
4937 frames in 5.0 seconds = 987.321 FPS
[VGL] ERROR: in readback--
[VGL]    269: Window has been deleted by window manager
headless@2ba116776775:~$ 

Container doesn't start with volume .X11-unix:rw

Hello,

I wanted to use the vnc-novnc-mesa-vgl image. It is exactly what I need.

I need the hardware acceleration so used the related command from the dockerhub page (to start the container and share the X11 socket of the host):

xhost +local:$(whoami)

docker run -it -P --rm \
    --device /dev/dri/card0 \
    -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
    accetto/ubuntu-vnc-xfce-opengl-g3:vnc-novnc-mesa-vgl

xhost -local:$(whoami)

However, the container does not start if I pass the " -v /tmp/.X11-unix:/tmp/.X11-unix:rw " parameter.


-The docker logs command returns empty.
-I have an Nvidia card with the appropriate driver installed on the host:

nvidia-smi

Fri Feb 18 19:10:34 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 510.47.03    Driver Version: 510.47.03    CUDA Version: 11.6     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   48C    P0    22W /  N/A |    528MiB /  6144MiB |      3%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      2552      G   /usr/lib/xorg/Xorg                359MiB |
|    0   N/A  N/A      2785      G   /usr/bin/gnome-shell               67MiB |
|    0   N/A  N/A      4506      G   ...AAAAAAAAA= --shared-files       39MiB |
|    0   N/A  N/A      4769      G   ...AAAAAAAAA= --shared-files       34MiB |
|    0   N/A  N/A     17605      G   ...AAAAAAAAA= --shared-files       21MiB |
|    0   N/A  N/A     41321      G   /usr/lib/firefox/firefox            1MiB |
+-----------------------------------------------------------------------------+

-I'm using Ubuntu 20 LTS with gnome (gdm 3).
-Docker version:20.10.12, build e91ed57
-The path: /tmp/.X11-unix:/tmp/.X11-unix exist it contains 1 file:
srwxrwxrwx 1 krisztian krisztian 0 Feb 18 11:25 X1=
-Tried to execute the docker command with sudo. (same result)
-echo $DISPLAY :1

-If I don't pass that parameter the container starts but it says:

 vglrun glmark2 
[VGL] ERROR: Could not open display :0.

Is there anything I can try/or need to check?

accetto/ubuntu-vnc-xfce-opengl-g3:latest After startup, the screen is black and the mouse cannot see it

image

After startup, the screen is black and the mouse cannot see it, Dockerfile see below @accetto

services:
  unciv:
    environment:
      VNC_RESOLUTION: 1920x1080
    image: accetto/ubuntu-vnc-xfce-opengl-g3
    ports:
    - published: 6901
      target: 6901
version: '2'
  • run top in container, output below, some program not startup ?
Tasks:  13 total,   1 running,  12 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  1.6 sy,  0.0 ni, 98.4 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :   3931.2 total,    625.7 free,    420.3 used,   2885.3 buff/cache
MiB Swap:   1024.0 total,   1022.2 free,      1.8 used.   3231.8 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                
      1 headless  20   0    2776    948    864 S   0.0   0.0   0:00.07 tini                                                                                   
      7 headless  20   0    4616   3576   3000 S   0.0   0.1   0:00.01 startup.sh                                                                             
     33 headless  20   0    4432   1364   1200 S   0.0   0.0   0:00.03 xinit                                                                                  
     34 headless  20   0    4484   3404   3076 S   0.0   0.1   0:00.01 bash                                                                                   
     42 headless  20   0   53684  34360  14928 S   0.0   0.9   0:00.46 python3                                                                                
     48 headless  20   0   48148  31108  10856 S   0.0   0.8   0:00.16 Xvnc                                                                                   
     51 headless  20   0  435948  71704  59064 S   0.0   1.8   0:00.17 xfce4-session                                                                          
     83 headless  20   0    8160   2304   1892 S   0.0   0.1   0:00.00 dbus-launch                                                                            
     84 headless  20   0    7980   2460   2120 S   0.0   0.1   0:00.00 dbus-daemon                                                                            
    107 headless  20   0  230724   6004   5448 S   0.0   0.1   0:00.00 xfconfd                                                                                
    129 headless  20   0   53684  25468   6000 S   0.0   0.6   0:00.25 python3                                                                                
    130 headless  20   0    4616   3584   3180 S   0.0   0.1   0:00.04 bash                                                                                   
    138 headless  20   0    7308   3392   2832 R   0.0   0.1   0:00.00 top 

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.