[GH-ISSUE #71] Possibly simpler invocation #63

Closed
opened 2026-02-27 22:07:43 +03:00 by kerem · 6 comments
Owner

Originally created by @jimdigriz on GitHub (Jul 24, 2020).
Original GitHub issue: https://github.com/sickcodes/Docker-OSX/issues/71

I find the following helps get audio (pulseaudio seems to be what everyone has by default) and works around various gotchas regarding permissions (assumes you are a member of the kvm group already so can access /dev/kvm without making it globally read-write):

docker run \
  --privileged \
  -e "DISPLAY=${DISPLAY:-:0.0}" \
  -e EXTRA='-audiodev pa,id=hda-duplex,server=unix:/tmp/pulseaudio-socket' \
  -v /dev/kvm:/dev/kvm \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  -v /run/user/$(id -u)/pulse/native:/tmp/pulseaudio-socket \
  sickcodes/docker-osx
Originally created by @jimdigriz on GitHub (Jul 24, 2020). Original GitHub issue: https://github.com/sickcodes/Docker-OSX/issues/71 I find the following helps get audio (pulseaudio seems to be what everyone has by default) and works around various gotchas regarding permissions (assumes you are a member of the `kvm` group already so can access /dev/kvm without making it globally read-write): ``` docker run \ --privileged \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e EXTRA='-audiodev pa,id=hda-duplex,server=unix:/tmp/pulseaudio-socket' \ -v /dev/kvm:/dev/kvm \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -v /run/user/$(id -u)/pulse/native:/tmp/pulseaudio-socket \ sickcodes/docker-osx ```
kerem 2026-02-27 22:07:43 +03:00
Author
Owner

@sickcodes commented on GitHub (Jul 24, 2020):

This looks good, I will add this to the troubleshooting section, thank you!!

Only issue is it wouldn't work for anyone who isn't using pulse audio.

<!-- gh-comment-id:663758216 --> @sickcodes commented on GitHub (Jul 24, 2020): This looks good, I will add this to the troubleshooting section, thank you!! Only issue is it wouldn't work for anyone who isn't using pulse audio.
Author
Owner

@jimdigriz commented on GitHub (Jul 24, 2020):

Drop the audio bits for now, though it plumbs on on my side and pulseaudio sees QEMU, I'm not hearing any sound so I should dig further into it. Though you do get a 95% solution by just simply documenting it so that would be great too.

As a passing note, you could make the flip between pulseaudio and alsa automatic, two options either use test -c from shell against where you expect the ALSA device to be or (as image size is not a problem) then drag in an ALSA CLI tool to do the testing for you.

<!-- gh-comment-id:663777817 --> @jimdigriz commented on GitHub (Jul 24, 2020): Drop the audio bits for now, though it plumbs on on my side and pulseaudio sees QEMU, I'm not hearing any sound so I should dig further into it. Though you do get a 95% solution by just simply documenting it so that would be great too. As a passing note, you could make the flip between pulseaudio and alsa automatic, two options either use `test -c` from shell against where you expect the ALSA device to be or (as image size is not a problem) then drag in an ALSA CLI tool to do the testing for you.
Author
Owner

@sickcodes commented on GitHub (Jul 28, 2020):

Would you like to submit a PR for the readme edit?
I would put it under the extended run in the troubleshooting section :)

<!-- gh-comment-id:664872495 --> @sickcodes commented on GitHub (Jul 28, 2020): Would you like to submit a PR for the readme edit? I would put it under the extended run in the troubleshooting section :)
Author
Owner

@jimdigriz commented on GitHub (Jul 29, 2020):

Sure, happy to help out! I'll have a bit more of a stab with getting both pulse and alsa working and then get back to you.

<!-- gh-comment-id:665732444 --> @jimdigriz commented on GitHub (Jul 29, 2020): Sure, happy to help out! I'll have a bit more of a stab with getting both pulse and alsa working and then get back to you.
Author
Owner

@mrkvn commented on GitHub (Jan 9, 2021):

I ran this command and it outputs a list of Modules/Sinks. Not sure what to do with them.

docker run \
    --device /dev/kvm \
    -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \
    -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e PULSE_SERVER=unix:/tmp/pulseaudio.socket \
    sickcodes/docker-osx pactl list

And created the container by running this.

docker run \
    --device /dev/kvm \
    -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \
    -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    sickcodes/docker-osx

I actually didn't use the image sickcodes/docker-osx. I modified the size in Dockerfile from 200G to 80G to create a new image. OSX is installed and booted properly there's just no output sound device. Not sure what I did wrong. Thanks.

<!-- gh-comment-id:757139167 --> @mrkvn commented on GitHub (Jan 9, 2021): I ran this command and it outputs a list of Modules/Sinks. Not sure what to do with them. ``` docker run \ --device /dev/kvm \ -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \ -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e PULSE_SERVER=unix:/tmp/pulseaudio.socket \ sickcodes/docker-osx pactl list ``` And created the container by running this. ``` docker run \ --device /dev/kvm \ -e AUDIO_DRIVER=pa,server=unix:/tmp/pulseaudio.socket \ -v "/run/user/$(id -u)/pulse/native:/tmp/pulseaudio.socket" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ sickcodes/docker-osx ``` I actually didn't use the image sickcodes/docker-osx. I modified the size in Dockerfile from 200G to 80G to create a new image. OSX is installed and booted properly there's just no output sound device. Not sure what I did wrong. Thanks.
Author
Owner

@jimdigriz commented on GitHub (Jan 9, 2021):

I actually didn't use the image sickcodes/docker-osx. I modified the size in Dockerfile from 200G to 80G to create a new image. OSX is installed and booted properly there's just no output sound device. Not sure what I did wrong. Thanks.

As per the notes in the PR https://github.com/sickcodes/Docker-OSX/pull/82 which adds to the troubleshooting section of the README:

PulseAudio for sound (note neither AppleALC and varying alcid or VoodooHDA-OC have codec support though IORegistryExplorer does show the controller component working)

It means (though probably could be clearer/explicit) that the pulseaudio plumbing is now there (so audio from the guest to the host will work) but OS X has no 'codec' component (though it does have a 'driver') to actually drive sound through it...there is no audio support.

If someone can figure out the codec problem, that would solve this. Good luck!

<!-- gh-comment-id:757139668 --> @jimdigriz commented on GitHub (Jan 9, 2021): > I actually didn't use the image sickcodes/docker-osx. I modified the size in Dockerfile from 200G to 80G to create a new image. OSX is installed and booted properly there's just no output sound device. Not sure what I did wrong. Thanks. As per the notes in the PR https://github.com/sickcodes/Docker-OSX/pull/82 which adds to the [troubleshooting section of the README](https://github.com/sickcodes/Docker-OSX/blob/master/README.md#troubleshooting): > PulseAudio for sound (note neither AppleALC and varying alcid or VoodooHDA-OC have codec support though IORegistryExplorer does show the controller component working) It means (though probably could be clearer/explicit) that the pulseaudio plumbing is now there (so audio from the guest to the host will work) but OS X has no '*codec*' component (though it does have a 'driver') to actually drive sound through it...there is no audio support. If someone can figure out the codec problem, that would solve this. Good luck!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-OSX#63
No description provided.