mirror of
https://github.com/sickcodes/Docker-OSX.git
synced 2026-01-11 21:10:25 +01:00
GTK Initializing failed - can't start #37
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 @peterandrewd on GitHub (Jun 15, 2020).
So I created a docker image using the guide.
I run the command: docker run --privileged -v /tmp/.X11-unix:/tmp/.X11-unix docker-osx:latest
It recognises docker-osx:latest. It does its usual start up command sequence, then gets to the end and says: gtk initialization failed.
IF I start docker-osx normally without that tag, using the: docker run --privileged -e "DISPLAY=${DISPLAY:-:0.0}" -v /tmp/.X11-unix:/tmp/.X11-unix sickcodes/docker-osx command, it runs. But I want usb support so yeah.
@sickcodes commented on GitHub (Jun 15, 2020):
I am quite sure I definitely can get iPhone full pass through to Xcode. Let me try today using virt manager.
@sickcodes commented on GitHub (Jun 15, 2020):
You need to docker pull the latest version
docker pull sickcodes/docker-osx@peterandrewd commented on GitHub (Jun 15, 2020):
And then create the image?
@sickcodes commented on GitHub (Jun 15, 2020):
Message me on Twitter if you want I’ll show you over teamviewer 😂
@sickcodes commented on GitHub (Jun 15, 2020):
I’m not sure if you get it entirely but docker works on intermediate containers
When you
pulldown, you get a copy that has been built by hub.docker.comIt’s stored “in state”. Docker lets you run the second command in the comment above 10 times in a row each one in its own container.
The other option is to build it yourself.
@peterandrewd commented on GitHub (Jun 15, 2020):
Yes that's what Im trying to do, a custom build with more RAM and USB support for iPhone.
Here is my command, is it correct?
docker run --privileged -e RAM=16 -e EXTRA='-usb -device usb-host,hostbus=1,hostaddr=3' -e "DISPLAY=${DISPLAY:-:0.0}" -v /tmp/.X11-unix:/tmp/.X11-unix sickcodes/docker-osx
OR do I need to build my own container image to be able to run with those commands?
@peterandrewd commented on GitHub (Jun 15, 2020):
I mean using those commands it boots and installs Catalina...but progress bar gets stuck halfway on loading into the actual OS once it’s installed...!
image
@sickcodes commented on GitHub (Jun 15, 2020):
Check disk space usage, any screenshots?
@peterandrewd commented on GitHub (Jun 15, 2020):
I have 300GB of free available disk space so it ain’t that.
Below in the photo it says libusb_set_configuration: -6 [BUSY] in the terminal.
That’s all it says.
@peterandrewd commented on GitHub (Jun 15, 2020):
docker run -e RAM=8 -e EXTRA='-usb -device usb-host,hostbus=1,hostaddr=2' -p 50922:10022 --privileged -e "DISPLAY=${DISPLAY:-:0.0}" -v /tmp/.X11-unix:/tmp/.X11-unix sickcodes/docker-osx:latest
That is the command I ran. I don't think on my end Im doing anything wrong this time. Everything loads and installs fine except when it actually comes time to boot into Catalina.
But when I don't put the -e EXTRA='-usb -device argument in, it boots in. Go figure.
Also each time I plug my phone in, it changes the ID number. It'll still be on Bus 001, but the device ID number always changes. So is there a way to set it permanently to match my docker run command above for the ONE container that I can start with docker start xxxxxxxxx?
@peterandrewd commented on GitHub (Jun 15, 2020):
See here, because I created the original container using the argument "-e EXTRA='-usb -device usb-host,hostbus=1,hostaddr=2'", now qemu gives an error: "qemu-system-x86_64: -device usb-host,hostbus=1,hostaddr=2: failed to find host usb device 1:2" when using docker start xxxxxxxx, because the USB device was unplugged and re-plugged and thus changed device ID's.
So you cannot create a container using the original USB filter arguments.
Am I doing something wrong, or am I correct this time?
SO there is 2 issues. Number 1: Need to somehow create a rule for a persistent device ID for iPhone/iOS devices and Number 2: using the "-e EXTRA='-usb -device usb-host,hostbus=1,hostaddr=2'" just makes QEMU hang upon boot into macOS (once installed). I've tested this 6 times now, so no one else has to. WITHOUT that command, it boots just fine..but obviously USB/phone still isn't recognized.
Please do tell me how I can rectify these to be able to side-load apps using Xcode the proper way, and not the awful unnecessary, hard apache2/manifest file way.
@sickcodes commented on GitHub (Jun 15, 2020):
Yeah for one time use you can passthrough a device, it has to be in the same spot later. I think you’ll have better luck using the Virt-manager version outside of docker, you can add and remove usb devices willy nilly.
@peterandrewd commented on GitHub (Jun 15, 2020):
Ok and as I'm new and learning, how do I use the virt manager method?
--EDIT--:
I am in virt manager, but do I need to provide my own Catalina img or can I clone a git and use one from there?
@peterandrewd commented on GitHub (Jun 15, 2020):
Nvm. The VM is installed in virt manager. Haven’t installed Catalina yet but how similar or how well it runs compared to the QEMU method though is another question...
@sickcodes commented on GitHub (Jun 15, 2020):
It should be unnoticeably faster 😂
@peterandrewd commented on GitHub (Jun 16, 2020):
Still same issue. Can't mount iPhone into "VM"
@laijinsheng commented on GitHub (Jun 19, 2020):
Hello everyone, dear netizens, I'm a netizen from China. Because do not understand English, so the detailed operation will use Chinese to explain, please use translation software translation. Sorry for the inconvenience
大家好,各位亲爱的网友,我是来自中国的网友。因不懂英文 所以详细操作会使用中文阐述,请各大网友使用翻译软件翻译。不便之处请见谅
经过一下午的折腾终于看到了docker-osx界面
执行docker启动命令前先检查vnc端口是否被占有
sudo netstat -tunlp | grep 5903若被占用可进行更换(注意启动命令也需要做出修改)或者kill掉占用的进程
然后我执行以下命令启动:
docker run -p 5903:5903 -e EXTRA='-vnc localhost:3' --privileged --net host --cap-add=ALL -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev:/dev -v /lib/modules:/lib/modules sickcodes/docker-osx执行后等待3-5分钟 使用vnc viever来链接。



链接地址为:localhost:5903
过程中遇到的问题及分析思路:
问题1:gtk initialization failed
分析:因linux可视化界面基于xorg,所以需要改掉qume的启动方式(个人理解) 然后通过增加 -e EXTRA='-vnc localhost:3' 参数实现vnc转发
问题2:Could not access KVM kernel module: Permission denied、qemu-system-x86_64: failed to initialize kvm: Permission denied
结论:/dev/kvm权限问题 执行命令 sudo chmod 666 /dev/kvm
有疑问欢迎追加提问,感谢大家
If you have any questions, welcome to ask additional questions. Thank you
@sickcodes commented on GitHub (Jun 19, 2020):
You cannot use VNC and $DISPLAY at the same time because they are different monitors.
You can use the VNC version already here
vnc-version/Dockerfile
@laijinsheng commented on GitHub (Jun 20, 2020):
感谢作者的回复,看了上面的一些提示后 进行了二次操作,使用一下命令报错。提示为硬盘空间不足。待解决后继续尝试 感谢
docker run --privileged -e "DISPLAY=${DISPLAY:-:0.0}" -v /tmp/.X11-unix:/tmp/.X11-unix sickcodes/docker-osx@sickcodes commented on GitHub (Jun 20, 2020):
The command you mentioned is for X11 display connection
2 different containers.
X11 for native window display
VNC for remote display connection
Here are the VNC rules:
@peterandrewd commented on GitHub (Jun 26, 2020):
Why is this issue closed? Its still a problem when using a custom build.
Yes it builds, yes it recognized the docker image file, and it tries to boot in with the command docker run --privileged -v /tmp/.X11-unix:/tmp/.X11-unix docker-osx:latest but says GTK initialising failed.
AND I have tried docker build -t docker-osx-vnc . Then running docker run -p 8888:5999 -p 50922:10022 -d --privileged docker-osx-vnc:latest and it doesn't even boot in at all. Just blank terminal after that. But if i use the non-custom build method, it runs.
I want a custom build because I only want to use 64GB for storage space, not the 200GB the "pre-built" build/command comes with.
@peterandrewd commented on GitHub (Jun 27, 2020):
??
@sickcodes commented on GitHub (Jun 27, 2020):
Hi Peter. You can simply clone the repo and do the lines at the top of the commented section of the file
docker build ... docker run ...The commands are written in full at the top of the Dockerfile.
Note that whatever label you choose, you need to run that image
@peterandrewd commented on GitHub (Jun 28, 2020):
Yes that is what I did: docker build -t docker-osx:latest —build arg SIZE=64G
Then: docker run --privileged -CORES=4 -e RAM=8 -e "DISPLAY=${DISPLAY:-:0.0}" -v /tmp/.X11-unix:/tmp/.X11-unix sickcodes/docker-osx:latest
It says port in use and doesn’t run
@sickcodes commented on GitHub (Jul 4, 2020):
docker build -t docker-osx:latest
docker run .... sickcodes/docker-osx:latest
These are two different Docker images.
sickcodes/docker-osx:latest is from hub.docker.com/r/sickcodes/docker-osx.
docker-osx:latest does not exist, unless you build it, which you did.
Since you built it, use that in the docker run command instead of the other one.
@hoaivan commented on GitHub (Aug 2, 2020):
this is how i solved GTK initilizing failed on Manjaro, just run below command before starting docker:
xhost +
@farhandiwan commented on GitHub (Jan 28, 2021):
I am trying to run the docker container from a Centos 8 VM created on top of Virtualbox.
Getting the same GTK error. I did run xhosts + command to allow the xhosts.
getting a warning too for CPU flags for EAX not availble.
Using the latest osx image from docker repo.
@farhandiwan commented on GitHub (Jan 28, 2021):
which distribution is this tested on . I can test on it. I have choice of OS if that resolves the problem.
@sickcodes commented on GitHub (Feb 2, 2021):
Does this show 0 or 1?
egrep -c '(svm|vmx)' /proc/cpuinfo@farhandiwan commented on GitHub (Feb 24, 2021):
I did check the cpu flags i did not find svm but. vmx. was present in the cpu flags.
@farhandiwan commented on GitHub (Feb 24, 2021):
VMX. is present in cpu flags.
@yozachar commented on GitHub (Apr 11, 2021):
Hi, I pulled the
big surdocker image:docker pull sickcodes/docker-osx:big-sur. Then according theinitial setupI install the dependencies. Rebooted.System Info
Misc
I think my system is capable of running MacOS docker images. But when I run the command, I'm 🤕.
Ignoring ALSA errors, the other two that stand out are:
Unable to init server: Could not connect: Connection refusedandgtk initialization failed. There are a lot of issues raised around these, but they didn't solve mine. I might me missing some small detail here can anybody help me, please?@farhandiwan commented on GitHub (Apr 11, 2021):
Having the same issue.
As GTK initialization failed.
On Sun, Apr 11, 2021 at 6:24 AM Jovial Joe Jayarson <
@.***> wrote:
@sickcodes commented on GitHub (Apr 12, 2021):
Or
Or
@yozachar commented on GitHub (Apr 12, 2021):
Nope that didn't work. Same error log.
As this https://github.com/sickcodes/Docker-OSX/issues/213#issuecomment-805000950 says
xhost +isn't quite recommended. So earlier I had donexhost +SI:localuser:username, nevertheless I tried again withxhost +but it didn't work. Same error message.Oh forgive me, I should have mention this earlier. Docker is snapped on my system.
Which is why I guess I do not have
docker.servicenordockerdI really do not want to use
aptorppato install docker, it would mess up my other configuration. @sickcodes does this issue have something to do with snapped docker, is there anything else that I can try?@BackMountainDevil commented on GitHub (Jul 2, 2021):
I guess we have the same problem. But I have installed docker.
@hwanseoc commented on GitHub (Aug 25, 2021):
@sickcodes I had the same exact error as @joe733, but I noticed that
So did I when I had the error. So, I uninstalled the snap docker and installed with the PPA one, and now it works fine. Might be worth mentioning in the documentation that using docker snap doesn't work.
@sickcodes commented on GitHub (Aug 25, 2021):
Good idea. I'll add the incompatibility about Snap. Or at least the non-out-of-boxness