accetto / headless-drawing-g3

Headless Ubuntu/Xfce containers with VNC/noVNC for diagramming, image editing and 2D/3D drawing (G3v5)
MIT License
29 stars 3 forks source link

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

Closed qyvlik closed 1 year ago

qyvlik commented 1 year ago
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'
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 
accetto commented 1 year ago

Hello @qyvlik,

the most probable reason for your problem is the binding to the TCP port 6901 on the host.

Generally I recommend to avoid binding to the default ports on the host, because they are often already in use.

Choose some higher port range of free ports, for example:

services:
  unciv:
    environment:
      VNC_RESOLUTION: 1920x1080
    image: accetto/ubuntu-vnc-xfce-opengl-g3
    ports:
      - "36901:6901"

Note also that you should enclose the port numbers in quotes.

Regards, accetto

qyvlik commented 1 year ago

@accetto I am very certain that port 6901 is not being used. Screen is black mean the xfce desktop incomplete startup.

I'm not sure if it's a problem with noVNC or xfce.

If you start a Java game using OpenGL base accetto/ubuntu-vnc-xfce-opengl-g3:latest, the screen can display the graphics of the Java game normally, but there is no mouse.

accetto commented 1 year ago

Have you tested it with the other port according my recommendation above?

qyvlik commented 1 year ago

@accetto Yes, I try the 36901 port, also black screen, the xfce desktop not startup.

version: '2.0'
services:
  unciv:
    environment:
      VNC_RESOLUTION: 1920x1080
    image: accetto/ubuntu-vnc-xfce-opengl-g3
    ports:
      - "36901:6901"
image image
accetto commented 1 year ago

That's interesting. Unfortunately I'm not able to reproduce the behaviour. It's working on all my testing environments.

Do you get the same behaviour if you try it with the localhost IP?

ports:
      - "127.0.0.1:36901:6901"

and then http://127.0.0.1:36901.

What do you get if you connect to the running container and execute the following tests?

# connect to the container
docker exec <your-container-name> bash

# and then
pstree

# and also (assuming you're in $HOME)
./tests/test-01.sh

Can you describe your environment?

qyvlik commented 1 year ago

Hello @accetto

environment

My environment see below

image

dockerfile

services:
  unciv:
    image: accetto/ubuntu-vnc-xfce-opengl-g3
    ports:
      - "36901:6901"

version: '2'

pstree

run pstree in container, output as below

tini-+-dbus-daemon
     |-dbus-launch
     |-startup.sh-+-bash---python3
     |            `-xinit-+-Xvnc
     |                    `-xfce4-session---2*[{xfce4-session}]
     `-xfconfd---2*[{xfconfd}]

./tests/test-01.sh

run ./tests/test-01.sh in container, output as below

+ id
uid=1000(headless) gid=1000(headless) groups=1000(headless)
+ ls -l /etc/passwd /etc/group
-rw-r--r-- 1 root root  481 Apr 25 00:58 /etc/group
-rw-r--r-- 1 root root 1029 Mar 24 12:44 /etc/passwd
+ tail -n2 /etc/passwd
messagebus:x:101:101::/nonexistent:/usr/sbin/nologin
headless:x:1000:1000:Default:/home/headless:/bin/bash
+ tail -n2 /etc/group
messagebus:x:101:
headless:x:1000:
+ ls -ld /dockerstartup /home /home/headless
drwxr-xr-x 1 headless headless 4096 Apr 25 00:58 /dockerstartup
drwxr-xr-x 1 root     root     4096 Mar 24 12:43 /home
drwxr-xr-x 1 headless headless 4096 Apr 25 01:10 /home/headless
+ ls -l /dockerstartup
total 60
-rw-r--r-- 1 headless headless 3090 Mar 18  2021 help.rc
-rw-r--r-- 1 headless headless  445 Apr 25 00:58 novnc.log
-rw-r--r-- 1 headless headless 6721 Mar 18  2021 parser.rc
-rwxr--r-- 1 headless headless  872 Mar 12 17:30 set_user_permissions.sh
-rwxr-xr-x 1 headless headless 4778 Mar 24 12:38 startup.sh
-rw-r--r-- 1 headless headless 4010 Mar 24 12:38 user_generator.rc
-rwxr--r-- 1 headless headless 6207 Mar 12 17:30 version_of.sh
-rwxr--r-- 1 headless headless 5872 Mar 12 17:30 version_sticker.sh
-rw-r--r-- 1 headless headless  910 Apr 25 00:58 vnc.log
-rw-r--r-- 1 headless headless 4958 Nov  6 18:05 vnc_startup.rc
+ mkdir -p /home/headless/new-dir
+ touch /home/headless/new-file
+ ls -l /home/headless
total 56
drwxr-xr-x 1 headless headless 4096 Mar 24 12:44 Desktop
drwxr-xr-x 2 headless headless 4096 Apr 25 00:58 Documents
drwxr-xr-x 2 headless headless 4096 Apr 25 00:58 Downloads
drwxr-xr-x 2 headless headless 4096 Apr 25 00:58 Music
drwxr-xr-x 2 headless headless 4096 Apr 25 00:58 Pictures
drwxr-xr-x 2 headless headless 4096 Apr 25 00:58 Public
drwxr-xr-x 2 headless headless 4096 Apr 25 00:58 Templates
drwxr-xr-x 2 headless headless 4096 Apr 25 00:58 Videos
drwxr-xr-x 2 headless headless 4096 Apr 25 00:58 new-dir
-rw-r--r-- 1 headless headless    0 Apr 25 01:17 new-file
-rw-r--r-- 1 headless headless  185 Mar 18  2021 readme.md
-rw-r--r-- 1 headless headless 1364 Apr 25 01:17 test-01.log
drwxr-xr-x 1 headless headless 4096 Mar 24 12:44 tests

My thoughts

  1. My VM is Ubuntu Server 20.04 LTS, the accetto/ubuntu-vnc-xfce-opengl-g3:latest is base Ubuntu 22.04 LTS(for now), so the container not work in my VM(I guess so, I will try Ubuntu Server 22.04 to run the docker image).

  2. Which tag of accetto/ubuntu-vnc-xfce-opengl-g3 can work on my VM (Ubuntu Server 20.04)?

    • Because of the tags of accetto/ubuntu-vnc-xfce-opengl-g3 only have latest, firefox, chromium, These images are all based on ubuntu 22.04.
    • I need the docker image which base on Ubuntu 20.04, can you keep all historical images in docker hub?
qyvlik commented 1 year ago

@accetto

I restart a new VM which system is Ubuntu Server 22.04, now the accetto/ubuntu-vnc-xfce-opengl-g3:latest can work, the xfce desktop startup.

image

pstree

run pstree in container

tini-+-dbus-daemon
     |-dbus-launch
     |-dconf-service---2*[{dconf-service}]
     |-gpg-agent
     |-startup.sh-+-bash---python3
     |            `-xinit-+-Xvnc
     |                    `-xfce4-session-+-Thunar---2*[{Thunar}]
     |                                    |-xfce4-panel-+-panel-14-action---2*[{panel-14-action}]
     |                                    |             |-panel-6-systray---2*[{panel-6-systray}]
     |                                    |             |-panel-8-pulseau---2*[{panel-8-pulseau}]
     |                                    |             |-xfce4-appfinder---2*[{xfce4-appfinder}]
     |                                    |             `-2*[{xfce4-panel}]
     |                                    |-xfdesktop---2*[{xfdesktop}]
     |                                    |-xfsettingsd---2*[{xfsettingsd}]
     |                                    |-xfwm4---2*[{xfwm4}]
     |                                    `-2*[{xfce4-session}]
     `-xfconfd---2*[{xfconfd}]

recommendation

  1. keep all historical images in docker hub or keep the 20.04 and 22.04.
    1. accetto/ubuntu-vnc-xfce-opengl-g3:jammy (ubuntu server 22.04)
    2. accetto/ubuntu-vnc-xfce-opengl-g3:focal (ubuntu server 20.04)
accetto commented 1 year ago

Hello @qyvlik ,

I appreciate your work and I'm really glad, that you've got it running. Your environment is pretty interesting and not trivial. :)

From the data we can see, that the Xfce4 was not completely initialized in the first case. I never tested such a scenario, so I'll not speculate about the reason.

Maybe you've already noticed, but I've published the previous images for you. Please go to the repository accetto/ubuntu-vnc-xfce-opengl-g3 and look for the 20.04 tags.

I've built the images from the archived branch archived-generation-g3v2. You can do it also yourself any time you wish.

I find your proposal interesting, but I'm not sure, if I'll get the previous images back to the project. Each image variation brings also some overhead (like Dockerfiles, more comples scripts and Readme files etc.) and I'm already having pretty hard time to maintain all the images I have. Maybe I could do it just for the opengl image in this project. I have to think about it.

Regards, accetto

qyvlik commented 1 year ago

Hello @accetto, Thank you very much for your efforts and contributions !

Docker image qyvlik/yairm210-unciv:4.6.7-focal now run on Ubuntu Server 20.04!

image

Maintaining multiple versions of docker images is a headache. Maybe you can try linuxserver/docker-mods.

accetto commented 1 year ago

Closing as solved.