Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker in mac Virtual machine #331

Open
Animezjy opened this issue Aug 23, 2021 · 9 comments
Open

Docker in mac Virtual machine #331

Animezjy opened this issue Aug 23, 2021 · 9 comments

Comments

@Animezjy
Copy link

I want to start docker in a mac virtual machine.
How do I set up hardware virtualization I have successfully installed the mac virtual machine?

@omarahm3
Copy link

I'm having the same issue, running latest docker on guest will throw "Incompatible CPU detected error" and that it requires a processor with virtualization and hypervisor support.
@sickcodes any idea how to have this done? i'm using Big Sur BTW

@sickcodes
Copy link
Owner

sickcodes commented Aug 25, 2021

https://github.com/KhaosT/MacVM

This works on Monterrey M1 hardware, I would like to test it this week on virtual

Edit: failed on Ryzen, unaware of Intel results though

@omarahm3
Copy link

@sickcodes It worked after applying changes from here #312 and just:

docker run -it --device /dev/kvm -p 50922:10022 -v ~/mac_hdd_ng_auto_big_sur.img:/image -v /tmp/.X11-unix:/tmp/.X11-unix -e 'NOPICKER=false' -e 'DISPLAY=:0' -e 'RAM=half'  sickcodes/docker-osx:naked

@thematrixdev
Copy link

thematrixdev commented Sep 24, 2021

I need to run Docker or Virtualbox on Docker-OSX as well.
As far as I understand from @omarking05 's lastest message, cpu=max is already merged in the latest release.
The virtual CPU could not be identified to be KVM compatible.
Even I am specifying this, it does not work neither.

I am using docker-compose up instead of running the command line for ease of future modification.

version: '3.8'
services:
macosx:
container_name: macosx
image: sickcodes/docker-osx:big-sur
devices:
- /dev/kvm:/dev/kvm
ports:
- 50922:10022
- 51820:51820/udp
volumes:
- /home/user/Downloads:/mnt/hostshare
- /tmp/.X11-unix:/tmp/.X11-unix
- data:/home
environment:
- CPU=max
- RAM=4
- NETWORKING=vmxnet3
- DISPLAY=${DISPLAY:-:0.0}
- GENERATE_UNIQUE=true
- WIDTH=1280
- HEIGHT=720
- ADDITIONAL_PORTS=hostfwd=udp::51820-:51820
- EXTRA=-virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=passthrough,id=hostshare
privileged: true
cap_add:
- ALL
volumes:
data:

May I know what have I done wrongly?

@sickcodes
Copy link
Owner

qemu-system-x86
-cpu max,vendor=GenuineIntel \
-machine q35,${KVM-"accel=kvm:tcg"} \

I am considering the following changes.

VMX doesn't show up, but apparently it should work on Intel.

I will give it a test on Digital Ocean, which lets you select AMD or Intel, unless someone wants to.

@thematrixdev
Copy link

Making - EXTRA=-cpu max,vendor=GenuineIntel -M q35,accel=kvm, Docker-OSX "boots-loop".
May you please take a look on this?
image

@thematrixdev
Copy link

I can use QEMU without hardware acceleration. If anyone needs Docker you may take a look on this issue:
#346

@sickcodes
Copy link
Owner

Making - EXTRA=-cpu max,vendor=GenuineIntel -M q35,accel=kvm, Docker-OSX "boots-loop". May you please take a look on this? image

This won't work as it's already defined above in the variable called CPU

This will work though (testing rn):

-e CPU=max \
-e CPUID_FLAGS='vendor=GenuineIntel' \

@thematrixdev
Copy link

It boots only without setting CPU=max.
With CPU=max set it just keeps bootloop.

version: '3.8'
services:
osx:
container_name: osx
image: sickcodes/docker-osx:big-sur
devices:
- /dev/kvm
ports:
- 222:222/tcp
- 2222:2222/tcp
- 5999:5999/tcp
- 51821:51821/udp
volumes:
- /home/y2kbug/Downloads:/mnt/hostshare
- /tmp/.X11-unix:/tmp/.X11-unix
- home:/home
environment:
#- CPU=max
- "CPUID_FLAGS=vendor=GenuineIntel"
- RAM=4
- SMP=4
- NETWORKING=vmxnet3
- DISPLAY=${DISPLAY:-:0.0}
- WIDTH=1920
- HEIGHT=1080
- GENERATE_UNIQUE=true
- ADDITIONAL_PORTS=hostfwd=tcp::222-:22,hostfwd=tcp::2222-:2222,hostfwd=udp::51821-:51821
- "EXTRA=-M q35,accel=kvm -display none -vnc 0.0.0.0:99 -virtfs local,path=/mnt/hostshare,mount_tag=hostshare,security_model=pas>
privileged: true
cap_add:
- ALL
volumes:
home:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants