kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.46k stars 4.89k forks source link

virtualbox: unable to start minikube on macOS Ventura #15274

Open andriymahats opened 2 years ago

andriymahats commented 2 years ago

What Happened?

After upgrading macOS to Ventura from Monterey the minikube start started to fail with the response:

😄  minikube v1.27.1 on Darwin 13.0
✨  Using the virtualbox driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating virtualbox VM (CPUs=2, Memory=8192MB, 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=8192MB, 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

Attach the log file

log.txt

Operating System

macOS (Default)

Driver

VirtualBox

crengifo commented 2 years ago

same issue, i've tried minikube delete and start and update virtualbox and nothing...

hakjoonglee commented 2 years ago

Same issue. I also tried minikube delete and start and updated VirtualBox version 7.0.2

TestRep1 commented 2 years ago

i have exactly the same issue.. Has anyone found a solution to this problem?

crengifo commented 2 years ago

Update 7.02 virtual box, solved the problem for me directly from virtual box site

spowelljr commented 2 years ago

@crengifo So it's working for you now on macOS Ventura with VirtualBox 7.02?

andriymahats commented 2 years ago

Update 7.02 virtual box, solved the problem for me directly from virtual box site

hmm, tried to reinstall latest virtual box (7.0.2 r154219). Issue remains for me

crengifo commented 2 years ago

@crengifo So it's working for you now on macOS Ventura with VirtualBox 7.02?

Yes, reinstalling obviously.

nrudnyk commented 2 years ago

Update 7.02 virtual box, solved the problem for me directly from virtual box site

didn't helped. Still facing same problem as described in the OP

chris15mLW commented 1 year ago

ugh I've tried everything -still an issue

W07FP4X commented 1 year ago

Same. Host only adapters are no longer supported on mac. I'm running podman until we get a VB driver update. brew install podman podman machine init --cpus 2 --memory 2048 --rootful podman machine start minikube config set driver podman minikube start minikube status

DmitriyStoyanov commented 1 year ago
image

Possibly we face with such issue because of in VirtualBox Host-only Adapter is DEPRECATED

martininnotec commented 1 year ago

@DmitriyStoyanov yep this is definitely the reason - as @W07FP4X said it's because Host-only adapters are no longer supported on Mac OS, we need to use a Host-only network instead.

I've configured my virtual machine manually to use this network setup and can connect to Minikube on the running VM.

Screenshot 2022-11-18 at 08 07 29

Screenshot 2022-11-18 at 08 07 36

Screenshot 2022-11-18 at 08 08 33

The only problem is the Minikube start command still wants to create/see a host-only adapter so fails and it doesn't seem to be able to see the running VM.

Unfortunately, I think we will need to look at running alternatives like Docker or Podman until a Virtualbox driver update for Minikube is released.

spowelljr commented 1 year ago

Thanks for discovering the root cause of the issue, I believe the change will need to be in the upstream project https://github.com/machine-drivers/machine, but I could be wrong.

martininnotec commented 1 year ago

Thanks for discovering the root cause of the issue, I believe the change will need to be in the upstream project https://github.com/machine-drivers/machine, but I could be wrong.

Yes, this code needs to be updated to use the Host-only network instead of the adapter for the new macOS.

https://github.com/machine-drivers/machine/blob/master/drivers/virtualbox/network.go

Has someone raised this with the upstream project?

jevy-wangfei commented 1 year ago

down grade virtualbox to 6.* would be able to resolve this Host-ony Adapter deprecated issue.

martininnotec commented 1 year ago

down grade virtualbox to 6.* would be able to resolve this Host-ony Adapter deprecated issue.

I tried the downgrade to Virtualbox 6.1 and the issue still persists when starting minikube.

d1ck50n commented 1 year ago

Encountered similar issue, and i downgrade virtualbox to older version 6.1 @ https://www.virtualbox.org/wiki/Download_Old_Builds_6_1 I'm able to launch minikube using command : minikube start --driver=virtualbox

pavgup commented 1 year ago

Just one more macOS user having no success with minikube because of this problem.

afbjorklund commented 1 year ago

@martininnotec

Has someone raised this with the upstream project?

The upstream project (docker-machine) is dead, so the feature will have to be developed by minikube...

It is possible to use the machine-driver organisation for hosting the patches, but it's not the upstream.

https://github.com/docker/machine/tree/master/drivers/virtualbox


For newer macOS, it needs to use hostonlynet instead of hostonlyif.

Then the interface will be created by the OS, when the network is used.

This also means that libmachine can't set the IP anymore, it will have to check which one it received.

But the docs say only that it (Host-Only Adapter ) is deprecated, not that it is removed already ?

afbjorklund commented 1 year ago

This is the tracker issue that @spowelljr created: (github.com/docker/machine is archived and read-only)

So far it (virtualbox2) only carries a small patch for FreeBSD, the rest of the driver is unmodified since v0.16.2

afbjorklund commented 1 year ago

Unfortunately, I think we will need to look at running alternatives like Docker or Podman until a Virtualbox driver update for Minikube is released.

If you run Docker or Podman with Oracle VirtualBox instead of their "Desktop", you would have the same problem...

You can try another hypervisor driver for Minikube, such as the QEMU driver. Or run minikube in Docker or Podman ?

But the best would be to fix the machine driver.

spowelljr commented 1 year ago

An upstream fix was merged (https://github.com/machine-drivers/machine/pull/39), I created a PR to update the dependency (https://github.com/kubernetes/minikube/pull/15729). Once the binaries are built I'll link them for anyone experiencing the issue to confirm if it resolves the issue for them, thanks.

spowelljr commented 1 year ago

If anyone could test these out and confirm whether it fixes the issue.

Intel CPU: https://storage.googleapis.com/minikube-builds/15729/minikube-darwin-amd64 Apple CPU: https://storage.googleapis.com/minikube-builds/15729/minikube-darwin-arm64

martininnotec commented 1 year ago

machine-drivers/machine#39

Hi @spowelljr - I've installed from the binary and still get the same error, only difference is I now get a warning at the top saying minikube doesn't support Virtualbox - am I doing something wrong?

Screenshot 2023-01-30 at 19 17 47

afbjorklund commented 1 year ago

@spowelljr

I think you need to set the HostLoopbackReachable in the config, when not using the docker-machine flags.

It is initialized in the NewDriver, but minikube has its own implementation in the minikube driver "registry"...

d.HostLoopbackReachable = true


EDIT: Hmm, minikube does call the virtualbox.NewDriver - so the defaults should be OK, only flags are missing

martininnotec commented 1 year ago

d.HostLoopbackReachable = true

Thanks, @afbjorklund - I'm not sure where this is configured, however looking at the config.json file on the minikube machine it appears to already have that value set...

Screenshot 2023-01-30 at 19 53 34

afbjorklund commented 1 year ago

https://github.com/kubernetes/minikube/blob/master/pkg/minikube/registry/drvs/virtualbox/virtualbox.go#L58

I don't think it uses those values in the JSON, i.e. it only uses the "ClusterConfig" and not the "Driver" from libmachine

afbjorklund commented 1 year ago

Hmm, maybe it would read the defaults. The best would be to look in the log, and see how VBox was started ?

There should be a --natlocalhostreachable1 in the flags.

afbjorklund commented 1 year ago

Doh! That fix was for a totally different issue.

The network change is still left to do, sorry about the noise.

martininnotec commented 1 year ago

No worries @afbjorklund - any ETA on a fix for the Host-only Adapter issue?

fffffreedom commented 1 year ago

No worries @afbjorklund - any ETA on a fix for the Host-only Adapter issue?

same question, anyone helps?

afbjorklund commented 1 year ago

There is no ETA, I am not sure if anyone is working on the problem at the moment ?

subhankar-banerjee commented 1 year ago

any idea when this will be resolved ? It was working last year and suddenly I can see few days back it stopped working ..

is that problem started after Mac update ?

yun14u commented 1 year ago

This is how I start my minikube,

brew install podman podman machine init --cpus 2 --memory 2048 --rootful podman machine start minikube start --kubernetes-version=1.24.8 --driver=podman --container-runtime=cri-o minikube status

k8s-triage-robot commented 9 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 8 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten