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.1k stars 1.78k forks source link

Run Docker-OSX on Apple Silicon #236

Open yousifa opened 3 years ago

yousifa commented 3 years ago

Has anyone been able to get this running on an M1 mac? I know the main point here is to get it running on linux machines, but I'm trying to run OSX on an M1 mac and pass through M1 performance to use certain apple frameworks w/ kubernetes.

W/docker I get the following error WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory.

hareesh309 commented 3 years ago

I too facing the similar kind of issue.. How to go ahead with this?

Status: Downloaded newer image for sickcodes/docker-osx:big-sur docker: Error response from daemon: error gathering device information while adding custom device "/dev/kvm": no such file or directory. ERRO[0095] error waiting for container: context canceled

esnosy commented 3 years ago

Short answer your best bet is just use Parallels and run a traditional MacOSX VM in there.

Another thing is you may not need to virtualise mac os, you already have it, even x86 apps should be able to run directly using Rosetta2

AFAIK, docker-osx relies on KVM(Kernel-based Virtual Machine), which is only available on Linux, on Mac devices you can run Parallels which said to have support for M1. Your other option is to virtualise Linux, then run docker-osx there, but that would require nested virtualisation, which M1 might not support. I think another way would be to install Linux directly on the Mac, but not sure if that would work either.

sickcodes commented 3 years ago

You can remove the KVM argument, and accelerate either over TCG or no acceleration, I don't have an M1 to test on currently

DerZyklop commented 2 years ago

It gives me the same errors like the M1/arm version, (for which I don’t know the reason yet) but the warning

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

disappears when I run it like this

docker run --platform linux/amd64 sickcodes/docker-osx:latest
liadmord commented 2 years ago

Using --platform linux/amd64 works as a workaround but the best solution would be to build all the images to arm and upload them, is there any plan to do this?

ylluminate commented 1 year ago

https://github.com/sickcodes/Docker-OSX/issues/547