Skip to content

Instantly share code, notes, and snippets.

@slykar
Last active November 27, 2023 04:19
Star You must be signed in to star a gist
Embed
What would you like to do?
Docker and Docker Compose on AMD OSX Hackintosh via Docker Machine

Introduction

Docker.app will complain about incompatible processor, so we will use Docker Machine.

Instalation

Download Docker for Mac (Docker.app). It contains some binaries that are necessary.

brew install virtualbox docker-machine

# Normally, those links are created automatically by running Docker.app,
# but it quits on us too early, so we need to do this manually
ln -s "/Applications/Docker.app/Contents//Resources/bin/docker-compose" /usr/local/bin/docker-compose
ln -s "/Applications/Docker.app/Contents//Resources/bin/docker-credential-desktop" /usr/local/bin/docker-credential-desktop
ln -s "/Applications/Docker.app/Contents//Resources/bin/docker-credential-osxkeychain" /usr/local/bin/docker-credential-osxkeychain

You can also use brew to install docker and doccker-compose and it should work without linking above.

Running

docker-machine create
eval $(docker-machine env)
docker run hello-world
docker-compose up
@brorbw
Copy link

brorbw commented Apr 17, 2023

Let me add that you can now use

brew tap homebrew/cask-versions
brew install --cask virtualbox6

To install the correct version of Virtualbox

@phtmgt
Copy link

phtmgt commented Jul 19, 2023

Thanks for the guide. It works here (ryzentosh Ventura). However, there's an issue with VirtualBox 6.1.40 - it uses double the amount of RAM (e.g., if you allocate 4.0 GB, you can check Activity Monitor where you'll see ~8.0 GB used). The issue is documented here - https://www.virtualbox.org/ticket/19726

Not a deal breaker, but might be problematic for some. An older version - 6.1.2 r135662 - does not have the double memory issue, I am not sure, if it will work in this case. If someone tries it, please share feedback.

@adesheddie
Copy link

@phtmgt @dheerajv4855
Have you guys tried running an android emulator using Virtual Box?

@adesheddie
Copy link

Thanks for the guide. It works here (ryzentosh Ventura). However, there's an issue with VirtualBox 6.1.40 - it uses double the amount of RAM (e.g., if you allocate 4.0 GB, you can check Activity Monitor where you'll see ~8.0 GB used). The issue is documented here - https://www.virtualbox.org/ticket/19726

Not a deal breaker, but might be problematic for some. An older version - 6.1.2 r135662 - does not have the double memory issue, I am not sure, if it will work in this case. If someone tries it, please share feedback.

the double RAM issue is real, and 6.1.2 r135662 doesn't work on Ventura/Sonoma.
So we are stuck with this virtualbox version having double RAM issue.

@phtmgt
Copy link

phtmgt commented Oct 14, 2023

@phtmgt @dheerajv4855
Have you guys tried running an android emulator using Virtual Box?

I have not tried. If you find a way, though, please share, as it would be useful.

@coderpradp
Copy link

coderpradp commented Oct 16, 2023

@johnalbert-dot-py did you manage to work it out? I'm in similar situation as you were.

Disabled KEXT signing in SIP
❯
./csrstat
csrstat v2.0 Copyright (c) 2015-2017 by Pike R. Alpha, 2017-2023 by Joss Brown
System Integrity Protection status: enabled (0x00000003) (Custom Configuration).

Current Configuration:
	Apple Internal                  disabled
	Kext Signing                    disabled
	Debugging Restrictions          enabled
	Filesystem Protections          disabled
	Kernel Debugging Restrictions   enabled
	DTrace Restrictions             enabled
	NVRAM Protections               enabled
	Device Configuration            disabled
	BaseSystem Verification         enabled
	Unapproved Kexts Restrictions   enabled
	Executable Policy               enabled

Boot into Recovery Mode and modify with: 'csrutil enable [arguments]'
<Note: some flags are not accessible using the csrutil CLI.>

This is an unsupported configuration, likely to break in the future and leave your machine in an unknown state.
❯
csrutil status
System Integrity Protection status: unknown (Custom Configuration).

Configuration:
	Apple Internal: disabled
	Kext Signing: disabled
	Filesystem Protections: disabled
	Debugging Restrictions: enabled
	DTrace Restrictions: enabled
	NVRAM Protections: enabled
	BaseSystem Verification: enabled

This is an unsupported configuration, likely to break in the future and leave your machine in an unknown state.
Installed VB 6.1.40
❯
VBoxManage --version
6.1.40r154048

When running minikube start --driver=virtualbox --keep-context I get following error:

❯
minikube start --driver=virtualbox --keep-context
😄  minikube v1.31.2 on Darwin 14.0
✨  Using the virtualbox driver based on user configuration
❗  Due to changes in macOS 13+ minikube doesn't currently support VirtualBox. You can use alternative drivers such as docker or hyperkit.
    https://minikube.sigs.k8s.io/docs/drivers/docker/
    https://minikube.sigs.k8s.io/docs/drivers/hyperkit/

    For more details on the issue see: https://github.com/kubernetes/minikube/issues/15274

👍  Starting control plane node minikube in cluster minikube
🔥  Creating virtualbox VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
🔥  Deleting "minikube" in virtualbox ...
🤦  StartHost failed, but will try again: creating host: create: creating: Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue
🔥  Creating virtualbox VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
😿  Failed to start virtualbox VM. Running "minikube delete" may fix it: creating host: create: creating: Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue

❌  Exiting due to IF_VBOX_NOT_VISIBLE: Failed to start host: creating host: create: creating: Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is is supposed to fix this issue
💡  Suggestion: Reboot to complete VirtualBox installation, verify that VirtualBox is not blocked by your system, and/or use another hypervisor
📘  Documentation: https://stackoverflow.com/questions/52277019/how-to-fix-vm-issue-with-minikube-start
🍿  Related issues:
    ▪ https://github.com/kubernetes/minikube/issues/3614
    ▪ https://github.com/kubernetes/minikube/issues/4222
    ▪ https://github.com/kubernetes/minikube/issues/5817

@coderpradp
Copy link

I managed to solve this issue by clicking Allow button under Privacy & Security section in Settings after the installation of Virtualbox6 and restarting.

After that minikube start --driver=virtualbox --keep-context without issue

@adesheddie
Copy link

@phtmgt @dheerajv4855
Have you guys tried running an android emulator using Virtual Box?

I have not tried. If you find a way, though, please share, as it would be useful.

I actually managed to install VB6.xxx something version. The performance was at par, really good.
But it was full of bugs, whenever I tried to launch a VM, the host PC would just freeze itself. I had to restart the PC, then launch the VM again, worked fine.
But when I stop the VM, and relaunch, it would freeze the host PC again.

In short, Ryzentosh is really bad for virtualisation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment