LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Containers
User Name
Password
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.

Notices


Reply
  Search this Thread
Old 03-06-2021, 12:33 AM   #1
jeenuv
LQ Newbie
 
Registered: Aug 2014
Location: Cambridge, UK
Distribution: Linux Mint 20.1
Posts: 22

Rep: Reputation: Disabled
Getting sound to play on host from a Docker container


Unfortunately, Firefox stopped working for me, but for some reason, it's happy to run inside a container. Only thing is that I don't have sound.

I built the container like this:

Code:
FROM ubuntu
RUN apt-get update && apt-get install firefox
And I'm running the container like this:

Code:
docker run --rm -it --privileged --net=host \
  -u $(id -u):$(id -g) \
  -e HOME \
  -e DISPLAY \
  -e XSOCK=/tmp/.X11-unix \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  -v $HOME:$HOME \
  -v /dev/shm:/dev/shm:rw \
  -v /etc/machine-id:/etc/machine-id \
  -v /run/dbus:/run/dbus:rw \
  -e PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native \
  -v ${XDG_RUNTIME_DIR}/pulse/native:${XDG_RUNTIME_DIR}/pulse/native \
  --group-add $(getent group audio | cut -d: -f3) \
  firefox /bin/bash
I've practically exhausted search results on getting this to work. It'd be great if someone can tell me what I'm missing here--either the way I built the container (more packages needed), or with the docker command line.
 
Old 03-07-2021, 09:10 AM   #2
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,144

Rep: Reputation: 392Reputation: 392Reputation: 392Reputation: 392
I've managed to get Kodi to play sound to a remote pulse server from a docker. I'll link my git manual for it. I'm not sure but maybe it can help you? The readme is my initial work to get it in a container. The docker stuff builds one that works straight up. You do need to modify the remote pulse server to accept network sound input.

https://github.com/jmgibson1981/scri...-Headless-Kodi
https://github.com/jmgibson1981/scri...odi/Dockerfile
https://github.com/jmgibson1981/scri.../entrypoint.sh

*EDIT* forgot to add the way to start the container

https://github.com/jmgibson1981/scri...er/kodi/README
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to Copy/Move a Docker Container to Another Host LXer Syndicated Linux News 0 08-20-2019 10:54 AM
Getting NodeJS logs from a Docker container Mark_667 Linux - Containers 1 07-01-2019 07:01 AM
linux container host os and container os question jzoudavy Linux - Newbie 1 09-01-2015 05:21 AM
LXer: Inside the Open Container Project: How Docker plans to unite the container market LXer Syndicated Linux News 0 06-23-2015 04:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 12:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration