Go to file
Nicolas Busseneau 02a43c52e2
virtualbox: change default `host-only-cidr`
We change the default `--host-only-cidr` to `192.168.59.1/24` in order
to be compatible with the new default host-only networking restrictions
implemented in VirtualBox 6.1.28.

This fixes access denied errors on `minikube start` when using
VirtualBox >= 6.1.28:

```
VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available)
VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp
```

More details:

VirtualBox 6.1.28 introduced new restrictions on host-only networking:
https://www.virtualbox.org/wiki/Changelog-6.1#v28

Manual: https://www.virtualbox.org/manual/ch06.html#network_hostonly

> On Linux, Mac OS X and Solaris Oracle VM VirtualBox will only allow IP
> addresses in 192.68.56.0/21 range to be assigned to host-only
> adapters. For IPv6 only link-local addresses are allowed. If other
> ranges are desired, they can be enabled by creating
> /etc/vbox/networks.conf and specifying allowed ranges there. For
> example, to allow 10.0.0.0/8 and 192.168.0.0/16 IPv4 ranges as well as
> 2001::/64 range put the following lines into /etc/vbox/networks.conf:
>
>      * 10.0.0.0/8 192.168.0.0/16
>      * 2001::/64
>
> Lines starting with the hash # are ignored. Next example allows any
> addresses, effectively disabling range control:
>
>      * 0.0.0.0/0 ::/0

These new restrictions manifest in the form of the following issue on
`minikube start` due to the default `--host-only-cidr` used by the
VirtualBox driver being `192.168.99.1/24`:

```console
😄  minikube v1.23.2 on Ubuntu 18.04
  Using the virtualbox driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating virtualbox VM (CPUs=2, Memory=6000MB, 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: /usr/bin/VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.99.1 --netmask 255.255.255.0 failed:
VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available)
VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp

🔥  Creating virtualbox VM (CPUs=2, Memory=6000MB, 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: /usr/bin/VBoxManage hostonlyif ipconfig vboxnet1 --ip 192.168.99.1 --netmask 255.255.255.0 failed:
VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available)
VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp

  Exiting due to GUEST_PROVISION: Failed to start host: creating host: create: creating: Error setting up host only network on machine start: /usr/bin/VBoxManage hostonlyif ipconfig vboxnet1 --ip 192.168.99.1 --netmask 255.255.255.0 failed:
VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available)
VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp

╭───────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                           │
│    😿  If the above advice does not help, please let us know:                             │
│    👉  https://github.com/kubernetes/minikube/issues/new/choose                           │
│                                                                                           │
│    Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue.    │
│                                                                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
```

While the above is the primary error, other errors will be reported if
the adapter already exists (this happens when the adapter was created
before updating to VirtualBox 6.1.28, on a version of VirtualBox without
the new restrictions). Some examples:

```
 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
```

```
  minikube is unable to connect to the VM: dial tcp 192.168.99.112:22: i/o timeout

	This is likely due to one of two reasons:

	- VPN or firewall interference
	- virtualbox network configuration issue

	Suggested workarounds:

	- Disable your local VPN or firewall software
	- Configure your local VPN or firewall to allow access to 192.168.99.112
	- Restart or reinstall virtualbox
	- Use an alternative --vm-driver
	- Use --force to override this connectivity check

  Exiting due to GUEST_PROVISION: Failed to validate network: dial tcp 192.168.99.112:22: i/o timeout
```

When switching to a valid CIDR, `minikube start` works as usual:

```console
😄  minikube v1.23.2 on Ubuntu 18.04
  Using the virtualbox driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating virtualbox VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.22.2 on Docker 20.10.8 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🔎  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
```

Signed-off-by: Nicolas Busseneau <nicolas@isovalent.com>
2021-11-02 15:30:46 +01:00
.github Merge pull request #12578 from AliyunContainerService/aliyun-mirror 2021-10-26 13:22:30 -07:00
cmd virtualbox: change default `host-only-cidr` 2021-11-02 15:30:46 +01:00
deploy Merge pull request #12779 from sharifelgamal/gcp-auth-test2 2021-10-26 22:37:22 -07:00
enhancements Fix links in flake-rate implemented proposal. 2021-07-27 11:41:21 -07:00
hack set env vars correctly so go install works 2021-10-26 15:06:54 -07:00
images/logo Fix white version of SVG logo (icon) 2020-09-26 14:45:59 +02:00
installers Remove quotes from fields of Windows Installer 2021-09-08 22:25:24 +09:00
pkg virtualbox: change default `host-only-cidr` 2021-11-02 15:30:46 +01:00
site virtualbox: change default `host-only-cidr` 2021-11-02 15:30:46 +01:00
test Merge pull request #12779 from sharifelgamal/gcp-auth-test2 2021-10-26 22:37:22 -07:00
third_party Move from deprecated ioutil to os and io packages 2021-10-08 08:57:19 +08:00
translations Merge pull request #12507 from yosshy/japanese-translation2 2021-10-25 14:50:34 -07:00
.codecov.yml make codecov bot to comment on PRs 2019-09-25 11:48:40 -07:00
.dockerignore Add a .dockerignore to make image builds faster. 2017-11-06 13:01:01 -08:00
.gitignore Remove translations.go from .gitignore. 2021-06-17 15:06:24 -07:00
.gitmodules create automated time-to-k8s benchmarks on release 2021-06-15 10:17:46 -07:00
.markdownlint.json Run markdownlint on all the md files in docs 2019-03-10 20:06:04 +01:00
CHANGELOG.md v1.23.2 release 2021-09-21 13:58:55 -07:00
CONTRIBUTING.md fix outdate url 2021-03-18 19:58:11 +08:00
LICENSE Update License file 2016-04-15 15:44:00 -07:00
Makefile bump golang versions 2021-10-18 09:02:31 +00:00
OWNERS OWNERS file cleanup 2021-07-20 10:49:11 -07:00
README.md add ci docs 2021-08-23 15:54:58 -07:00
SECURITY.md Add SECURITY.md 2020-07-27 16:03:26 -06:00
SECURITY_CONTACTS Update security contacts 2019-07-10 10:48:31 -07:00
code-of-conduct.md Update code-of-conduct.md 2017-12-20 13:39:35 -05:00
default.profraw fix ci machine for docker on macos 2020-03-25 15:11:03 -07:00
go.mod Merge branch 'master' into dependabot/go_modules/cloud.google.com/go/storage-1.18.2 2021-10-25 15:23:42 -07:00
go.sum Merge branch 'master' into dependabot/go_modules/cloud.google.com/go/storage-1.18.2 2021-10-25 15:23:42 -07:00
netlify.toml update hugo version to 0.83.1 2021-05-18 00:01:16 -04:00
sonar-project.properties Rename test-report.* to out/unittest.* 2021-04-20 21:31:49 +02:00
test.sh fix boilerplate for time-to-k8s git submodule 2021-08-14 14:39:49 +01:00

README.md

minikube

Actions Status GoReport Widget Github All Releases Latest Release

minikube logo

minikube implements a local Kubernetes cluster on macOS, Linux, and Windows. minikube's primary goals are to be the best tool for local Kubernetes application development and to support all Kubernetes features that fit.

screenshot

Features

minikube runs the latest stable release of Kubernetes, with support for standard Kubernetes features like:

As well as developer-friendly features:

For more information, see the official minikube website

Installation

See the Getting Started Guide

📣 Please fill out our fast 5-question survey so that we can learn how & why you use minikube, and what improvements we should make. Thank you! 👯

Documentation

See https://minikube.sigs.k8s.io/docs/

More Examples

See minikube in action here

Community

minikube is a Kubernetes #sig-cluster-lifecycle project.

Join our meetings: