mirror of
https://github.com/sickcodes/Docker-OSX.git
synced 2026-01-13 05:50:27 +01:00
Permissions issues with qemu-system-x86_64 #2
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 @xlash123 on GitHub (Jun 4, 2020).
When running the provided run command:
sudo docker run --privileged -v /tmp/.X11-unix:/tmp/.X11-unix sickcodes/docker-osx, I get the following errors:I'm not sure what I did wrong. Even running the docker command with sudo doesn't do anything (not that I really expected it to).
The image I pulled is the one from Docker Hub of digest starting with 0eea6e25babb.
I'm running this with Docker CE version 19.03.11, build 42e35e61f3 on Ubuntu 18.04.
@sickcodes commented on GitHub (Jun 4, 2020):
I've just checked the Docker Hub version and it works for me.
I added some KVM instructions to the readme.
Try the KVM section of the readme and you should be good to go.
@xlash123 commented on GitHub (Jun 4, 2020):
Ah, ok. I didn't know I needed to have that stuff installed as well on the host. I will test it out.
@ghost commented on GitHub (Jun 4, 2020):
I'm also having the issue. It seems that
archisn't added to thekvmandlibvirtdgroups and doesn't have permission to use kvm.EDIT: also
/dev/kvmneeds to be owned by thekvmgroup@roryrjb commented on GitHub (Jun 4, 2020):
You may have more luck with something like this:
@xlash123 commented on GitHub (Jun 4, 2020):
I have installed those dependencies and ran the systemctl commands and rebooted, but there's a new error now:
I noticed that one of the services that you said to start, virtlogd, doesn't seem to want to start. When running
service --status-all, I get (for related services):The log for that service is:
Any ideas on where to go from here?
@sickcodes commented on GitHub (Jun 4, 2020):
Check if your hardware virt is on
egrep -c '(svm|vmx)' /proc/cpuinfoTry this
sudo usermod -aG docker $USERTurn on docker daemon
sudo nohup dockerd &@xlash123 commented on GitHub (Jun 4, 2020):
@sickcodes, I already have virt turned on, docker daemon running, and am part of the docker user group.
The connection refused error went away (not sure how), but the permissions error is still there. Could it be that the user running in the Docker container is trying to use
kvmon my machine, but it's not in the user group for KVM, so it fails? I noticed I get the same permissions error when I runkvmon my machine, but since I added myself to the usergroup, the error went away.@sickcodes commented on GitHub (Jun 4, 2020):
Try adding all these:
sudo apt install qemu qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager uml-utilities libguestfs-toolsEDIT: not required, see below for anyone reading.
@luposlip commented on GitHub (Jun 4, 2020):
I've tried anything in the README and here, and (also) still have the same issue:
Ubuntu (Pop! OS) 20.04 BTW
@ghost commented on GitHub (Jun 4, 2020):
@sickcodes
archisn't a member of thekvmandlibvirtdgroups/dev/kvmneeds to be owned by thekvmgroupthose two issues cause the permission denied error
@xlash123 commented on GitHub (Jun 4, 2020):
Why are we running qemu on the host? Can't that go inside the Docker container?
@luposlip commented on GitHub (Jun 4, 2020):
Just tried
ghgrp kvm /dev/kvm. Nowls -la /dev/kvmreveals:Still same error.
@sickcodes commented on GitHub (Jun 4, 2020):
Mines like this
crw-rw-rw- 1 root kvm 10, 232 Jun 5 03:20 kvm
Try this:
@Write commented on GitHub (Jun 4, 2020):
Thanks, it worked for me. Ubuntu 20.04
I still had to sudo and get a few 'errors' but at least QEMU launched and macOS is loading
@sickcodes commented on GitHub (Jun 4, 2020):
These steps should set your host up for the QEMU on https://help.ubuntu.com/community/KVM/Installation
@xlash123 commented on GitHub (Jun 4, 2020):
I got it working after running
sudo chmod 666 /dev/kvmand usingdocker run --privileged --net host --cap-add=ALL -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev:/dev -v /lib/modules:/lib/modules sickcodes/docker-osxto start it. I'll try to isolate exactly what combination of tricks here got it to work.@xlash123 commented on GitHub (Jun 4, 2020):
Using the original run command
docker run --privileged -v /tmp/.X11-unix:/tmp/.X11-unix sickcodes/docker-osxdid not work. I had to use @roryrjb 's command. I did not need sudo for it to work.For as much as I can tell, I only needed to run the following commands to get it working:
It's hard for me to exactly narrow down what needs to be run because I'd have to undo some of the other suggestion to see where it breaks. Hopefully this is all that's needed.
@sickcodes commented on GitHub (Jun 4, 2020):
Good to hear mate, I've added those tips to the troubleshooting page.
It's probably both of those commands that you need might need, someone else might have a better answer to why.
@xlash123 commented on GitHub (Jun 4, 2020):
Also, after a relog/restart, I had to rerun
sudo chmod 666 /dev/kvmto get it to work again.@sickcodes commented on GitHub (Jun 4, 2020):
Sticky tape fix but:
printf '\n%s\n' "sudo chmod 666 /dev/kvm" >> ~/.bashrcIt will turn on every relog.
or just edit it and add that at the bottom.
Something else might be fiddling with the permissions on reboot.
@luposlip commented on GitHub (Jun 4, 2020):
After trying everything above - including following the qemu guide, this is the best I can get:
Seems like a lot of audio issues, I have alsa installed, and can restart it without errors with
sudo alsa reload.Plus the last gtk.
@sickcodes commented on GitHub (Jun 4, 2020):
Ignore the alsa utils error, it will always be there unless I change the OpenBoot-Core.sh script from upstream repo.
Regarding the gtk error
Show the output of these:
My output is:
Are you running Wayland window manager?
@luposlip commented on GitHub (Jun 4, 2020):
Mine is:
I'm using the default Pop! OS windows manager (not sure which one that is).
@muedie commented on GitHub (Jun 4, 2020):
Same issue here, outputs of above:
805 /usr/lib/Xorg -nolisten tcp -auth /var/run/sddm/{435e64b6-b308-4c8b-bafc-719e3f9be6c8} -background none -noreset -displayfd 17 -seat seat0 vt1:0xterm-256colorrunning manjaro-kde
@mtdlewald commented on GitHub (Jun 4, 2020):
Same issue here running i3 on Arch
658 /usr/lib/Xorg -nolisten tcp -auth /var/run/sddm/{b0ec8f2a-fcc9-4dc4-9ef6-61b57a970849} -background none -noreset -displayfd 17 -seat seat0 vt1
:0
alacritty
@sickcodes commented on GitHub (Jun 5, 2020):
Does this alternative application run without the error?
docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix tukiyo3/teamviewer15If you get the same error then it might have something to do with the x11 folder or the display number
In the dockerfile, you can change the :0.0 to :0
That might work but it will take half an hour to build so I apologize in advance if it’s not the solution.
Might have to dig deeper into the GTK error, could be missing some host libs since I am using Xfce and it’s window mananger compositor.
Try pulling the image again as well just in case.
Try installing virt-manager on the host. What does virt-manager look like on you guys’ displays?
If all else fails, try installing the AUR qt5 virt mananger it takes like 20 mins but it fills all the lib gaps, if there are any.
I’ll b back in a few hours though
@sickcodes commented on GitHub (Jun 5, 2020):
The dockerfile is trying to display on :0.0 but your desktop is running in :1. I will add the optional display argument.
If you want to build it now, just edit the Dockerfile and change the display env variable near the bottom to whichever number display you have. I again apologize if that’s not the error though but some other debugging messages might pop up during the build too and that could help.
@luposlip commented on GitHub (Jun 5, 2020):
I'll try tomorrow, it's getting really late now in Europe ;)
@muedie commented on GitHub (Jun 5, 2020):
Output of running teamviewer:
Tried passing DISPLAY=:0 from docker flags as well --env DISPLAY=:0
& installed qt-virt-manager still no luck
@sickcodes commented on GitHub (Jun 5, 2020):
Ok it's an env issue, changing it now to always choose whichever display you're looking at
@sickcodes commented on GitHub (Jun 5, 2020):
@luposlip commented on GitHub (Jun 6, 2020):
the x11-server-utils was already installed on my machine.
host +doesn't work.But this boots OSX for me!
@Anon-Exploiter commented on GitHub (Jun 7, 2020):
Thanks, changing the permissions of /dev/kvm and @roryrjb command did it for me.
@sickcodes commented on GitHub (Jun 8, 2020):
@luposlip I apologize for the host plus command, it was acutally a typo and it should be:
xhost +Both chmod 666 and the DISPLAY commands are in the README for a few days now as well, so I will close this issue again.
I fixed all the comments where I had written the typo.
@EmmanuelZapata commented on GitHub (Jun 14, 2020):
Any help getting this to work on Unraid??
@stormfleet commented on GitHub (Apr 1, 2021):
In case anyone is a major bogus numpty like me - everyone here is getting
qemu-system-x86_64: Permission denied, that is not the same as#qemu-system-x86_64: failed to initialize kvm: Device or resource busy # qemu-system-x86_64: falling back to tcg. You can't have VirtualBox or any other virtualisation software running at the same time, so closing VBox in my case solved this, and then @roryrjb's comment worked fine along with thechmod 666 /dev/kvm.