Docker Community Forums

Share and learn in the Docker community.

Google-chrome container - no sound via Pulseaudio


(Kfiresmith) #1

Folks,
I’ve run out of things to try in order to get a Google Chrome container working on Fedora-latest (host and container). Please let me know if you’ve gotten this to work.

Chrome can’t connect to the sound card based on what I’m seeing:

ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave

Here is my start script:

#!/bin/bash
#xhost +
DIR=$HOME/.chromedocker
mkdir -p $DIR/pki $DIR/share $DIR/config $DIR/chrome $HOME/Downloads
[ -e $HOME/.chrome.json ] || wget https://github.com/jfrazelle/dotfiles/raw/master/etc/docker/seccomp/chrome.json -O $HOME/.chrome.json

docker run --rm -it
–memory 2gb
-u $(id -u):$(id -g)
-v $DIR/config:/.config
-v $DIR:/$DIR
-v $DIR/pki:/.pki
-v /etc/localtime:/etc/localtime:ro
-v /tmp/.X11-unix:/tmp/.X11-unix
-e DISPLAY=unix$DISPLAY
-v $HOME/Downloads:/Downloads
-v $DIR:/.local
-v $DIR:/.gnome
–device /dev/snd:/dev/snd
–device /dev/dri
–device /dev/video0
–device /dev/bus/usb
–group-add audio
–group-add video
-v /etc/hosts:/etc/hosts:ro
-v /var/run:/var/run
-v /dev/shm:/dev/shm
-v /etc/machine-id:/etc/machine-id
-v /run/user/$uid/pulse:/run/user/$uid/pulse
-v /var/lib/dbus:/var/lib/dbus
-v ~/.pulse:/home/$dockerUsername/.pulse
–cap-drop all
–name chrome
jimbob/chrome --user-data-dir=/.local/chrome $*


(Nathan Le Claire) #2

The --cap-drop all looks suspicious, for starters. There are likely permissions that your process will need to access the devices that Chromium wants.

I’d check dmesg to see if anything interesting is showing up as well.