dockerfiles icon indicating copy to clipboard operation
dockerfiles copied to clipboard

Chrome won't work without --no-sandbox option

Open mosajjal opened this issue 10 years ago • 8 comments

Hi !

I'm using Arch as host, with 4.6.2-1 kernel and 1.11.2 is my Docker version.

This doesn't work for me:

 docker run -it \
    --net host \ # may as well YOLO
    --cpuset-cpus 0 \ # control the cpu
    --memory 512mb \ # max memory it can use
    -v /tmp/.X11-unix:/tmp/.X11-unix \ # mount the X11 socket
    -e DISPLAY=unix$DISPLAY \
    -v $HOME/Downloads:/root/Downloads \
    -v $HOME/.config/google-chrome/:/data \ # if you want to save state
    --device /dev/snd \ # so we have sound
    -v /dev/shm:/dev/shm \
    --name chrome \
    jess/chrome

this doesn't open the chrome window for me. but when I add--no-sandbox or --disable-setuid-sandbox, it works.

Also, with 512mb ram, it crashes tabs multiple times, also "HTTPS everywhere" and "uBlock" will crash multiple times. adding --disable-appcontainer won't help either.

is there any way to run Chrome container with sand-boxing in Arch ?

best regards.

mosajjal avatar Jun 13 '16 09:06 mosajjal

Oh it's because you don't have userns enabled in your kernel

jessfraz avatar Jun 13 '16 09:06 jessfraz

See https://github.com/jfrazelle/dockerfiles/issues/65

jessfraz avatar Jun 13 '16 09:06 jessfraz

I can confirm after enabling User Namespace and re-compiling the kernel (4.7RC3), it works flawlessly. Also, VLC on docker seems to be working better and i3 shows the logo at the bottom.

mosajjal avatar Jun 13 '16 15:06 mosajjal

I got the same problem ,so i disable sandbox ,but it still cann't works!

creatist avatar Aug 31 '17 11:08 creatist

@creatist You need to enable user namespaces in your kernel for this to work.

koep avatar Sep 01 '17 13:09 koep

I can confirm after enabling User Namespace and re-compiling the kernel (4.7RC3), it works flawlessly. Also, VLC on docker seems to be working better and i3 shows the logo at the bottom.

Could you tell me what command you ran to do this? I'm new to docker.

quldude avatar Feb 16 '19 23:02 quldude

I can confirm after enabling User Namespace and re-compiling the kernel (4.7RC3), it works flawlessly. Also, VLC on docker seems to be working better and i3 shows the logo at the bottom.

Could you tell me what command you ran to do this? I'm new to docker.

did you get any resources for how to disable sandbox and run chrome in docker.

pranav083 avatar Dec 21 '20 05:12 pranav083

I can confirm after enabling User Namespace and re-compiling the kernel (4.7RC3), it works flawlessly. Also, VLC on docker seems to be working better and i3 shows the logo at the bottom.

Could you tell me what command you ran to do this? I'm new to docker.

did you get any resources for how to disable sandbox and run chrome in docker.

Yes, please help! I'm totally lost reading pages like this: https://docs.docker.com/engine/security/userns-remap/

dbolser avatar Nov 08 '21 14:11 dbolser