2016-06-30 21:06:27 +00:00
# Driver plugin installation
Minikube uses Docker Machine to manage the Kubernetes VM so it benefits from the
driver plugin architecture that Docker Machine uses to provide a consistent way to
manage various VM providers. Minikube embeds VirtualBox and VMware Fusion drivers
so there are no additional steps to use them. However, other drivers require an
extra binary to be present in the host PATH.
The following drivers currently require driver plugin binaries to be present in
the host PATH:
2017-11-29 20:20:29 +00:00
* [KVM2 ](#kvm2-driver )
2016-06-30 21:06:27 +00:00
* [KVM ](#kvm-driver )
2017-11-24 18:44:51 +00:00
* [Hyperkit ](#hyperkit-driver )
2016-06-30 21:06:27 +00:00
* [xhyve ](#xhyve-driver )
2017-08-04 15:42:56 +00:00
* [HyperV ](#hyperv-driver )
2016-06-30 21:06:27 +00:00
2017-11-29 20:20:29 +00:00
#### KVM2 driver
The KVM2 driver is intended to replace KVM driver.
The KVM2 driver is maintained by the minikube team, and is built, tested and released with minikube.
To install the KVM2 driver, first install and configure the prereqs:
```
# Install libvirt and qemu-kvm on your system, e.g.
# Debian/Ubuntu (for Debian Stretch libvirt-bin it's been replaced with libvirt-clients and libvirt-daemon-system)
$ sudo apt install libvirt-bin qemu-kvm
# Fedora/CentOS/RHEL
$ sudo yum install libvirt-daemon-kvm qemu-kvm
# Add yourself to the libvirtd group (use libvirt group for rpm based distros) so you don't need to sudo
# Debian/Ubuntu (NOTE: For Ubuntu 17.04 change the group to `libvirt`)
$ sudo usermod -a -G libvirtd $(whoami)
# Fedora/CentOS/RHEL
$ sudo usermod -a -G libvirt $(whoami)
# Update your current session for the group change to take effect
# Debian/Ubuntu (NOTE: For Ubuntu 17.04 change the group to `libvirt`)
$ newgrp libvirtd
# Fedora/CentOS/RHEL
$ newgrp libvirt
```
Then install the driver itself:
```
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 & & chmod +x docker-machine-driver-kvm2 & & sudo mv docker-machine-driver-kvm2 /usr/bin/
```
2016-06-30 21:06:27 +00:00
#### KVM driver
2017-05-01 18:17:24 +00:00
Minikube is currently tested against [`docker-machine-driver-kvm` v0.10.0 ](https://github.com/dhiltgen/docker-machine-kvm/releases ).
2016-07-13 10:40:24 +00:00
2017-05-01 18:17:24 +00:00
After following the instructions on the KVM driver releases page, you need to make sure that have the necessary packages and permissions by following these instructions:
2016-07-13 10:40:24 +00:00
```
2017-05-03 21:53:51 +00:00
2016-07-13 10:40:24 +00:00
# Install libvirt and qemu-kvm on your system, e.g.
2017-09-03 12:53:42 +00:00
# Debian/Ubuntu (for Debian Stretch libvirt-bin it's been replaced with libvirt-clients and libvirt-daemon-system)
2016-07-13 10:40:24 +00:00
$ sudo apt install libvirt-bin qemu-kvm
2016-11-18 06:13:33 +00:00
# Fedora/CentOS/RHEL
2017-08-08 14:32:57 +00:00
$ sudo yum install libvirt-daemon-kvm qemu-kvm
2016-07-13 10:40:24 +00:00
2016-11-18 06:13:33 +00:00
# Add yourself to the libvirtd group (use libvirt group for rpm based distros) so you don't need to sudo
2017-06-05 13:04:07 +00:00
# Debian/Ubuntu (NOTE: For Ubuntu 17.04 change the group to `libvirt`)
2016-07-13 10:40:24 +00:00
$ sudo usermod -a -G libvirtd $(whoami)
2017-02-26 12:30:31 +00:00
# Fedora/CentOS/RHEL
$ sudo usermod -a -G libvirt $(whoami)
2016-07-13 10:40:24 +00:00
# Update your current session for the group change to take effect
2017-06-05 13:04:07 +00:00
# Debian/Ubuntu (NOTE: For Ubuntu 17.04 change the group to `libvirt`)
2016-07-13 10:40:24 +00:00
$ newgrp libvirtd
2017-02-26 12:30:31 +00:00
# Fedora/CentOS/RHEL
$ newgrp libvirt
2016-07-13 10:40:24 +00:00
```
2016-06-30 21:06:27 +00:00
2017-11-24 18:44:51 +00:00
#### Hyperkit driver
The Hyperkit driver will eventually replace the existing xhyve driver.
It is built from the minikube source tree, and uses [moby/hyperkit ](http://github.com/moby/hyperkit ) as a Go library.
To install the hyperkit driver:
```
2017-11-29 14:35:44 +00:00
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit & & chmod +x docker-machine-driver-hyperkit & & sudo mv docker-machine-driver-hyperkit /usr/local/bin/ & & sudo chown root:wheel /usr/local/bin/docker-machine-driver-hyperkit & & sudo chmod u+s /usr/local/bin/docker-machine-driver-hyperkit
2017-11-24 18:44:51 +00:00
```
The hyperkit driver currently requires running as root to use the vmnet framework to setup networking.
2016-06-30 21:06:27 +00:00
#### xhyve driver
From https://github.com/zchee/docker-machine-driver-xhyve#install:
```
$ brew install docker-machine-driver-xhyve
# docker-machine-driver-xhyve need root owner and uid
$ sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
```
2017-04-10 14:57:42 +00:00
2016-12-13 18:56:21 +00:00
#### HyperV driver
2017-04-10 14:57:42 +00:00
Hyper-v users may need to create a new external network switch as described [here ](https://docs.docker.com/machine/drivers/hyper-v/ ). This step may prevent a problem in which `minikube start` hangs indefinitely, unable to ssh into the minikube virtual machine. In this add, add the `--hyperv-virtual-switch=switch-name` argument to the `minikube start` command.
2017-07-23 20:13:43 +00:00
2017-08-17 01:26:57 +00:00
On some machines, having **dynamic memory management** turned on for the minikube VM can cause problems of unexpected and random restarts which manifests itself in simply losing the connection to the cluster, after which `minikube status` would simply state `localkube stopped` . Machine restarts are caused due to following Hyper-V error: `The dynamic memory balancer could not add memory to the virtual machine 'minikube' because its configured maximum has been reached` . **Solution** : turned the dynamic memory management in hyper-v settings off (and allocate a fixed amount of memory to the machine).