fcwu / docker-ubuntu-vnc-desktop

A Docker image to provide web VNC interface to access Ubuntu LXDE/LxQT desktop environment.
Apache License 2.0
3.97k stars 1.44k forks source link

Chrome and Chromium won't launch #205

Open ghost opened 4 years ago

ghost commented 4 years ago

Describe the bug Both Chrome and Chromium will not launch. If i run it with --no-sandbox, it will launch but will cause instability like crashes, EGL errors, no such file or directory etc...

To Reproduce Steps to reproduce the behavior:

  1. Open Start menu -> Internet
  2. Launch Chromium Web Browser or Google Chrome (if installed)

Expected behavior To launch normally without extra arguments

Screenshots image

Versions (please complete the following information):

Additional context Nothing

fcwu commented 4 years ago

Is chromium-browser --no-sandbox work?

chaggeus commented 4 years ago

Chrome work ok with this kind of docker startup definition. Important things are:

  1. user have to be some other than root (then --no-sandbox parameter with chrome is not needed)
  2. cap_add: SYSADMIN is required, check: https://github.com/jessfraz/dockerfiles/issues/65
$ cat docker-compose.yaml
version: '2'
services:
  novnc:
    image: dorowu/ubuntu-desktop-lxde-vnc:focal
    hostname: noVNClinux
    cap_add:
      #Google Chrome require this: https://github.com/jessfraz/dockerfiles/issues/65
      - SYS_ADMIN
    ports:
      - '80:80'
    environment:
      - USER=ubuntu

Looks like chromium installation require snap in ubuntu and execution of it in container is challenging. So I did't test it. Anyway @fcwu you can close this ticket with this answer.

saptarsi96 commented 3 years ago

With a non-root user, chrome fails after some time with "SIGILL error" Screenshot from 2021-02-21 15-18-49

chaggeus commented 3 years ago

Try this one. There should chrome work. https://github.com/TheProjectAurora/novnc-robotframework-docker Chrome eat a lot of memory. That could be reason.

saptarsi96 commented 3 years ago

@chaggeus 'The Compose file './docker-compose.yaml' is invalid because: Unsupported config option for services.novnc-with-robotframework: 'cpu_count'' Getting this error using your repo!

chaggeus commented 3 years ago

Update your docker-compose to latest version.

Docker-compose 2.2 include it https://docs.docker.com/compose/compose-file/compose-file-v2/

saptarsi96 commented 3 years ago

Issue not resolved! My memory is pretty high 16GB RAM. Don't know why this is happening.

saptarsi96 commented 3 years ago

Any better ubuntu desktops with GUI dockerized containers out there? I came across this article: https://dev.to/brickpop/my-dream-come-true-launching-gui-docker-sessions-with-dx11-in-seconds-1a53. Can you figure this out? @fcwu This seems to solve a lot of inherent problems.

fcwu commented 3 years ago

Have you used -v /dev/shm:/dev/shm in your docker command?

chaggeus commented 3 years ago

I get similar chrome crash on in noVNC platform. Chrome error code was different: "Error code: 64000"

chaggeus commented 3 years ago

Have you used -v /dev/shm:/dev/shm in your docker command?

At least to me that work. I added it also to here as docker-compose parameter "shm_size: 1G" (default value was 64M) : https://github.com/TheProjectAurora/novnc-robotframework-docker/blob/master/docker-compose.yaml ....find similar situation from https://developers.google.com/web/tools/puppeteer/troubleshooting#tips

It is interesting monitor /dev/shm usage inside of noVNC by executing 'watch -n 1 "df -h /dev/shm/"' in LXTerminal parallel when you browsing internet with chrome. Quick test it eat more than 200M space from /dev/shm.