All original content is created in Ukrainian. Not all content has been translated yet. Some posts may only be available in Ukrainian.Learn more

Setting up minikube on Mac with M1 (abandoning qemu, running on docker)

This content has been automatically translated from Ukrainian.
On Mac with M1, it's not so simple with minikube. After its installation, I encountered another error:
πŸ˜„  minikube v1.35.0 on Darwin 14.1.2 (arm64)
✨  Using the qemu2 driver based on user configuration

🀷  Exiting due to PROVIDER_QEMU2_NOT_FOUND: The 'qemu2' provider was not found: exec: "qemu-system-aarch64": executable file not found in $PATH
πŸ’‘  Suggestion: Install qemu-system
πŸ“˜  Documentation: https://minikube.sigs.k8s.io/docs/reference/drivers/qemu/
This requires a bit of effort.
We install qemu (yes, without 2)
brew install qemu
Then we do this trick to fix qemu issues (edk2-aarch64-code.fd). We will download edk2-aarch64-code.fd manually
curl -L -o edk2-aarch64-code.fd https://releases.linaro.org/components/kernel/uefi/edk2/latest/release/qemu64/edk2-aarch64-code.fd
Next, we replicate the directory structure and file:
sudo mkdir -p /opt/homebrew/opt/qemu/share/qemu
sudo mv edk2-aarch64-code.fd /opt/homebrew/opt/qemu/share/qemu/
After this, it should work:
minikube start --driver=qemu2
But after starting, it turns out that qemu will crash due to the accelerator, which does not work on M1. So we need to look for other options.
πŸ˜„  minikube v1.35.0 on Darwin 14.1.2 (arm64)
✨  Using the qemu2 driver based on user configuration
🌐  Automatically selected the builtin network
❗  You are using the QEMU driver without a dedicated network, which doesn't support minikube service & minikube tunnel commands.
To try the dedicated network see: https://minikube.sigs.k8s.io/docs/drivers/qemu/#networking
πŸ’Ώ  Downloading VM boot image ...
    > minikube-v1.35.0-arm64.iso....:  65 B / 65 B [---------] 100.00% ? p/s 0s
    > minikube-v1.35.0-arm64.iso:  393.15 MiB / 393.15 MiB  100.00% 6.28 MiB p/
πŸ‘  Starting "minikube" primary control-plane node in "minikube" cluster
πŸ’Ύ  Downloading Kubernetes v1.32.0 preload ...
    > preloaded-images-k8s-v18-v1...:  314.92 MiB / 314.92 MiB  100.00% 6.30 Mi
πŸ”₯  Creating qemu2 VM (CPUs=4, Memory=4096MB, Disk=15000MB) ...\ OUTPUT: 
ERROR: qemu-system-aarch64: -accel hvf: invalid accelerator hvf


πŸ”₯  Deleting "minikube" in qemu2 ...
🀦  StartHost failed, but will try again: creating host: create: creating: qemu-system-aarch64: -accel hvf: invalid accelerator hvf: exit status 1
πŸ”₯  Creating qemu2 VM (CPUs=4, Memory=4096MB, Disk=15000MB) ...\ OUTPUT: 
ERROR: qemu-system-aarch64: -accel hvf: invalid accelerator hvf


😿  Failed to start qemu2 VM. Running "minikube delete" may fix it: creating host: create: creating: qemu-system-aarch64: -accel hvf: invalid accelerator hvf: exit status 1
We give up on qemu and start minikube using the docker driver.
Install Docker (download the .dmg for arm64) from the official site. If you try to start immediately with the docker driver, you will get an error. You need to delete the existing minikube container:
minikube start --driver=docker

πŸ˜„  minikube v1.35.0 on Darwin 14.1.2 (arm64)

πŸ’’  Exiting due to GUEST_DRIVER_MISMATCH: The existing "minikube" cluster was created using the "qemu2" driver, which is incompatible with requested "docker" driver.
πŸ’‘  Suggestion: Delete the existing 'minikube' cluster using: 'minikube delete', or start the existing 'minikube' cluster using: 'minikube start --driver=qemu2'
We delete the container:
minikube delete

πŸ”₯  Deleting "minikube" in qemu2 ...
πŸ’€  Removed all traces of the "minikube" cluster.
And then everything is simple:
minikube start --driver=docker

πŸ˜„  minikube v1.35.0 on Darwin 14.1.2 (arm64)
✨  Using the docker driver based on user configuration
πŸ“Œ  Using Docker Desktop driver with root privileges
πŸ‘  Starting "minikube" primary control-plane node in "minikube" cluster
🚜  Pulling base image v0.0.46 ...
    > gcr.io/k8s-minikube/kicbase...:  452.84 MiB / 452.84 MiB  100.00% 6.76 Mi
πŸ”₯  Creating docker container (CPUs=4, Memory=4096MB) ...
🐳  Preparing Kubernetes v1.32.0 on Docker 27.4.1 ...
    β–ͺ Generating certificates and keys ...
    β–ͺ Booting up control plane ...
    β–ͺ Configuring RBAC rules ...
πŸ”—  Configuring bridge CNI (Container Networking Interface) ...
πŸ”Ž  Verifying Kubernetes components...
    β–ͺ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: storage-provisioner, default-storageclass
πŸ„  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
The created container will be visible in the Docker application.
minikube + docker
minikube + docker

This post doesn't have any additions from the author yet.

Embedded programming: what it is and how to get started
24 Mar 16:48

Embedded programming: what it is and how to get started

meme code
meme code@memecode
Pessimistic Lock in Rails: what it is and when to use it. What are the alternatives?
31 Mar 17:45

Pessimistic Lock in Rails: what it is and when to use it. What are the alternatives?

meme code
meme code@memecode
Why does PostgreSQL skip IDs when saving new records? (Heroku)
31 Mar 19:13

Why does PostgreSQL skip IDs when saving new records? (Heroku)

meme code
meme code@memecode
[Codecov] What is the difference between patch and project coverage?
09 Apr 16:03

[Codecov] What is the difference between patch and project coverage?

meme code
meme code@memecode
How do Scratch courses help children develop soft skills?
11 Apr 18:24

How do Scratch courses help children develop soft skills?

meme code
meme code@memecode
24 Apr 20:17

Fixing minikube "You are trying to run the amd64 binary on an M1 system."

meme code
meme code@memecode
Where to find an older version of Google Chrome and download it? Using an old Mac as an example.
25 Apr 23:02

Where to find an older version of Google Chrome and download it? Using an old Mac as an example.

meme code
meme code@memecode
09 May 19:27

[FIXED] cannot load such file -- html/pipeline (LoadError) occurs during rails generate thredded:install

meme code
meme code@memecode
Task: Convert a Roman numeral to decimal (Ruby)
20 May 12:05

Task: Convert a Roman numeral to decimal (Ruby)

meme code
meme code@memecode
Task to check the correctness of bracket placement (Ruby)
21 May 10:27

Task to check the correctness of bracket placement (Ruby)

meme code
meme code@memecode
How to find the maximum subarray sum in Ruby
22 May 11:01

How to find the maximum subarray sum in Ruby

meme code
meme code@memecode
Google Ads for Dummies: A Step-by-Step Guide for a Successful Start
28 May 10:21

Google Ads for Dummies: A Step-by-Step Guide for a Successful Start

meme code
meme code@memecode