Docker-OSX icon indicating copy to clipboard operation
Docker-OSX copied to clipboard

gtk initialization failed

Open 10000-ki opened this issue 3 years ago • 20 comments

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?

10000-ki avatar Nov 21 '22 13:11 10000-ki

Same with ventura for me 🙂

RichardFevrier avatar Nov 22 '22 12:11 RichardFevrier

xhost + Check your display variable I will test the images

sickcodes avatar Nov 22 '22 15:11 sickcodes

xhost +

xhost:  unable to open display ""

i found this error message

i think it required x-window mode

10000-ki avatar Nov 23 '22 05:11 10000-ki

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 avatar Nov 24 '22 20:11 paddymahoney

@sickcodes thank you for checking this issue

xhost +

above command It didn't work

Is there any other way?

10000-ki avatar Nov 28 '22 10:11 10000-ki

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 avatar Nov 30 '22 17:11 bckelley

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

Archisman-Mridha avatar Nov 30 '22 17:11 Archisman-Mridha

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 avatar Nov 30 '22 18:11 lorenzholzbauer

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 avatar Dec 03 '22 20:12 Archisman-Mridha

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 avatar Dec 03 '22 20:12 lorenzholzbauer

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 avatar Dec 07 '22 18:12 bphd

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

lorenzholzbauer avatar Dec 07 '22 19:12 lorenzholzbauer

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 avatar Dec 08 '22 03:12 IsraPerez98

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

IsraPerez98 avatar Dec 08 '22 04:12 IsraPerez98

Fixed the issue for me ! Thank you

TahaOps avatar Dec 09 '22 15:12 TahaOps

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

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

bphd avatar Jan 15 '23 15:01 bphd

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

10000-ki avatar Feb 07 '23 06:02 10000-ki

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

Real-Gecko avatar May 31 '23 10:05 Real-Gecko

Running on Plasma on X

Real-Gecko avatar May 31 '23 10:05 Real-Gecko

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 avatar May 31 '23 11:05 bphd