https://orbstack.dev logo
sound in docker container
# support
m
I stumbled across the announcement that sound is now passed through to linux machines and containers. Great news! While it works already on the linux machine I tested, the same did not work for a container. I followed the docs but got an error. Steps to reproduce:
Copy code
bash
docker run --rm -it ubuntu:latest
# inside docker
apt update && apt install alsa-utils
speaker-test -t wav -c 2
this produces
Copy code
speaker-test 1.2.15.2

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
ALSA lib confmisc.c:855:(parse_card) [error.core] cannot find card '0'
ALSA lib conf.c:5207:(_snd_config_evaluate) [error.core] function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) [error.core] error evaluating strings
ALSA lib conf.c:5207:(_snd_config_evaluate) [error.core] function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) [error.core] error evaluating name
ALSA lib conf.c:5207:(_snd_config_evaluate) [error.core] function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5730:(snd_config_expand) [error.core] Evaluate error: No such file or directory
ALSA lib pcm.c:2722:(snd_pcm_open_noupdate) [error.pcm] Unknown PCM default
Playback open error: -2,No such file or directory
Any ideas on what I might be doing wrong? This is on Version 2.2.1 (20628)
d
add
--device /dev/snd
m
Worked like a charm! Thank you!