Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VNC not working on HAOS hosts? #149

Open
alexbelgium opened this issue May 30, 2023 · 21 comments
Open

VNC not working on HAOS hosts? #149

alexbelgium opened this issue May 30, 2023 · 21 comments
Labels
can't reproduce help wanted Extra attention is needed

Comments

@alexbelgium
Copy link

alexbelgium commented May 30, 2023

Hi, I'm developing an HomeAssistant addon for your great app here : https://github.com/alexbelgium/hassio-addons/tree/master/free_games_claimer

I've ran into an issue : although it works great on amd64, I can't get the NoVNC webui to show on aarch64. The page just waits idly without any error message nor action until it timeouts.

Things I've tested (running your latest container straight from Portainer with all default settings on two different systems : amd64 virtual machine, and aarch64 rpi4) :

- Starting the addon : works on both systems (see collapsible log)
Xvfb display server created screen with resolution 1280x1280
VNC is running on port 5900 (no password!)
noVNC (VNC via browser) is running on http://localhost:6080
2023-05-30 19:14:18.276 started checking epic-games
  • Accessing webui from outside the container : works on amd64, waits idly on aarch64
  • Doing curl 127.0.0.1:6080 from within the container using a portainer console : works on amd64 (provides a normal response), waits forever on aarch64

Based on this behavior, it conluded the issue is limited to the aarch64 system and is due to the container and not the external docker environment - and therefore wanted to request your help. This does not affect the env variables system that works on both system.

Is there anything else I could do to make it work ?

Thanks !

@vogler
Copy link
Owner

vogler commented May 31, 2023

Works fine for me on aarch64 via https://cloud.oracle.com:

$ uname -a
Linux ubuntu 5.15.0-1029-oracle #35-Ubuntu SMP Tue Jan 24 15:21:05 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
$ docker run --rm -it -p 6080:6080 -v fgc3:/fgc/data --pull=always ghcr.io/vogler/free-games-claimer
latest: Pulling from vogler/free-games-claimer
79d0ea7dc1a8: Already exists
bbc5da6b69f2: Pull complete
b903faaa1cc5: Pull complete
a2e0a116c2fa: Pull complete
311f56e46f21: Pull complete
7b5c54872c4b: Pull complete
44836435d649: Pull complete
3d40588588f1: Pull complete
bedbfb574087: Pull complete
ff2501dc7ea9: Pull complete
Digest: sha256:203de0163d8685637c127cdb1394bb083bca03a9939fea4ba84d30093c5e00ca
Status: Downloaded newer image for ghcr.io/vogler/free-games-claimer:latest
Xvfb display server created screen with resolution 1280x1280
VNC is running on port 5900 (no password!)
noVNC (VNC via browser) is running on http://localhost:6080

2023-05-31 07:40:52.268 started checking epic-games
Not signed in anymore. Please login in the browser or here in the terminal.
Open http://localhost:6080 to login inside the docker container.
Login timeout is 180 seconds!
Press ESC to skip the prompts if you want to login in the browser (not possible in headless mode).
✖ Enter email ·
Waiting for you to login in the browser.
...
$ curl 127.0.0.1:6080
<!DOCTYPE html>
<html>
<head>

    <!--
    noVNC example: lightweight example using minimal UI and features
    Copyright (C) 2012 Joel Martin
    Copyright (C) 2017 Samuel Mannehed for Cendio AB
    noVNC is licensed under the MPL 2.0 (see LICENSE.txt)
    This file is licensed under the 2-Clause BSD license (see LICENSE.txt).

    Connect parameters are provided in query string:
        http://example.com/?host=HOST&port=PORT&encrypt=1
    or the fragment:
        http://example.com/#host=HOST&port=PORT&encrypt=1
    -->
    <title>noVNC</title>
...

What system are you trying to run it on?
You've seen the note in the README that Playwright requires a 64-bit userland (not just kernel)?

@alexbelgium
Copy link
Author

alexbelgium commented May 31, 2023

Hi, thanks for checking that!

I'm using HAos which is a 64-bit os developed by HomeAssistant Home Assistant Operating System (HAOS) is using the Buildroot build system. Buildroot is not a Linux distribution in the classic sense. It provides the infrastructure and build system to build a Linux distribution.

Here is my log :

$ uname -a
Linux 227ccf7d9a4f 6.1.21-v8 #1 SMP PREEMPT Wed May 24 21:11:41 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
$ docker run --rm -it -p 6080:6080 -v fgc3:/fgc/data --pull=always ghcr.io/vogler/free-games-claimer
latest: Pulling from vogler/free-games-claimer
Digest: sha256:203de0163d8685637c127cdb1394bb083bca03a9939fea4ba84d30093c5e00ca
Status: Image is up to date for ghcr.io/vogler/free-games-claimer:latest
Xvfb display server created screen with resolution 1280x1280
VNC is running on port 5900 (no password!)
noVNC (VNC via browser) is running on http://localhost:6080

2023-05-31 09:15:41.549 started checking epic-games
...
$ curl -v 127.0.0.1:6080
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 127.0.0.1:6080...
* Connected to 127.0.0.1 (127.0.0.1) port 6080 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:6080
> User-Agent: curl/8.0.1
> Accept: */*
> 

  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:04 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:06 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:07 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:08 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:09 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:10 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:11 --:--:--     0

and it just waits forever... any ideas? thanks!

Performing other curl -v (such as google.com) works

@vogler
Copy link
Owner

vogler commented May 31, 2023

It's strange that the image behaves differently depending on the host OS, but I don't see any other explanation.
First we should verify that noVNC is the problem:

  1. Does connecting with another VNC client on port 5900 work?
  2. Is the browser launched or does Playwright also have some problem? Check with ps aux | grep firefox while it waits for login.

@alexbelgium
Copy link
Author

alexbelgium commented May 31, 2023

Hi, thanks

  1. VNC doesn't work indeed (I've tested on my amd64 system it works)
  2. here is the log :
ps aux | grep vnc
root         162  0.0  0.0   2884  1308 pts/1    S+   15:28   0:00 grep vnc
ps aux | grep firefox
root         164  0.0  0.0   2884  1316 pts/1    S+   15:29   0:00 grep firefox

Edit : I saw that error when starting vnc are suppressed in the script. I therefore execute sed -i 's|2>/dev/null 1>&2||g' /usr/local/bin/docker-entrypoint.sh before executing /usr/local/bin/docker-entrypoint.sh node prime-gaming and here is the full log below. I don't see errors within.

log here for aarch64 (not working) : Linux 227ccf7d9a4f 6.1.21-v8 #1 SMP PREEMPT Wed May 24 21:11:41 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
Xvfb display server created screen with resolution 1280x1280
31/05/2023 15:40:02 passing arg to libvncserver: -rfbport
31/05/2023 15:40:02 passing arg to libvncserver: 5900
31/05/2023 15:40:02 x11vnc version: 0.9.16 lastmod: 2019-01-05  pid: 126
31/05/2023 15:40:02 Using X display :1
31/05/2023 15:40:02 rootwin: 0x50d reswin: 0x200001 dpy: 0xc2a55cd0
31/05/2023 15:40:02 
31/05/2023 15:40:02 ------------------ USEFUL INFORMATION ------------------
31/05/2023 15:40:02 X DAMAGE available on display, using it for polling hints.
31/05/2023 15:40:02   To disable this behavior use: '-noxdamage'
31/05/2023 15:40:02 
31/05/2023 15:40:02   Most compositing window managers like 'compiz' or 'beryl'
31/05/2023 15:40:02   cause X DAMAGE to fail, and so you may not see any screen
31/05/2023 15:40:02   updates via VNC.  Either disable 'compiz' (recommended) or
31/05/2023 15:40:02   supply the x11vnc '-noxdamage' command line option.
31/05/2023 15:40:02 
31/05/2023 15:40:02 Wireframing: -wireframe mode is in effect for window moves.
31/05/2023 15:40:02   If this yields undesired behavior (poor response, painting
31/05/2023 15:40:02   errors, etc) it may be disabled:
31/05/2023 15:40:02    - use '-nowf' to disable wireframing completely.
31/05/2023 15:40:02    - use '-nowcr' to disable the Copy Rectangle after the
31/05/2023 15:40:02      moved window is released in the new position.
31/05/2023 15:40:02   Also see the -help entry for tuning parameters.
31/05/2023 15:40:02   You can press 3 Alt_L's (Left "Alt" key) in a row to 
31/05/2023 15:40:02   repaint the screen, also see the -fixscreen option for
31/05/2023 15:40:02   periodic repaints.
31/05/2023 15:40:02 
31/05/2023 15:40:02 XFIXES available on display, resetting cursor mode
31/05/2023 15:40:02   to: '-cursor most'.
31/05/2023 15:40:02   to disable this behavior use: '-cursor arrow'
31/05/2023 15:40:02   or '-noxfixes'.
31/05/2023 15:40:02 using XFIXES for cursor drawing.
31/05/2023 15:40:02 GrabServer control via XTEST.
31/05/2023 15:40:02 
31/05/2023 15:40:02 Scroll Detection: -scrollcopyrect mode is in effect to
31/05/2023 15:40:02   use RECORD extension to try to detect scrolling windows
31/05/2023 15:40:02   (induced by either user keystroke or mouse input).
31/05/2023 15:40:02   If this yields undesired behavior (poor response, painting
31/05/2023 15:40:02   errors, etc) it may be disabled via: '-noscr'
31/05/2023 15:40:02   Also see the -help entry for tuning parameters.
31/05/2023 15:40:02   You can press 3 Alt_L's (Left "Alt" key) in a row to 
31/05/2023 15:40:02   repaint the screen, also see the -fixscreen option for
31/05/2023 15:40:02   periodic repaints.
31/05/2023 15:40:02 
31/05/2023 15:40:02 XKEYBOARD: number of keysyms per keycode 7 is greater
31/05/2023 15:40:02   than 4 and 51 keysyms are mapped above 4.
31/05/2023 15:40:02   Automatically switching to -xkb mode.
31/05/2023 15:40:02   If this makes the key mapping worse you can
31/05/2023 15:40:02   disable it with the "-noxkb" option.
31/05/2023 15:40:02   Also, remember "-remap DEAD" for accenting characters.
31/05/2023 15:40:02 
31/05/2023 15:40:02 X FBPM extension not supported.
Xlib:  extension "DPMS" missing on display ":1".
31/05/2023 15:40:02 X display is not capable of DPMS.
31/05/2023 15:40:02 --------------------------------------------------------
31/05/2023 15:40:02 
31/05/2023 15:40:02 Default visual ID: 0x21
31/05/2023 15:40:03 Read initial data from X display into framebuffer.
31/05/2023 15:40:03 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/5120
31/05/2023 15:40:03 
31/05/2023 15:40:03 X display :1 is 32bpp depth=24 true color
31/05/2023 15:40:03 
31/05/2023 15:40:03 Listening for VNC connections on TCP port 5900
31/05/2023 15:40:03 Listening for VNC connections on TCP6 port 5900
31/05/2023 15:40:03 listen6: bind: Address already in use
31/05/2023 15:40:03 Not listening on IPv6 interface.
31/05/2023 15:40:03 
31/05/2023 15:40:03 Xinerama is present and active (e.g. multi-head).
31/05/2023 15:40:03 Xinerama: number of sub-screens: 1
31/05/2023 15:40:03 Xinerama: no blackouts needed (only one sub-screen)
31/05/2023 15:40:03 
31/05/2023 15:40:03 fb read rate: 151 MB/sec
31/05/2023 15:40:03 fast read: reset -wait  ms to: 10
31/05/2023 15:40:03 fast read: reset -defer ms to: 10
31/05/2023 15:40:03 The X server says there are 10 mouse buttons.
31/05/2023 15:40:03 screen setup finished.
31/05/2023 15:40:03 

The VNC desktop is:      db21ed7f-free-games-claimer:0
PORT=5900

******************************************************************************
Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?

The scheme stores pixel data offscreen on the VNC viewer side for faster
retrieval.  It should work with any VNC viewer.  Try it by running:

  x11vnc -ncache 10 ...

One can also add -ncache_cr for smooth 'copyrect' window motion.
More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching

VNC is running on port 5900 (no password!)
noVNC (VNC via browser) is running on http://localhost:6080

WebSocket server settings:
- Listen on :6080
- Web server. Web root: /usr/share/novnc
- No SSL/TLS support (no cert file)
- Backgrounding (daemon)
2023-05-31 15:40:09.778 started checking prime-gaming
log here for amd64 (working) : Linux db21ed7f-free-games-claimer 5.15.90 #1 SMP Tue Jan 24 18:48:18 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Xvfb display server created screen with resolution 1280x1280
31/05/2023 16:30:31 passing arg to libvncserver: -rfbport
31/05/2023 16:30:31 passing arg to libvncserver: 5900
31/05/2023 16:30:31 x11vnc version: 0.9.16 lastmod: 2019-01-05  pid: 128
31/05/2023 16:30:31 Using X display :1
31/05/2023 16:30:31 rootwin: 0x50d reswin: 0x200001 dpy: 0x20e850f0
31/05/2023 16:30:31 
31/05/2023 16:30:31 ------------------ USEFUL INFORMATION ------------------
31/05/2023 16:30:31 X DAMAGE available on display, using it for polling hints.
31/05/2023 16:30:31   To disable this behavior use: '-noxdamage'
31/05/2023 16:30:31 
31/05/2023 16:30:31   Most compositing window managers like 'compiz' or 'beryl'
31/05/2023 16:30:31   cause X DAMAGE to fail, and so you may not see any screen
31/05/2023 16:30:31   updates via VNC.  Either disable 'compiz' (recommended) or
31/05/2023 16:30:31   supply the x11vnc '-noxdamage' command line option.
31/05/2023 16:30:31 
31/05/2023 16:30:31 Wireframing: -wireframe mode is in effect for window moves.
31/05/2023 16:30:31   If this yields undesired behavior (poor response, painting
31/05/2023 16:30:31   errors, etc) it may be disabled:
31/05/2023 16:30:31    - use '-nowf' to disable wireframing completely.
31/05/2023 16:30:31    - use '-nowcr' to disable the Copy Rectangle after the
31/05/2023 16:30:31      moved window is released in the new position.
31/05/2023 16:30:31   Also see the -help entry for tuning parameters.
31/05/2023 16:30:31   You can press 3 Alt_L's (Left "Alt" key) in a row to 
31/05/2023 16:30:31   repaint the screen, also see the -fixscreen option for
31/05/2023 16:30:31   periodic repaints.
31/05/2023 16:30:31 
31/05/2023 16:30:31 XFIXES available on display, resetting cursor mode
31/05/2023 16:30:31   to: '-cursor most'.
31/05/2023 16:30:31   to disable this behavior use: '-cursor arrow'
31/05/2023 16:30:31   or '-noxfixes'.
31/05/2023 16:30:31 using XFIXES for cursor drawing.
31/05/2023 16:30:31 GrabServer control via XTEST.
31/05/2023 16:30:31 
31/05/2023 16:30:31 Scroll Detection: -scrollcopyrect mode is in effect to
31/05/2023 16:30:31   use RECORD extension to try to detect scrolling windows
31/05/2023 16:30:31   (induced by either user keystroke or mouse input).
31/05/2023 16:30:31   If this yields undesired behavior (poor response, painting
31/05/2023 16:30:31   errors, etc) it may be disabled via: '-noscr'
31/05/2023 16:30:31   Also see the -help entry for tuning parameters.
31/05/2023 16:30:31   You can press 3 Alt_L's (Left "Alt" key) in a row to 
31/05/2023 16:30:31   repaint the screen, also see the -fixscreen option for
31/05/2023 16:30:31   periodic repaints.
31/05/2023 16:30:31 
31/05/2023 16:30:31 XKEYBOARD: number of keysyms per keycode 7 is greater
31/05/2023 16:30:31   than 4 and 51 keysyms are mapped above 4.
31/05/2023 16:30:31   Automatically switching to -xkb mode.
31/05/2023 16:30:31   If this makes the key mapping worse you can
31/05/2023 16:30:31   disable it with the "-noxkb" option.
31/05/2023 16:30:31   Also, remember "-remap DEAD" for accenting characters.
31/05/2023 16:30:31 
31/05/2023 16:30:31 X FBPM extension not supported.
Xlib:  extension "DPMS" missing on display ":1".
31/05/2023 16:30:31 X display is not capable of DPMS.
31/05/2023 16:30:31 --------------------------------------------------------
31/05/2023 16:30:31 
31/05/2023 16:30:31 Default visual ID: 0x21
31/05/2023 16:30:31 Read initial data from X display into framebuffer.
31/05/2023 16:30:31 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/5120
31/05/2023 16:30:31 
31/05/2023 16:30:31 X display :1 is 32bpp depth=24 true color
31/05/2023 16:30:31 
31/05/2023 16:30:31 Listening for VNC connections on TCP port 5900
31/05/2023 16:30:31 Listening for VNC connections on TCP6 port 5900
31/05/2023 16:30:31 listen6: bind: Address already in use
31/05/2023 16:30:31 Not listening on IPv6 interface.
31/05/2023 16:30:31 
31/05/2023 16:30:31 Xinerama is present and active (e.g. multi-head).
31/05/2023 16:30:31 Xinerama: number of sub-screens: 1
31/05/2023 16:30:31 Xinerama: no blackouts needed (only one sub-screen)
31/05/2023 16:30:31 
31/05/2023 16:30:31 fb read rate: 2236 MB/sec
31/05/2023 16:30:31 fast read: reset -wait  ms to: 10
31/05/2023 16:30:31 fast read: reset -defer ms to: 10
31/05/2023 16:30:31 The X server says there are 10 mouse buttons.
31/05/2023 16:30:31 screen setup finished.
31/05/2023 16:30:31 

The VNC desktop is:      db21ed7f-free-games-claimer:0
PORT=5900

******************************************************************************
Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?

The scheme stores pixel data offscreen on the VNC viewer side for faster
retrieval.  It should work with any VNC viewer.  Try it by running:

    x11vnc -ncache 10 ...

One can also add -ncache_cr for smooth 'copyrect' window motion.
More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching

VNC is running on port 5900 (no password!)
noVNC (VNC via browser) is running on http://localhost:6080

WebSocket server settings:
  - Listen on :6080
  - Web server. Web root: /usr/share/novnc
  - No SSL/TLS support (no cert file)
  - Backgrounding (daemon)
2023-05-31 16:30:31.360 started checking prime-gaming
Not signed in anymore.
Login timeout is 180 seconds!
Press ESC to skip the prompts if you want to login in the browser (not possible in headless mode).
�[?25l�[36m?�[39m �[1mEnter email�[22m �[2m‣�[22m �[46m�[30m�[30m �[39m�[30m�[39m�[49m�[1D�[?25l�[2K�[1G�[36m?�[39m �[1mEnter email�[22m �[2m‣�[22m u�[46m�[30m�[30m �[39m�[30m�[39m�[49m�[?25h�[?25hnode:events:491
      throw er; // Unhandled 'error' event
      ^

Error: setRawMode EIO
    at ReadStream.setRawMode (node:tty:77:31)
    at [_setRawMode] [as _setRawMode] (node:internal/readline/interface:381:18)
    at Interface.close (node:internal/readline/interface:531:24)
    at ReadStream.ontermend (node:internal/readline/interface:267:10)
    at ReadStream.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on Interface instance at:
    at ReadStream.onerror (node:internal/readline/interface:246:10)
    at ReadStream.emit (node:events:513:28)
    at ReadStream.setRawMode (node:tty:77:10)
    at [_setRawMode] [as _setRawMode] (node:internal/readline/interface:381:18)
    [... lines matching original stack trace ...]
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -5,
  code: 'EIO',
  syscall: 'setRawMode'
}

Node.js v19.9.0
Node.js[133]: ../src/node.cc:678:void node::ResetStdio(): Assertion `!(err != 0) || (err == -1 && (*__errno_location ()) == 1)' failed.
 1: 0xbf9890 node::Abort() [node]
 2: 0xbf990e  [node]
 3: 0xbb3044  [node]
 4: 0x7f8f41025495  [/lib/x86_64-linux-gnu/libc.so.6]
 5: 0x7f8f41025610 on_exit [/lib/x86_64-linux-gnu/libc.so.6]
 6: 0xb30d7a node::DefaultProcessExitHandlerInternal(node::Environment*, node::ExitCode) [node]
 7: 0xb85da3 node::Environment::Exit(node::ExitCode) [node]
 8: 0xbfcdda node::errors::TriggerUncaughtException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>, bool) [node]
 9: 0xbfd2e0 node::errors::PerIsolateMessageListener(v8::Local<v8::Message>, v8::Local<v8::Value>) [node]
10: 0xf64690 v8::internal::MessageHandler::ReportMessageNoExceptions(v8::internal::Isolate*, v8::internal::MessageLocation const*, v8::internal::Handle<v8::internal::Object>, v8::Local<v8::Value>) [node]
11: 0xf648a1 v8::internal::MessageHandler::ReportMessage(v8::internal::Isolate*, v8::internal::MessageLocation const*, v8::internal::Handle<v8::internal::JSMessageObject>) [node]
12: 0xf528b7 v8::internal::Isolate::ReportPendingMessages() [node]
13: 0xf39e28  [node]
14: 0xf3acbf v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [node]
15: 0xdf819c v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [node]
16: 0xb2ad96 node::InternalCallbackScope::Close() [node]
17: 0xb2b109 node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) [node]
18: 0xb3e180 node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [node]
19: 0xce10fb  [node]
20: 0xce36a7 node::EmitToJSStreamListener::OnStreamRead(long, uv_buf_t const&) [node]
21: 0xcebc42 node::LibuvStreamWrap::OnUvRead(long, uv_buf_t const*) [node]
22: 0xcec06b  [node]
23: 0x17a629c  [node]
24: 0x17a6840  [node]
25: 0x17ac5e4  [node]
26: 0x179aa0e uv_run [node]
27: 0xb2bbad node::SpinEventLoopInternal(node::Environment*) [node]
28: 0xc3ffc4 node::NodeMainInstance::Run() [node]
29: 0xbb3ceb node::LoadSnapshotDataAndRun(node::SnapshotData const**, node::InitializationResultImpl const*) [node]
30: 0xbb7a29 node::Start(int, char**) [node]
31: 0x7f8f41009d90  [/lib/x86_64-linux-gnu/libc.so.6]
32: 0x7f8f41009e40 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
33: 0xb2950e _start [node]

@viny182
Copy link

viny182 commented May 31, 2023

Hello,

I'm with the same issue, but using HAOS 10.2 (latest) on the (amd64 / generic-x86-64) platform, which is indeed a working platform for @alexbelgium .

The only difference I have is that this is a physical machine, instead of a VM amd64.

Let me know if I could help to debug this in anyway...

Edit: direct VNC is not reachable on :5900 port, so noVNC is also not reachable trough browser on :6080 port.

@viny182
Copy link

viny182 commented May 31, 2023

update: after insisting a lot to connect trough VNC direct client on port:5900 I was able to connect after pressing connect button several times on my VNC Client! However, it was already on one of the later stages, during the GOG login, so I have missed the login for Epic and Prime...

@vogler
Copy link
Owner

vogler commented May 31, 2023

Removed the times in your logs and diffed (a: aarch64, b: amd64):
image
The framebuffer read rate is almost 15x faster on your amd64 (and there's strangely some more indentation).

Don't know if that is the issue, but it's the only difference I see.

Didn't find an issue for VNC or xvfb on https://github.com/home-assistant/operating-system.

What hardware is it? Would be helpful to compare the same hardware with different host OS in order to verify that the issue is HAOS (maybe some missing kernel module?).

@vogler vogler changed the title Is NoVNC working on aarch64 ? VNC not working on HAOS hosts? May 31, 2023
@vogler vogler added help wanted Extra attention is needed can't reproduce labels May 31, 2023
@viny182
Copy link

viny182 commented May 31, 2023

@vogler , I believe you are on the right track!

I have a amd64 machine, but it is indeed very old... It's a laptop with an AMD C-60 CPU with 2 cores @ 1ghz and 8gb Ram.

I notice that the add-on consumes 100% of CPU after start for up to 10 minutes, and then it decreases during time...

When CPU is high, I'm not able to connect to VNC, but the connection is not closed, it keeps "loading"...

I managed to connect to VNC 2 times, but it was only after the GOG started... In my case, I'm starting first the Epic node, then the Prime and lastly the GOG node.... Perhaps the CPU usage was low during GOG, but I have not checked.

However, when I managed to access it trough VNC, the performance was pretty well! Mouse and keyboard had good response, so maybe the start up process is what is creating the heavy load...

@vogler
Copy link
Owner

vogler commented May 31, 2023

Every script starts Firefox and loads the respective website. Due to how the websites are built (lots of JS and images), I'm not surprised about high load on a 1GHz CPU. Still, I think it should be done in some minutes and then quit, such that it's fine to run e.g. every night.

I think the issue is just the slow frame buffer read rate which is already logged before any browser is started.
Crude approximation: 3B*1280*1280*30fps/1024/1024 = 140.625MB/s.
Not sure if it needs to read it that much but it's close to the reported 151MB/s.

@viny182
Copy link

viny182 commented May 31, 2023

Yes, I agree the JS creates a high load on the CPU...

But is still strange taking that time...

For example, there is this other standalone firefox HA addon https://github.com/mincka/ha-addons/tree/main/firefox that is based on this docker image https://github.com/jlesage/docker-firefox with a similar approach with VNC.

In the same 1ghz cpu it opens in seconds, and I'm able to load the epicgames and login just like if I was in a native browser, from both VCN direct connection, and trough the browser... not sure if they use noVNC as proxy, I'm not that expert...

@viny182
Copy link

viny182 commented May 31, 2023

this is the load for the Firefox addon I mentioned above ^

image

@vogler
Copy link
Owner

vogler commented May 31, 2023

I checked this image out in #68, mainly due to its reduced size.
It's using TigerVNC (instead of x11vnc) and noVNC (with some custom styling):
https://github.com/jlesage/docker-baseimage-gui/blob/a246245ad6e7a76a0083fb2218faa15f8b5d870b/Dockerfile#L39-L49
However, Playwright has no support for Alpine Linux on which the image is based.

You can edit Dockerfile to install tigervnc-standalone-server instead of x11vnc and edit docker-entrypoint.sh to start it. However, I don't expect another VNC server to be much faster for an intranet connection.

It's hard to compare loads of manually visiting a page in an already running Firefox vs. a script starting a new Firefox and immediately automating actions in it.

@alexbelgium
Copy link
Author

Update : actually VNC connects on aarch64 but only after several hours (around 6h). I've tried checking if arguments for Xvfb or x11vnc can help to improve read rate but without success for the moment.

I'll try your proposal with tigervnc - thanks

@vogler
Copy link
Owner

vogler commented Jun 1, 2023

Is just VNC a problem or is the rest also slow?
VNC is not really needed for normal usage since you can login via the terminal.
You can use RECORD=1 to record a video of what the browser is doing.
Running DRYRUN=1 node epic-games takes ~8s for me on a MBA, via docker a few seconds longer.

@vogler
Copy link
Owner

vogler commented Jul 13, 2023

Any update on this?

@vogler
Copy link
Owner

vogler commented Jul 20, 2023

To clarify if the issue is with the image or the host, you could check if VNC is also slow using these images (both using noVNC):

@alexbelgium
Copy link
Author

alexbelgium commented Jul 22, 2023

Hi, thanks very much.

Test system : rpi4 aarch64 HAos 8gb ram

Docker-firefox :

  • Command docker run -d --name=firefox -p 5800:5800 -v /docker/appdata/firefox:/config:rw jlesage/firefox
  • Results : instantaneous connection on localip:5800
log - click this
[cont-env    ] TAKE_CONFIG_OWNERSHIP: loading...
[cont-env    ] XDG_CACHE_HOME: loading...
[cont-env    ] XDG_CONFIG_HOME: loading...
[cont-env    ] XDG_DATA_HOME: loading...
[cont-env    ] XDG_RUNTIME_DIR: loading...
[cont-env    ] XDG_STATE_HOME: loading...
[cont-env    ] container environment variables initialized.
[cont-secrets] loading container secrets...
[cont-secrets] container secrets loaded.
[cont-init   ] executing container initialization scripts...
[cont-init   ] 10-certs.sh: executing...
[cont-init   ] 10-certs.sh: terminated successfully.
[cont-init   ] 10-check-app-niceness.sh: executing...
[cont-init   ] 10-check-app-niceness.sh: terminated successfully.
[cont-init   ] 10-cjk-font.sh: executing...
[cont-init   ] 10-cjk-font.sh: terminated successfully.
[cont-init   ] 10-clean-logmonitor-states.sh: executing...
[cont-init   ] 10-clean-logmonitor-states.sh: terminated successfully.
[cont-init   ] 10-clean-tmp-dir.sh: executing...
[cont-init   ] 10-clean-tmp-dir.sh: terminated successfully.
[cont-init   ] 10-fontconfig-cache-dir.sh: executing...
[cont-init   ] 10-fontconfig-cache-dir.sh: terminated successfully.
[cont-init   ] 10-init-users.sh: executing...
[cont-init   ] 10-init-users.sh: terminated successfully.
[cont-init   ] 10-nginx.sh: executing...
[cont-init   ] 10-nginx.sh: terminated successfully.
[cont-init   ] 10-openbox.sh: executing...
[cont-init   ] 10-openbox.sh: terminated successfully.
[cont-init   ] 10-set-tmp-dir-perms.sh: executing...
[cont-init   ] 10-set-tmp-dir-perms.sh: terminated successfully.
[cont-init   ] 10-vnc-password.sh: executing...
[cont-init   ] 10-vnc-password.sh: terminated successfully.
[cont-init   ] 10-web-data.sh: executing...
[cont-init   ] 10-web-data.sh: terminated successfully.
[cont-init   ] 10-x11-unix.sh: executing...
[cont-init   ] 10-x11-unix.sh: terminated successfully.
[cont-init   ] 10-xdg-runtime-dir.sh: executing...
[cont-init   ] 10-xdg-runtime-dir.sh: terminated successfully.
[cont-init   ] 15-install-pkgs.sh: executing...
[cont-init   ] 15-install-pkgs.sh: terminated successfully.
[cont-init   ] 55-check-snd.sh: executing...
[cont-init   ] 55-check-snd.sh: sound not supported: device /dev/snd not exposed to the container.
[cont-init   ] 55-check-snd.sh: terminated successfully.
[cont-init   ] 55-firefox.sh: executing...
[cont-init   ] 55-firefox.sh: generating machine-id...
[cont-init   ] 55-firefox.sh: terminated successfully.
[cont-init   ] 56-firefox-set-prefs-from-env.sh: executing...
[cont-init   ] 56-firefox-set-prefs-from-env.sh: terminated successfully.
[cont-init   ] 85-take-config-ownership.sh: executing...
[cont-init   ] 85-take-config-ownership.sh: terminated successfully.
[cont-init   ] 89-info.sh: executing...
    ╭――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――╮
    │                                                                      │
    │ Application:           Firefox                                       │
    │ Application Version:   114.0.2-r0                                    │
    │ Docker Image Version:  23.06.1                                       │
    │ Docker Image Platform: linux/arm64                                   │
    │                                                                      │
    ╰――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――╯
[cont-init   ] 89-info.sh: terminated successfully.
[cont-init   ] all container initialization scripts executed.
[init        ] giving control to process supervisor.
[supervisor  ] loading services...
[supervisor  ] loading service 'default'...
[supervisor  ] loading service 'logmonitor'...
[supervisor  ] service 'logmonitor' is disabled.
[supervisor  ] loading service 'app'...
[supervisor  ] loading service 'gui'...
[supervisor  ] loading service 'certsmonitor'...
[supervisor  ] service 'certsmonitor' is disabled.
[supervisor  ] loading service 'openbox'...
[supervisor  ] loading service 'xvnc'...
[supervisor  ] loading service 'nginx'...
[supervisor  ] loading service 'logrotate'...
[supervisor  ] all services loaded.
[supervisor  ] starting services...
[supervisor  ] starting service 'xvnc'...
[xvnc        ] Xvnc TigerVNC 1.13.1 - built May 16 2023 17:54:35
[xvnc        ] Copyright (C) 1999-2022 TigerVNC Team and many others (see README.rst)
[xvnc        ] See https://www.tigervnc.org for information on TigerVNC.
[xvnc        ] Underlying X server release 12014000
[xvnc        ] Sat Jul 22 07:27:07 2023
[xvnc        ]  vncext:      VNC extension running!
[xvnc        ]  vncext:      Listening for VNC connections on /tmp/vnc.sock (mode 0660)
[xvnc        ]  vncext:      Listening for VNC connections on all interface(s), port 5900
[xvnc        ]  vncext:      created VNC server for screen 0
[supervisor  ] starting service 'openbox'...
[supervisor  ] starting service 'nginx'...
[nginx       ] Listening for HTTP connections on port 5800.
[xvnc        ] Sat Jul 22 07:27:09 2023
[xvnc        ]  Connections: accepted: /tmp/vnc.sock
[xvnc        ]  SConnection: Client needs protocol version 3.8
[xvnc        ]  SConnection: Client requests security type None(1)
[xvnc        ]  VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888
[xvnc        ]  VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian bgr888
[xvnc        ]  ComparingUpdateTracker: 0 pixels in / 0 pixels out
[xvnc        ]  ComparingUpdateTracker: (1:nan ratio)
[supervisor  ] starting service 'app'...
[app         ] Mozilla Firefox 114.0.2
[supervisor  ] all services started.

Docker-ubuntu-vnc-desktop

  • no aarch64 image

Free-games-claimer

  • Command docker run --rm -it -p 6080:6080 --pull=always ghcr.io/vogler/free-games-claimer
  • Results : no connection on localip:6080
  • Feedback received from users is that the app works normally - only the noVNC part doesn't
log - click this
Xvfb display server created screen with resolution 1280x1280
VNC is running on port 5900 (no password!)
noVNC (VNC via browser) is running on http://localhost:6080

2023-07-22 07:35:49.863 started checking epic-games
Not signed in anymore. Please login in the browser or here in the terminal.
Open http://localhost:6080 to login inside the docker container.
Login timeout is 180 seconds!
Press ESC to skip the prompts if you want to login in the browser (not possible in headless mode).

@KazemaRyukuro
Copy link

KazemaRyukuro commented Dec 18, 2023

I can't connect to VNC using RealVNC and noVNC doesn't work either.
the browser loads endlessly when I try noVNC and VNC using RealVNC also loads endlessly until the Addon stops.

@vogler
Copy link
Owner

vogler commented Dec 18, 2023

Yea, it's an issue with HAOS, not the used VNC client.

@yoshimo
Copy link

yoshimo commented Dec 22, 2023

What can we do about it? HAOS does get regular updates so it should be possible to solve this.

@vogler
Copy link
Owner

vogler commented Dec 23, 2023

@yoshimo

  1. check VNC not working on HAOS hosts? #149 (comment)
  2. open issue on HAOS

It's still open if the issue is Ubuntu or the VNC server in combination with HAOS.

We can't use Alpine as a base since Playwright doesn't support it.

We could try tigervnc instead of x11vnc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can't reproduce help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants