gtk initialization failed #426

Open
opened 2025-12-29 01:18:37 +01:00 by adam · 21 comments
Owner

Originally created by @10000-ki on GitHub (Nov 21, 2022).

Command

podman run -it --device /dev/kvm -p 50922:10022 docker.io/sickcodes/docker-osx:monterey

OS Version

NAME="Red Hat Enterprise Linux"
VERSION="8.6 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.6 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.6"

Error Message

ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Failed to create voice `dac'
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize ADC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize ADC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Failed to create voice `adc'
gtk initialization failed

when using os tag like monterey occur error
podman run -it --device /dev/kvm -p 50922:10022 docker.io/sickcodes/docker-osx:monterey

but using auto tag is okay

podman run -it --device /dev/kvm -p 50922:10022 docker.io/sickcodes/docker-osx:auto

Is there any solution?

Originally created by @10000-ki on GitHub (Nov 21, 2022). ## Command ` podman run -it --device /dev/kvm -p 50922:10022 docker.io/sickcodes/docker-osx:monterey ` ## OS Version ``` NAME="Red Hat Enterprise Linux" VERSION="8.6 (Ootpa)" ID="rhel" ID_LIKE="fedora" VERSION_ID="8.6" PLATFORM_ID="platform:el8" PRETTY_NAME="Red Hat Enterprise Linux 8.6 (Ootpa)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos" HOME_URL="https://www.redhat.com/" DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8" REDHAT_BUGZILLA_PRODUCT_VERSION=8.6 REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="8.6" ``` ## Error Message ``` ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM default alsa: Could not initialize DAC alsa: Failed to open `default': alsa: Reason: No such file or directory ALSA lib confmisc.c:855:(parse_card) cannot find card '0' ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM default alsa: Could not initialize DAC alsa: Failed to open `default': alsa: Reason: No such file or directory audio: Failed to create voice `dac' ALSA lib confmisc.c:855:(parse_card) cannot find card '0' ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM default alsa: Could not initialize ADC alsa: Failed to open `default': alsa: Reason: No such file or directory ALSA lib confmisc.c:855:(parse_card) cannot find card '0' ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM default alsa: Could not initialize ADC alsa: Failed to open `default': alsa: Reason: No such file or directory audio: Failed to create voice `adc' gtk initialization failed ``` --- when using os tag like monterey occur error `podman run -it --device /dev/kvm -p 50922:10022 docker.io/sickcodes/docker-osx:monterey` but using auto tag is okay `podman run -it --device /dev/kvm -p 50922:10022 docker.io/sickcodes/docker-osx:auto` Is there any solution?
Author
Owner

@RichardFevrier commented on GitHub (Nov 22, 2022):

Same with ventura for me 🙂

@RichardFevrier commented on GitHub (Nov 22, 2022): Same with `ventura` for me 🙂
Author
Owner

@sickcodes commented on GitHub (Nov 22, 2022):

xhost +
Check your display variable
I will test the images

@sickcodes commented on GitHub (Nov 22, 2022): `xhost +` Check your display variable I will test the images
Author
Owner

@10000-ki commented on GitHub (Nov 23, 2022):

xhost +

xhost:  unable to open display ""

i found this error message

i think it required x-window mode

@10000-ki commented on GitHub (Nov 23, 2022): ``` xhost + xhost: unable to open display "" ``` i found this error message i think it required `x-window mode`
Author
Owner

@paddymahoney commented on GitHub (Nov 24, 2022):

Get the same on latest:

macosx    | (qemu) ++ id -u
macosx    | ++ id -g
macosx    | + sudo chown 0:0 /dev/kvm
macosx    | ++ id -u
macosx    | ++ id -g
macosx    | + sudo chown -R 0:0 /dev/snd
macosx    | + [[ 4 = max ]]
macosx    | + [[ 4 = half ]]
macosx    | ++ id -u
macosx    | ++ id -g
macosx    | + sudo chown -R 0:0 /dev/snd
macosx    | + exec qemu-system-x86_64 -m 4000 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check, -machine q35,accel=kvm:tcg -smp 4,cores=4 -usb -device usb-kbd -device usb-tablet -device 'isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc' -drive if=pflash,format=raw,readonly=on,file=/home/arch/OSX-KVM/OVMF_CODE.fd -drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd -smbios type=2 -audiodev alsa,id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda -device ich9-ahci,id=sata -drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2 -device ide-hd,bus=sata.2,drive=OpenCoreBoot -device ide-hd,bus=sata.3,drive=InstallMedia -drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=qcow2 -drive id=MacHDD,if=none,file=/home/arch/OSX-KVM/mac_hdd_ng.img,format=qcow2 -device ide-hd,bus=sata.4,drive=MacHDD -netdev user,id=net0,hostfwd=tcp::10022-:22,hostfwd=tcp::5900-:5900, -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:09:49:17 -monitor stdio -boot menu=on -vga vmware
macosx    | QEMU 7.1.0 monitor - type 'help' for more information
macosx    | ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
macosx    | alsa: Could not initialize DAC
macosx    | alsa: Failed to open `default':
macosx    | alsa: Reason: No such file or directory
macosx    | ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
macosx    | alsa: Could not initialize DAC
macosx    | alsa: Failed to open `default':
macosx    | alsa: Reason: No such file or directory
macosx    | audio: Failed to create voice `dac'
macosx    | ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
macosx    | alsa: Could not initialize ADC
macosx    | alsa: Failed to open `default':
macosx    | alsa: Reason: No such file or directory
macosx    | ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
macosx    | alsa: Could not initialize ADC
macosx    | alsa: Failed to open `default':
macosx    | alsa: Reason: No such file or directory
macosx    | audio: Failed to create voice `adc'
macosx    | gtk initialization failed

Notes:

  • in my case, doesn't appear to be a fatal error - qemu boot continues
@paddymahoney commented on GitHub (Nov 24, 2022): Get the same on latest: ``` macosx | (qemu) ++ id -u macosx | ++ id -g macosx | + sudo chown 0:0 /dev/kvm macosx | ++ id -u macosx | ++ id -g macosx | + sudo chown -R 0:0 /dev/snd macosx | + [[ 4 = max ]] macosx | + [[ 4 = half ]] macosx | ++ id -u macosx | ++ id -g macosx | + sudo chown -R 0:0 /dev/snd macosx | + exec qemu-system-x86_64 -m 4000 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check, -machine q35,accel=kvm:tcg -smp 4,cores=4 -usb -device usb-kbd -device usb-tablet -device 'isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc' -drive if=pflash,format=raw,readonly=on,file=/home/arch/OSX-KVM/OVMF_CODE.fd -drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd -smbios type=2 -audiodev alsa,id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda -device ich9-ahci,id=sata -drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=/home/arch/OSX-KVM/OpenCore/OpenCore.qcow2 -device ide-hd,bus=sata.2,drive=OpenCoreBoot -device ide-hd,bus=sata.3,drive=InstallMedia -drive id=InstallMedia,if=none,file=/home/arch/OSX-KVM/BaseSystem.img,format=qcow2 -drive id=MacHDD,if=none,file=/home/arch/OSX-KVM/mac_hdd_ng.img,format=qcow2 -device ide-hd,bus=sata.4,drive=MacHDD -netdev user,id=net0,hostfwd=tcp::10022-:22,hostfwd=tcp::5900-:5900, -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:09:49:17 -monitor stdio -boot menu=on -vga vmware macosx | QEMU 7.1.0 monitor - type 'help' for more information macosx | ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave macosx | alsa: Could not initialize DAC macosx | alsa: Failed to open `default': macosx | alsa: Reason: No such file or directory macosx | ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave macosx | alsa: Could not initialize DAC macosx | alsa: Failed to open `default': macosx | alsa: Reason: No such file or directory macosx | audio: Failed to create voice `dac' macosx | ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave macosx | alsa: Could not initialize ADC macosx | alsa: Failed to open `default': macosx | alsa: Reason: No such file or directory macosx | ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave macosx | alsa: Could not initialize ADC macosx | alsa: Failed to open `default': macosx | alsa: Reason: No such file or directory macosx | audio: Failed to create voice `adc' macosx | gtk initialization failed ``` Notes: - in my case, doesn't appear to be a fatal error - qemu boot continues
Author
Owner

@10000-ki commented on GitHub (Nov 28, 2022):

@sickcodes thank you for checking this issue

xhost +

above command
It didn't work

Is there any other way?

@10000-ki commented on GitHub (Nov 28, 2022): @sickcodes thank you for checking this issue > xhost + above command It didn't work Is there any other way?
Author
Owner

@bckelley commented on GitHub (Nov 30, 2022):

I get the same error my only assumption is it's because I'm running an Intel based processor i5-8250U (4) @ 3.4GHz will there be a fix??

@bckelley commented on GitHub (Nov 30, 2022): I get the same error my only assumption is it's because I'm running an Intel based processor *i5-8250U (4) @ 3.4GHz* will there be a fix??
Author
Owner

@Archisman-Mridha commented on GitHub (Nov 30, 2022):

I got the same error and i am also running intel based i5 processor.

@Archisman-Mridha commented on GitHub (Nov 30, 2022): I got the same error and i am also running intel based i5 processor.
Author
Owner

@lorenzholzbauer commented on GitHub (Nov 30, 2022):

Try using Xorg and not Wayland. With GNOME you have to log out and search for a little settings wheel, where you have to choose GNOME on Xorg.

@lorenzholzbauer commented on GitHub (Nov 30, 2022): Try using Xorg and not Wayland. With GNOME you have to log out and search for a little settings wheel, where you have to choose GNOME on Xorg.
Author
Owner

@Archisman-Mridha commented on GitHub (Dec 3, 2022):

Try using Xorg and not Wayland. With GNOME you have to log out and search for a little settings wheel, where you have to choose GNOME on Xorg.

I am using windows with docker-desktop and wsl2

@Archisman-Mridha commented on GitHub (Dec 3, 2022): > Try using Xorg and not Wayland. With GNOME you have to log out and search for a little settings wheel, where you have to choose GNOME on Xorg. I am using windows with docker-desktop and wsl2
Author
Owner

@lorenzholzbauer commented on GitHub (Dec 3, 2022):

Are you for real trying to run a MacOS VM in a Linux VM on a Windows PC? I think WSL doesn't even have Xorg installed by default. You may need to install Xorg. It may be easier to just run a MacOS VM in VirtualBox or something, but I don't know your exact usecase.

@lorenzholzbauer commented on GitHub (Dec 3, 2022): Are you for real trying to run a MacOS VM in a Linux VM on a Windows PC? I think WSL doesn't even have Xorg installed by default. You may need to install Xorg. It may be easier to just run a MacOS VM in VirtualBox or something, but I don't know your exact usecase.
Author
Owner

@bphd commented on GitHub (Dec 7, 2022):

Try using Xorg and not Wayland. With GNOME you have to log out and search for a little settings wheel, where you have to choose GNOME on Xorg.

XWayLand run just fine on WayLand, many apps use X11 on WayLand. Why here it's a problem? It needs a special configuration?

I have an i5 too

@bphd commented on GitHub (Dec 7, 2022): > Try using Xorg and not Wayland. With GNOME you have to log out and search for a little settings wheel, where you have to choose GNOME on Xorg. XWayLand run just fine on WayLand, many apps use X11 on WayLand. Why here it's a problem? It needs a special configuration? I have an i5 too
Author
Owner

@lorenzholzbauer commented on GitHub (Dec 7, 2022):

As far as i know it doesn't work with XWayland. It started working after I switched to X11.

@lorenzholzbauer commented on GitHub (Dec 7, 2022): As far as i know it doesn't work with XWayland. It started working after I switched to X11.
Author
Owner

@IsraPerez98 commented on GitHub (Dec 8, 2022):

I'm having the exact same problem on Fedora 37 with a Ryzen CPU and X11.

Even after running xhost + I can't get past that error

@IsraPerez98 commented on GitHub (Dec 8, 2022): I'm having the exact same problem on Fedora 37 with a Ryzen CPU and X11. Even after running `xhost +` I can't get past that error
Author
Owner

@IsraPerez98 commented on GitHub (Dec 8, 2022):

Update: adding --privileged to the docker run command fixed the issue.

@IsraPerez98 commented on GitHub (Dec 8, 2022): Update: adding `--privileged` to the `docker run` command fixed the issue.
Author
Owner

@TahaOps commented on GitHub (Dec 9, 2022):

Fixed the issue for me !
Thank you

@TahaOps commented on GitHub (Dec 9, 2022): Fixed the issue for me ! Thank you
Author
Owner

@bphd commented on GitHub (Jan 15, 2023):

Update: adding --privileged to the docker run command fixed the issue.

Running as root can't be a viable solution. It's dangerous

@bphd commented on GitHub (Jan 15, 2023): > Update: adding `--privileged` to the `docker run` command fixed the issue. Running as root can't be a viable solution. It's dangerous
Author
Owner

@10000-ki commented on GitHub (Feb 7, 2023):

@sickcodes hi Is there any solution about this problem yet?

@10000-ki commented on GitHub (Feb 7, 2023): @sickcodes hi Is there any solution about this problem yet?
Author
Owner

@Real-Gecko commented on GitHub (May 31, 2023):

Same issue on Arch Linux, tried everything, tried all available MacOS versions. Any ways to diagnose what's missing?

@Real-Gecko commented on GitHub (May 31, 2023): Same issue on Arch Linux, tried everything, tried all available MacOS versions. Any ways to diagnose what's missing?
Author
Owner

@Real-Gecko commented on GitHub (May 31, 2023):

Running on Plasma on X

@Real-Gecko commented on GitHub (May 31, 2023): Running on Plasma on X
Author
Owner

@bphd commented on GitHub (May 31, 2023):

Same issue on Arch Linux, tried everything, tried all available MacOS versions. Any ways to diagnose what's missing?

Searching for what to diagnose since almost a year, but I discussed with the folks of the project and mostly their politic is that you're not worthy of using that project if you don't know how to debug it by yourself, if you're not a master of virtualization, containerization, Mac os, Linux under layers and such. So yeah, since I've just pushed that project back, doing other things, waiting for someone to have the same problem as me that the dev will be willing to help and get the solution from here

@bphd commented on GitHub (May 31, 2023): > Same issue on Arch Linux, tried everything, tried all available MacOS versions. Any ways to diagnose what's missing? Searching for what to diagnose since almost a year, but I discussed with the folks of the project and mostly their politic is that you're not worthy of using that project if you don't know how to debug it by yourself, if you're not a master of virtualization, containerization, Mac os, Linux under layers and such. So yeah, since I've just pushed that project back, doing other things, waiting for someone to have the same problem as me that the dev will be willing to help and get the solution from here
Author
Owner

@JuanJoseDev88 commented on GitHub (Sep 26, 2025):

I'm having the same issue: privileged doesn't work, running as sudo doesnt work, adding auto doesn't work.

@JuanJoseDev88 commented on GitHub (Sep 26, 2025): I'm having the same issue: privileged doesn't work, running as sudo doesnt work, adding auto doesn't work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#426