Unable to init server. gtk initialization failed #89

Closed
opened 2025-12-29 05:21:56 +01:00 by adam · 9 comments
Owner

Originally created by @rcg12387 on GitHub (Nov 12, 2020).

Hi. I cannot run this docker image though run with allowing SSH into OSX.
os: Ubuntu 18.04.5 LTS (GNU/Linux 5.4.0-52-generic x86_64)
RAM: 64GB
cpu model name: Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz
count of cpus: 20
remote: using MobaXterm Professional Edition v10.7

$ sudo docker run --device /dev/kvm --device /dev/snd -e RAM=16 -p 50922:10022 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" sickcodes/docker-osx:latest
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
Unable to init server: Could not connect: Connection refused
QEMU 5.1.0 monitor - type 'help' for more information
(qemu) ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
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 pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
alsa: Could not initialize ADC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave
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
$ echo $DISPLAY
localhost:12.0
$ echo $TERM
xterm
$ pgrep -a X
2763 /usr/bin/Xwayland :1024 -rootless -terminate -accessx -core -listen 4 -listen 5 -displayfd 6
$ egrep -c '(svm|vmx)' /proc/cpuinfo
20
$ sudo dokerd
sudo: dokerd: command not found
$ sudo systemctl enable docker
Synchronizing state of docker.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable docker

Tried this but also failed:

$ sudo apt install x11-xserver-utils
$ xhost +
$ sudo docker run --privileged -e "DISPLAY=${DISPLAY:-:0.0}" -v /tmp/.X11-unix:/tmp/.X11-unix sickcodes/docker-osx ./OpenCore-Boot.sh
Unable to init server: Could not connect: Connection refused
Could not access KVM kernel module: Permission denied
qemu-system-x86_64: failed to initialize kvm: Permission denied

Please help me.

Originally created by @rcg12387 on GitHub (Nov 12, 2020). Hi. I cannot run this docker image though [run with allowing SSH into OSX](https://github.com/sickcodes/Docker-OSX#run-but-allow-ssh-into-osx). os: Ubuntu 18.04.5 LTS (GNU/Linux 5.4.0-52-generic x86_64) RAM: 64GB cpu model name: Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz count of cpus: 20 remote: using MobaXterm Professional Edition v10.7 ``` $ sudo docker run --device /dev/kvm --device /dev/snd -e RAM=16 -p 50922:10022 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" sickcodes/docker-osx:latest ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 Unable to init server: Could not connect: Connection refused QEMU 5.1.0 monitor - type 'help' for more information (qemu) ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave alsa: Could not initialize DAC alsa: Failed to open `default': alsa: Reason: No such file or directory ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave 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 pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave alsa: Could not initialize ADC alsa: Failed to open `default': alsa: Reason: No such file or directory ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave 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 ``` ``` $ echo $DISPLAY localhost:12.0 ``` ``` $ echo $TERM xterm ``` ``` $ pgrep -a X 2763 /usr/bin/Xwayland :1024 -rootless -terminate -accessx -core -listen 4 -listen 5 -displayfd 6 ``` ``` $ egrep -c '(svm|vmx)' /proc/cpuinfo 20 ``` ``` $ sudo dokerd sudo: dokerd: command not found ``` ``` $ sudo systemctl enable docker Synchronizing state of docker.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable docker ``` Tried this but also failed: ``` $ sudo apt install x11-xserver-utils $ xhost + $ sudo docker run --privileged -e "DISPLAY=${DISPLAY:-:0.0}" -v /tmp/.X11-unix:/tmp/.X11-unix sickcodes/docker-osx ./OpenCore-Boot.sh Unable to init server: Could not connect: Connection refused Could not access KVM kernel module: Permission denied qemu-system-x86_64: failed to initialize kvm: Permission denied ``` Please help me.
adam closed this issue 2025-12-29 05:21:57 +01:00
Author
Owner

@sickcodes commented on GitHub (Nov 12, 2020):

Try changing display to :12.0

-e "DISPLAY=12.0"

Remove sudo from docker run and add yourself to the Docker group

sudo chmod 666 /dev/kvm

Remove opencoreboot from the end

Remove --device /dev/snd

@sickcodes commented on GitHub (Nov 12, 2020): Try changing display to :12.0 `-e "DISPLAY=12.0"` Remove sudo from docker run and add yourself to the Docker group `sudo chmod 666 /dev/kvm ` Remove opencoreboot from the end Remove `--device /dev/snd`
Author
Owner

@BridgetNichols commented on GitHub (Nov 12, 2020):

I'm having the exact same issue. Their was an issue posted yesterday that was having the same output too. I've tried everything posted so far and haven't had any luck either.

@BridgetNichols commented on GitHub (Nov 12, 2020): I'm having the exact same issue. Their was an issue posted yesterday that was having the same output too. I've tried everything posted so far and haven't had any luck either.
Author
Owner

@rcg12387 commented on GitHub (Nov 13, 2020):

Try changing display to :12.0

-e "DISPLAY=12.0"

Remove sudo from docker run and add yourself to the Docker group

sudo chmod 666 /dev/kvm

Remove opencoreboot from the end

Remove --device /dev/snd

@sickcodes Thank you for your reply. I have tried your recommendations but also failed.

$ sudo usermod -aG docker "DL-001"
$ sudo chmod 666 /dev/kvm
$ docker run --device /dev/kvm -e RAM=16 -p 50922:10022 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=12.0" sickcodes/docker-osx:latest
docker: unknown server OS: .
See 'docker run --help'.

And tried this according to this.

$ sudo chmod 666 /var/run/docker.sock
$ docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
$ docker run --device /dev/kvm -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=12.0" sickcodes/docker-osx:latest
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
Unable to init server: Could not connect: Connection refused
QEMU 5.1.0 monitor - type 'help' for more information
(qemu) ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(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:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(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:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(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:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(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
@rcg12387 commented on GitHub (Nov 13, 2020): > Try changing display to :12.0 > > `-e "DISPLAY=12.0"` > > Remove sudo from docker run and add yourself to the Docker group > > `sudo chmod 666 /dev/kvm ` > > Remove opencoreboot from the end > > Remove `--device /dev/snd` @sickcodes Thank you for your reply. I have tried your recommendations but also failed. ``` $ sudo usermod -aG docker "DL-001" $ sudo chmod 666 /dev/kvm $ docker run --device /dev/kvm -e RAM=16 -p 50922:10022 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=12.0" sickcodes/docker-osx:latest docker: unknown server OS: . See 'docker run --help'. ``` And tried this according to [this](https://github.com/Xilinx/Vitis-AI/issues/18). ``` $ sudo chmod 666 /var/run/docker.sock $ docker run hello-world Hello from Docker! This message shows that your installation appears to be working correctly. ``` ``` $ docker run --device /dev/kvm -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=12.0" sickcodes/docker-osx:latest ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 Unable to init server: Could not connect: Connection refused QEMU 5.1.0 monitor - type 'help' for more information (qemu) ALSA lib confmisc.c:767:(parse_card) cannot find card '0' ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2660:(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:767:(parse_card) cannot find card '0' ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2660:(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:767:(parse_card) cannot find card '0' ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2660:(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:767:(parse_card) cannot find card '0' ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2660:(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 ```
Author
Owner

@sickcodes commented on GitHub (Nov 13, 2020):

I just tested using the code from the readme:

docker run \
    --device /dev/kvm \
    --device /dev/snd \
    -e RAM=4 \
    -p 50922:10022 \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    sickcodes/docker-osx:latest 

Screenshot

@sickcodes commented on GitHub (Nov 13, 2020): I just tested using the code from the readme: ```bash docker run \ --device /dev/kvm \ --device /dev/snd \ -e RAM=4 \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ sickcodes/docker-osx:latest ``` ![Screenshot](https://user-images.githubusercontent.com/65906298/99045513-5f9ffd80-2589-11eb-8acb-4ea345687a28.png)
Author
Owner

@rcg12387 commented on GitHub (Nov 13, 2020):

Thank you for your reply.
It still fails. I have tried "How to Install macOS VM on Linux" and it seems working. Awesome.

@rcg12387 commented on GitHub (Nov 13, 2020): Thank you for your reply. It still fails. I have tried ["How to Install macOS VM on Linux"](https://sick.codes/how-to-install-macos-virtual-machine-on-linux-arch-manjaro-catalina-mojave-or-high-sierra-xcode-working/) and it seems working. Awesome.
Author
Owner

@sickcodes commented on GitHub (Nov 13, 2020):

Thank you for your reply.
It still fails. I have tried "How to Install macOS VM on Linux" and it seems working. Awesome.

Haha great :P That was the original version!

@sickcodes commented on GitHub (Nov 13, 2020): > Thank you for your reply. > It still fails. I have tried ["How to Install macOS VM on Linux"](https://sick.codes/how-to-install-macos-virtual-machine-on-linux-arch-manjaro-catalina-mojave-or-high-sierra-xcode-working/) and it seems working. Awesome. Haha great :P That was the original version!
Author
Owner

@rcg12387 commented on GitHub (Nov 13, 2020):

@sickcodes I have a problem with mouse moving. Two cursors are appeared in the screen (one is of QEMU, another one is of MacOS, I think), and these two are not synchronized. Do you have any suggestion?
This issue is not appropriate to this git repo, anyway please help me.

@rcg12387 commented on GitHub (Nov 13, 2020): @sickcodes I have a problem with mouse moving. Two cursors are appeared in the screen (one is of QEMU, another one is of MacOS, I think), and these two are not synchronized. Do you have any suggestion? This issue is not appropriate to this git repo, anyway please help me.
Author
Owner

@sickcodes commented on GitHub (Nov 13, 2020):

One mouse should be for the host the other mouse should be the macs mouse cursor.

Dont zoom in or out as it will change the cursor calibration

I think in the qemu menu there's options to change the way the mouse works. If the mouse dies, change usb-mouse to usb-tablet in the launcher script, was necessary for me.

@sickcodes commented on GitHub (Nov 13, 2020): One mouse should be for the host the other mouse should be the macs mouse cursor. Dont zoom in or out as it will change the cursor calibration I think in the qemu menu there's options to change the way the mouse works. If the mouse dies, change usb-mouse to usb-tablet in the launcher script, was necessary for me.
Author
Owner

@rcg12387 commented on GitHub (Nov 13, 2020):

If the mouse dies, change usb-mouse to usb-tablet in the launcher script, was necessary for me.

I have used OpenCore-Boot.sh, it is written as -usb -device usb-kbd -device usb-tablet. You mean this don't you?

@rcg12387 commented on GitHub (Nov 13, 2020): > If the mouse dies, change usb-mouse to usb-tablet in the launcher script, was necessary for me. I have used OpenCore-Boot.sh, it is written as -usb -device usb-kbd -device usb-tablet. You mean this don't you?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX-sickcodes#89