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.2k stars 1.79k forks source link

running bigsur on archlinux failed #390

Open zouyonghe opened 2 years ago

zouyonghe commented 2 years ago

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

Linux aoko 5.15.4-arch1-1 #1 SMP PREEMPT Sun, 21 Nov 2021 21:34:33 +0000 x86_64 GNU/Linux :0 1 NAME="BlackArch Linux" PRETTY_NAME="BlackArch Linux" 文件系统 容量 已用 可用 已用% 挂载点 /dev/sdb3 196G 163G 24G 88% / QEMU emulator version 6.1.0 Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers libvirtd (libvirt) 7.9.0 total used free shared buff/cache available 内存: 15Gi 3.3Gi 257Mi 160Mi 11Gi 11Gi 交换: 9Gi 73Mi 9.9Gi 12 24 crw-rw-rw- 1 root kvm 10, 232 11月 25 14:28 /dev/kvm 总用量 0 drwxrwxrwt 2 root root 60 11月 25 14:07 . drwxrwxrwt 17 root root 600 11月 25 14:31 .. srwxrwxrwx 1 root root 0 11月 25 14:07 X0 root 17993 13.3 0.5 2273000 83344 ? Ssl 14:12 2:36 /usr/bin/dockerd -H fd:// buding 44478 0.0 0.0 9592 2244 pts/2 S+ 14:31 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 kvm:x:992: docker:x:968: libvirt:x:966:

I tried to run macos Bigsur but failed. The log:

sudo 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 ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 nohup: appending output to 'nohup.out' ++ id -u ++ id -g

Thanks for your help.

fourdim commented 2 years ago

https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user may help.

Or run docker with sudo:

$ sudo 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

Your comment is messy, try learning markdown.

q351941406 commented 2 years ago

I made the same mistake he did, even with Sudo

sickcodes commented 2 years ago

Docker isn't running in the output

sudo dockerd

q351941406 commented 2 years ago

I solved this problem using VNC

zouyonghe commented 2 years ago

Could you please tell me more detailed solution?Thanks a lot.

Gerem66 commented 2 years ago

I had the same error and found part of the solution here. I did :

sudo pacman -S alsa alsa-utils
xhost +localhost

And my problem was solved

sickcodes commented 2 years ago

I had the same error and found part of the solution here.

I did :


sudo pacman -S alsa alsa-utils

xhost +localhost

And my problem was solved

Thanks for posting the fix!

jokester commented 2 years ago

I had similar problem on Archlinux.

xhost +localhost didn't solve the Authorization required, but no authorization protocol specified for me.

xhost + worked but it disabled X auth :laughing: . I'm still looking for a better solution.

sickcodes commented 2 years ago

I had similar problem on Archlinux.

xhost +localhost didn't solve the Authorization required, but no authorization protocol specified for me.

xhost + worked but it disabled X auth :laughing: . I'm still looking for a better solution.

Happens when running root/user space Docker X11 combinations; even though Docker is root 😂

weignerg commented 1 year ago

I had similar problem on Archlinux. xhost +localhost didn't solve the Authorization required, but no authorization protocol specified for me. xhost + worked but it disabled X auth laughing . I'm still looking for a better solution.

Happens when running root/user space Docker X11 combinations; even though Docker is root joy

I figured out how to get nested virtualization working in Docker-OSX.

It is slightly unrelated, but the command xhost is used.

I figured out the correct execution of xhost to allow connection for just the needed user.

xhost -SI:localuser:$(whoami)

In my instance, I believe it was the root user executing docker.

xhost -SI:localuser:root