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.1k stars 1.78k forks source link

big sure not starting first use #480

Open gI7DUmmY opened 2 years ago

gI7DUmmY commented 2 years ago

Hi,

I'm a first user and I followed "initial setup" and video's instructions. When I execute the docker run snippet in the README, I get an error and nothing starts.

OS related issued, please help us identify the issue by posting the output of this

uname -a \ ; echo "${DISPLAY}" \ ; echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs \ ; grep NAME /etc/os-release \ ; df -h . \ ; qemu-system-x86_64 --version \ ; libvirtd --version \ ; free -mh \ ; nproc \ ; egrep -c '(svm|vmx)' /proc/cpuinfo \ ; ls -lha /dev/kvm \ ; ls -lha /tmp/.X11-unix/ \ ; ps aux | grep dockerd \ ; docker ps | grep osx \ ; grep "docker|kvm|virt" /etc/group

here is the output : Linux ced-Latitude-7480 5.13.0-39-generic #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux :0
1 NAME="Zorin OS" PRETTY_NAME="Zorin OS 16.1" VERSION_CODENAME=focal UBUNTU_CODENAME=focal Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur /dev/nvme0n1p2 468G 29G 416G 7% / QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.21) Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers libvirtd (libvirt) 6.0.0 total utilisé libre partagé tamp/cache disponible Mem: 31Gi 2,0Gi 19Gi 379Mi 9,4Gi 28Gi Partition d'échange: 2,0Gi 0B 2,0Gi 4 8 crw-rw----+ 1 root kvm 10, 232 avril 12 13:10 /dev/kvm total 16K drwxrwxrwt 2 root root 4,0K avril 12 11:00 . drwxrwxrwt 20 root root 12K avril 12 13:33 .. srwxrwxrwx 1 ced ced 0 avril 12 11:00 X0 srwxrwxr-x 1 gdm gdm 0 avril 12 09:54 X1024 srwxrwxr-x 1 gdm gdm 0 avril 12 09:54 X1025 root 27680 1.7 0.2 1796448 83804 ? Ssl 11:24 2:22 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/1767/config/daemon.json ced 31439 0.0 0.0 11608 724 pts/0 S+ 13:36 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox dockerd kvm:x:108: libvirt:x:134:ced libvirt-qemu:x:64055:libvirt-qemu libvirt-dnsmasq:x:135: docker:x:136:ced

Here are the various errors after executing the snippet for BIG SUR :

ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 nohup: appending output to 'nohup.out' ++ id -u ++ id -g

Thanks for your help and for your project, I like it a lot.

ashleysommer commented 2 years ago

I've got the same issue, on Ubuntu 20.04 too.

ashleysommer commented 2 years ago
Status: Downloaded newer image for sickcodes/docker-osx:latest
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
nohup: appending output to 'nohup.out'
++ id -u
++ id -g
+ sudo chown 1000:1000 /dev/kvm
++ id -u
++ id -g
+ sudo chown -R 1000:1000 /dev/snd
+ [[ 4 = max ]]
+ [[ 4 = half ]]
++ id -u
++ id -g
+ sudo chown -R 1000:1000 /dev/snd
+ 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
No protocol specified
QEMU 6.2.0 monitor - type 'help' for more information
(qemu) ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_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:5178:(_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:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(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:5178:(_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:5178:(_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:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(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:5178:(_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:5178:(_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:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(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:5178:(_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:5178:(_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:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(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
ashleysommer commented 2 years ago

I just realized its probably because I'm running Wayland and not X11. Would that cause it?

ashleysommer commented 2 years ago

Note, I'm getting the same error on Catalina, Big Sur, and Monterey. This is the monterey output (its much longer, but same error) https://gist.github.com/ashleysommer/3cc9b02ac448f313641fc4966d22c1fc

LLf13 commented 2 years ago

I'm on Fedora 36 and got the same issue. I tried it with Gnome on Wayland but also on X11 and sadly none of these is working @ashleysommer . I also checked out many of the old issues like #377 and the whole readme but so far I was not able to fix the problem. I would really appreciate other ideas :) and sorry if I missed something

slonopotamus commented 2 years ago

When I execute the docker run snippet in the README, I get an error and nothing starts.

None of you specified what exact command they use that fails. There are several snippets in README.

slonopotamus commented 2 years ago

I just realized its probably because I'm running Wayland and not X11. Would that cause it?

Why don't you just try switching to X11 and checking whether that helps?

Sab-tech-lab commented 2 years ago

Try install X-11 sudo apt install x11-apps -y then test it with: xeyes

then try boot

gI7DUmmY commented 2 years ago

Hi, thx for your replies. So as I was saying :

Here are the various errors after executing the snippet for BIG SUR :

there is only 1 snippet for Big Sur on the README.md I think so this is the one I used : docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ sickcodes/docker-osx:big-sur

X11 is already installed with the last version on my computer. I tested xeyes and I successfully obtained the window with the pair of eyes.

Kind regards.

Sab-tech-lab commented 2 years ago

Do you use a windows or linux operating system? If you use windows what distro do you have installed on wsl?

aspic-fish commented 1 year ago

do you have docker-desktop installed? I noticed that while running it breaks docker group. It's probably related to different contexts, not sure though. But docker images returns empty when it's running and only sudo docker images returns correct result. So I assume that docker-desktop requires some additional configuration. I just deleted it and docker. Then reinstalled docker. Now it works. I also saw someone reinstalled docker from snap to apt and it fixed the problem.

DanicMa commented 1 month ago

I had the same error gtk initialization failed on Ubuntu 22.04 and removing docker from snap and re-adding it via apt did the trick (I think)