mirror of
https://github.com/sickcodes/Docker-OSX.git
synced 2026-01-11 21:10:25 +01:00
Container fails to run: Gdk-ERROR #77
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xJonathanLEI on GitHub (Oct 15, 2020).
Host: Ubuntu 20.04
CPU: AMD Ryzen 9 3950X 16-Core Processor
Using the latest image from Docker Hub:
When running this command:
It fails with:
I used to be able to successfully run Docker-OSX on an Intel Core i7-8700k on the same Ubuntu 20.04 host system (with an order Docker-OSX image version though). Is AMD somehow not supported? The error message seems to suggest this is an X Server error? But I should have X Server properly enabled on my system.
Please kindly help. Thanks in advance!
@xJonathanLEI commented on GitHub (Oct 15, 2020):
CPU details, just in case:
@xJonathanLEI commented on GitHub (Oct 15, 2020):
I guess it's not a CPU issue after all... I mean I can successfully install macOS following the instructions on OSX-KVM:
@sickcodes commented on GitHub (Oct 15, 2020):
Hey man! Interesting bug, first new bug I've seen in ages! I will test this shortly thank you for reporting.
@sickcodes commented on GitHub (Oct 15, 2020):
Current image working on my AMD R9 4900H
Given the message includes reference to shared memory try adding:
--shm-size=6GAnd possibly try that with and without
--device /dev/shm \Perhaps you are missing one of the above, or
gdk-pixbuf2is the only package I have with gdk I believe@xJonathanLEI commented on GitHub (Oct 15, 2020):
Hi! Thanks for the speedy reply! Happy to help debug the issue.
Adding
--shm-size=6Gwithout--device /dev/shm \gives the exact same log as originally posted.Adding both
--shm-size=6Gand--device /dev/shm \gives:@gruaig commented on GitHub (Oct 15, 2020):
Hey check out this page
https://github.com/moby/moby/issues/6758 down the very bottom with tmpfs
@xJonathanLEI commented on GitHub (Oct 16, 2020):
Ahh just in case, by "the same host system" I meant the same distro with the same version (20.04 LTS), not the same installation.
@sickcodes commented on GitHub (Oct 16, 2020):
Yeah
-v /dev/shminstead of device should fix it@sickcodes commented on GitHub (Oct 16, 2020):
-v /dev/shm --tmpfs /dev/shm:rw,nosuid,nodev,exec,size=4gSHM is a ramdisk for anyone reading this, you can see it with
dfand if you put files in the mountpoint, like/tmpyour system stores those files in RAM.@xJonathanLEI commented on GitHub (Oct 17, 2020):
Thanks for the update!
So I changed
--device /dev/shmto-v /dev/shmand now Docker doesn't complain anymore, except qemu is again showing the same error message:Here's the full command I'm using for running the container:
@sickcodes commented on GitHub (Oct 17, 2020):
I think because you're running as sudo, sudo is a different environment, are you running your display manager as sudo too?
You should add yourself to the Docker group, or I believe there's some way to do it without root.
@gruaig commented on GitHub (Oct 17, 2020):
Will give it a try but I don't believe that will be the case. Will update
shortly
On Sat 17 Oct 2020, 4:13 PM sickcodes, notifications@github.com wrote:
@xJonathanLEI commented on GitHub (Oct 17, 2020):
Hmmmm I didn't expect this to work, as I always used
sudofor Docker commands and haven't had issues with Docker-OSX on my previous machine.But somehow it works... though I seriously doubt it's the cause.
So here's what I did. I booted into the system, added myself to the Docker group, got rid of
sudoin the command, and boom, it works.But then I remove the container, add
sudoback to the command, and run it again. It still works...I even removed both
--shm-size=6Gand-v /dev/shmoptions, and it still works.So my command is now:
and runs without issue.
It seems that somehow the issue automatically went away on my machine. I'll try to find a way to reproduce it thought.
@sickcodes commented on GitHub (Oct 17, 2020):
It's probably a combination of
-Docker group
-Running as sudo
-Your desktop isn't sudo (normal)
-We are using X11 forwarding into the user env
Perhaps on previous machine, you had different groups set up
@sickcodes commented on GitHub (Oct 17, 2020):
And running the Docker daemon as root/user
I run mine as root
@xJonathanLEI commented on GitHub (Oct 17, 2020):
Hmm both machines are (almost) clean installations of Ubuntu 20.04 with no changes on user/group.
But if that's actually the cause, why am I not seeing the issue again after I:
I'm now using the command I started with.. That's weird. I should have tested if it works right before adding my user to docker group..
@sickcodes commented on GitHub (Oct 17, 2020):
07f488a470 (L148)Could be related to this change made not long ago
@BackMountainDevil commented on GitHub (Jul 2, 2021):
Hi, I wonder how you achieve the markdown gammar. I copy your reply md code to vscode to preview. it will not be folded...
@JetpackDuba commented on GitHub (Dec 12, 2024):
I've been facing the same issue if I'm not mistaken:
It's not the first time getting this error but it used to get fixed randomly, not sure how or why. I've also tried to run
xhost +mentioned in #115 but nothing changes.Is there anything I can do to debug the issue? I've tried multiple potential solutions from this thread but it didn't make any difference.
I'm on archlinux using the latest image available (it also happens with ventura, I haven't tested older images).
@jayenashar commented on GitHub (Feb 5, 2025):
same here.
command:
docker run --name macos -it --device /dev/kvm -p 50922:10022 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=${DISPLAY:-:0.0}" -e GENERATE_UNIQUE=true -e CPU='Haswell-noTSX' -e CPUID_FLAGS='kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on' -e MASTER_PLIST_URL='https://raw.githubusercontent.com/sickcodes/osx-serial-generator/master/config-custom-sonoma.plist' -e SHORTNAME=sonoma sickcodes/docker-osx:latest(with and withoutsudo)image:
"Id": "sha256:b96a4d6696f4ffaf9e4cc99493fffb8288ba6e8606a4030f7553c9e1714653db",i did an
xhost +. i'm on debian 12. i run x11 (no wayland) as a user, and the docker command. user is in the kvm and docker groups.btw what is
-v /tmp/.X11-unix:/tmp/.X11-unixfor? isn'tDISPLAY=:0enough?