sickcodes / Docker-OSX

Run macOS VM in a Docker! Run near native OSX-KVM in Docker! X11 Forwarding! CI/CD for OS X Security Research! Docker mac Containers.
https://hub.docker.com/r/sickcodes/docker-osx
GNU General Public License v3.0
36.13k stars 1.78k forks source link

gtk initialization failed when using Zorin OS Mini #599

Open strider789 opened 1 year ago

strider789 commented 1 year ago

Hey, please can somebody help with this error I'm getting?

Here's the code I'm trying to run

`sudo docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e GENERATE_UNIQUE=true \ -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \ sickcodes/docker-osx:ventura

docker build -t docker-osx --build-arg SHORTNAME=ventura .`

Here's some details of what was happening leading up to the error

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 opendefault': 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 voiceadc' gtk initialization failed `

Here is the output of the code that shows my OS details

`NAME="Zorin OS" PRETTY_NAME="Zorin OS 16.2" VERSION_CODENAME=focal UBUNTU_CODENAME=focal Filesystem Size Used Avail Use% Mounted on /dev/nvme0n1p2 234G 17G 206G 8% /

Command 'qemu-system-x86_64' not found, but can be installed with:

sudo apt install qemu-system-x86 # version 1:4.2-3ubuntu6.24, or sudo apt install qemu-system-x86-xen # version 1:4.2-3ubuntu6.24

Command 'libvirtd' not found, but can be installed with:

sudo apt install libvirt-daemon

          total        used        free      shared  buff/cache   available

Mem: 7.7Gi 1.6Gi 531Mi 603Mi 5.6Gi 5.1Gi Swap: 2.0Gi 2.0Mi 2.0Gi 8 16 crw-rw----+ 1 root kvm 10, 232 Dec 16 20:10 /dev/kvm total 8.0K drwxrwxrwt 2 root root 4.0K Dec 16 20:06 . drwxrwxrwt 17 root root 4.0K Dec 16 20:38 .. srwxrwxrwx 1 root root 0 Dec 16 20:06 X0 root 689 6.5 1.0 2016816 83568 ? Ssl 20:06 2:10 dockerd --group docker --exec-root=/run/snap.docker --data-root=/var/snap/docker/common/var-lib-docker --pidfile=/run/snap.docker/docker.pid --config-file=/var/snap/docker/2285/config/daemon.json msilver+ 5630 0.0 0.0 18808 660 pts/1 S+ 20:39 0:00 grep --color=auto dockerd Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json": dial unix /var/run/docker.sock: connect: permission denied `

sickcodes commented 1 year ago

Thanks for that, Ubuntu loves changing their package names, with zero backwards compatibility (libvirt-daemon).

I can't see what user you are, root?

Are you in the Docker group?

Two ways, xhost + so you can use the desktop user's display as root/docker.

And add yourself to docker group, restart docker after

strider789 commented 1 year ago

Thanks for the reply. I'm not logged in as root. I tried to add my username to the docker group but it said

usermod: group 'docker' does not exist

strider789 commented 1 year ago

I added --privileged to it (see below) and I think it gets further than before but it still stops with an error

`sudo docker run --privileged -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e GENERATE_UNIQUE=true \ -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom.plist' \ sickcodes/docker-osx:ventura

(#) docker build -t docker-osx --build-arg SHORTNAME=ventura .`

Here's the error

`+ sudo chown -R 1000:1000 /dev/snd

strider789 commented 1 year ago

I've got it working. I was using the snap version of docker. I uninstalled it and used the apt docker.io version and then it worked, I'm now running mac OS.

The reason I had originally installed the snap version of docker is because it had a later version number. I figured that later meant better.

Many thanks for sharing this amazing project.