mirror of
https://github.com/sickcodes/Docker-OSX.git
synced 2026-01-13 13:53:28 +01:00
(SOLVED) [Ubuntu 20] [Headless] 'gtk initialization failed' with specific images (big-sure, monterey etc) but auto works. #379
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 @BadgerHobbs on GitHub (Jul 6, 2022).
Description
Unable to successfully run any headless image other than 'auto' as they stop on
gtk initialization failederror.System info
What works
The below command works successfully without issue.
What doesn't work
The below issue returns the
gtk initialization failederror, with the below log.Last log lines
Comments & previously recommended fixes
Looks like there are a few issues currently mentioning this issue as of time of writing, both on Linux systems and WSL2 from people wanting both headless and displayed deployments:
Recommended fixes from previous issues
Conclusion
Sadly none of the provided fixes seemed to have worked for me. I guess the question would be what changes between running 'auto' headless compared to 'big-sur' (or any other image)?
@BadgerHobbs commented on GitHub (Jul 7, 2022):
Ok, I was able to get it running with the below docker run command and image. The logs should finish on the lines also shown below, then you can ssh into the image with user and alpine to confirm everything is working.
Your docker logs should end like this
@sickcodes commented on GitHub (Jul 11, 2022):
Awesome work, apologies for not getting back earlier. I also like the perfectly syntaxed report 😁
@BadgerHobbs commented on GitHub (Jul 11, 2022):
Thanks (Can't help myself with the pretty markdown!). Fantastic job with docker-osx as well, glad to be finally getting away from Apple's hardware restrictions. Interesting question will be what will happen when they fully migrate to Arm.
Hopefully this issue helps others, but looks like a PR may be required to resolve whatever changed in the image (Originally commented here https://github.com/sickcodes/Docker-OSX/issues/498#issuecomment-1141823716)
@ChainsDW commented on GitHub (Jul 19, 2022):
I started with these commands and it worked fine. But the container startup is too slow. how can i solve this problem?
@Bharath-Kuppusamy-ZS0197 commented on GitHub (Jul 4, 2023):
I followed the initial setup after replicating the issue, I executed these
$ sudo docker run -i --device /dev/kvm -p 50922:10022 -e GENERATE_UNIQUE=true -e DEVICE_MODEL="iMacPro1,1" -e WIDTH=1600 -e HEIGHT=900 -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY:=0.0" sickcodes/docker-osx:big-sur
$ xhost +
$ docker start -ai -i <container_id>
Worked like a charm!
@yarbshk commented on GitHub (Jul 7, 2023):
i had the same issue but i managed to fix it by building my own image:
it worked for me on Ubuntu 22.04.2 LTS. also i executed commands from "Recommended fixes from previous issues" section above (not sure if any of those was actually needed though).
it is as simple as that. hope it helps somebody.
@SimonBard commented on GitHub (Mar 7, 2024):
Many thanks. It did not help me unfortunately.
I am getting:
My system is a J4202-itx, which supports VT-x
@mcint commented on GitHub (Jun 3, 2024):
https://unix.stackexchange.com/questions/710944/qemu-warning-host-doesnt-support-requested-feature-cpuid-80000001hecx-svm-b
If you can modify arguments passed to qemu, adding
-cpu hostseems to be a simple naive fix for a similar issue.@ybeetle8 commented on GitHub (Aug 30, 2025):
xhost +local:root