2019-05-21 21:46:59 +00:00
# VM Driver plugin installation
2016-06-30 21:06:27 +00:00
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 )
2017-11-24 18:44:51 +00:00
* [Hyperkit ](#hyperkit-driver )
2019-07-16 20:14:54 +00:00
* [Hyper-V ](#hyper-v-driver )
2018-03-14 16:28:15 +00:00
* [VMware ](#vmware-unified-driver )
2019-07-12 22:18:47 +00:00
* [Parallels ](#parallels-driver )
2016-06-30 21:06:27 +00:00
2019-03-10 19:02:52 +00:00
## KVM2 driver
2017-11-29 20:20:29 +00:00
2019-07-04 20:21:36 +00:00
### KVM2 install
2019-05-24 21:17:16 +00:00
To install the KVM2 driver, first install and configure the prerequisites, namely libvirt 1.3.1 or higher, and qemu-kvm:
2019-02-15 20:11:48 +00:00
2019-05-24 21:17:16 +00:00
* Debian or Ubuntu 18.x: `sudo apt install libvirt-clients libvirt-daemon-system qemu-kvm`
* Ubuntu 16.x or older: `sudo apt install libvirt-bin libvirt-daemon-system qemu-kvm`
2019-07-25 10:32:56 +00:00
* Fedora/CentOS/RHEL: `sudo yum install libvirt libvirt-daemon-kvm qemu-kvm`
2019-06-06 19:00:34 +00:00
* openSUSE/SLES: `sudo zypper install libvirt qemu-kvm`
2019-02-19 12:36:05 +00:00
2019-05-24 21:17:16 +00:00
Check your installed virsh version:
`virsh --version`
If your version of virsh is newer than 1.3.1 (January 2016), you may download our pre-built driver:
2019-02-19 12:36:05 +00:00
```shell
2019-05-24 21:17:16 +00:00
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \
& & sudo install docker-machine-driver-kvm2 /usr/local/bin/
2019-02-19 12:36:05 +00:00
```
2019-05-24 21:17:16 +00:00
If your version of virsh is older than 1.3.1 (Januarry 2016), you may build your own driver binary if you have go 1.12+ installed.
2019-02-19 12:36:05 +00:00
2019-06-22 17:04:43 +00:00
```console
2019-05-24 21:17:16 +00:00
$ sudo apt install libvirt-dev
$ git clone https://github.com/kubernetes/minikube.git
$ cd minikube
$ make out/docker-machine-driver-kvm2
$ sudo install out/docker-machine-driver-kvm2 /usr/local/bin
2019-06-22 17:04:43 +00:00
$
2019-02-19 12:36:05 +00:00
```
2019-02-15 20:11:48 +00:00
2019-05-24 21:17:16 +00:00
To finish the kvm installation, start and verify the `libvirtd` service
2019-03-10 19:02:52 +00:00
2019-02-21 12:30:26 +00:00
```shell
2019-02-27 05:25:52 +00:00
sudo systemctl enable libvirtd.service
sudo systemctl start libvirtd.service
sudo systemctl status libvirtd.service
2019-02-21 12:30:26 +00:00
```
2019-05-24 21:17:16 +00:00
Add your user to `libvirt` group (older distributions may use `libvirtd` instead)
2019-02-15 20:11:48 +00:00
2019-03-18 09:18:09 +00:00
```shell
sudo usermod -a -G libvirt $(whoami)
```
2019-02-15 20:11:48 +00:00
2019-05-24 21:17:16 +00:00
Join the `libvirt` group with your current shell session:
2019-02-15 20:11:48 +00:00
2019-03-18 09:18:09 +00:00
```shell
newgrp libvirt
```
2019-02-15 20:11:48 +00:00
2019-02-16 05:03:22 +00:00
To use the kvm2 driver:
2017-12-07 22:54:59 +00:00
2018-02-12 11:42:03 +00:00
```shell
2017-12-07 22:54:59 +00:00
minikube start --vm-driver kvm2
```
2019-05-24 21:17:16 +00:00
or, to use kvm2 as a default driver for `minikube start` :
2019-02-19 12:36:05 +00:00
```shell
minikube config set vm-driver kvm2
```
2019-07-04 20:21:36 +00:00
### KVM2 upgrade
```shell
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \
& & sudo install docker-machine-driver-kvm2 /usr/local/bin/
```
2019-07-04 20:23:52 +00:00
### KVM2 troubleshoot
2019-05-30 17:14:52 +00:00
If minikube can't start, check if the kvm default network exists.
```shell
virsh net-list
Name State Autostart Persistent
----------------------------------------------------------
default active yes yes
```
In case the default network doesn't exist you can define it.
```shell
curl https://raw.githubusercontent.com/libvirt/libvirt/master/src/network/default.xml > kvm-default.xml
virsh net-define kvm-default.xml
2019-05-31 16:56:22 +00:00
virsh net-start default
2019-05-30 17:14:52 +00:00
```
2019-06-25 17:27:29 +00:00
Make sure you are running the lastest version of your driver.
```shell
2019-06-28 20:45:54 +00:00
docker-machine-driver-kvm2 version
2019-06-25 17:27:29 +00:00
```
2019-03-10 19:02:52 +00:00
## Hyperkit driver
2017-11-24 18:44:51 +00:00
2019-04-04 23:10:28 +00:00
Install the [hyperkit ](http://github.com/moby/hyperkit ) VM manager using [brew ](https://brew.sh ):
2018-09-19 20:19:05 +00:00
```shell
2019-04-04 23:09:36 +00:00
brew install hyperkit
2018-09-19 20:19:05 +00:00
```
2019-04-04 23:09:36 +00:00
Then install the most recent version of minikube's fork of the hyperkit driver:
2017-11-24 18:44:51 +00:00
2018-02-12 11:42:03 +00:00
```shell
2018-10-03 01:20:49 +00:00
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit \
2018-10-26 20:38:23 +00:00
& & sudo install -o root -g wheel -m 4755 docker-machine-driver-hyperkit /usr/local/bin/
2017-11-24 18:44:51 +00:00
```
2018-08-08 22:28:10 +00:00
If you are using [dnsmasq ](http://www.thekelleys.org.uk/dnsmasq/doc.html ) in your setup and cluster creation fails (stuck at kube-dns initialization) you might need to add `listen-address=192.168.64.1` to `dnsmasq.conf` .
2018-11-13 07:48:07 +00:00
*Note: If `dnsmasq.conf` contains `listen-address=127.0.0.1` kubernetes discovers dns at 127.0.0.1:53 and tries to use it using bridge ip address, but dnsmasq replies only to requests from 127.0.0.1*
2018-08-08 22:28:10 +00:00
2019-02-15 20:51:12 +00:00
To use the driver:
```shell
minikube start --vm-driver hyperkit
```
2019-04-04 23:09:36 +00:00
or, to use hyperkit as a default driver for minikube:
2019-02-19 12:36:05 +00:00
```shell
minikube config set vm-driver hyperkit
```
2019-07-22 22:35:42 +00:00
### Hyperkit upgrade
```shell
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit \
& & sudo install -o root -g wheel -m 4755 docker-machine-driver-hyperkit /usr/local/bin/
```
2019-07-04 20:23:52 +00:00
### Hyperkit troubleshoot
2019-06-25 17:09:44 +00:00
Make sure you are running the lastest version of your driver.
```shell
2019-06-26 21:31:26 +00:00
docker-machine-driver-hyperkit version
2019-06-25 17:09:44 +00:00
```
2019-07-16 20:14:26 +00:00
## Hyper-V driver
2016-12-13 18:56:21 +00:00
2019-07-16 20:14:26 +00:00
Hyper-V users will 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
2019-07-16 20:14:26 +00:00
Older Hyper-V VM's may have **dynamic memory management** enabled, which 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 `stopped` . **Solution** : run `minikube delete` to delete the old VM.
2018-03-14 16:28:15 +00:00
2019-02-15 20:51:12 +00:00
To use the driver:
```shell
minikube start --vm-driver hyperv --hyperv-virtual-switch=switch-name
```
2019-03-10 19:02:52 +00:00
2019-02-19 12:36:05 +00:00
or, to use hyperv as a default driver:
```shell
minikube config set vm-driver hyperv & & minikube config set hyperv-virtual-switch switch-name
```
and run minikube as usual:
```shell
minikube start
```
2019-02-15 20:51:12 +00:00
2019-03-10 19:02:52 +00:00
## VMware unified driver
2018-03-14 16:28:15 +00:00
The VMware unified driver will eventually replace the existing vmwarefusion driver.
The new unified driver supports both VMware Fusion (on macOS) and VMware Workstation (on Linux and Windows)
2019-03-10 19:02:52 +00:00
To install the vmware unified driver, head over at < https: / / github . com / machine-drivers / docker-machine-driver-vmware / releases > and download the release for your operating system.
2018-03-14 16:28:15 +00:00
The driver must be:
1. Stored in `$PATH`
2. Named `docker-machine-driver-vmware`
3. Executable (`chmod +x` on UNIX based platforms)
If you're running on macOS with Fusion, this is an easy way install the driver:
```shell
export LATEST_VERSION=$(curl -L -s -H 'Accept: application/json' https://github.com/machine-drivers/docker-machine-driver-vmware/releases/latest | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/') \
& & curl -L -o docker-machine-driver-vmware https://github.com/machine-drivers/docker-machine-driver-vmware/releases/download/$LATEST_VERSION/docker-machine-driver-vmware_darwin_amd64 \
& & chmod +x docker-machine-driver-vmware \
& & mv docker-machine-driver-vmware /usr/local/bin/
```
2019-02-14 21:11:27 +00:00
2019-02-15 20:51:12 +00:00
To use the driver:
2019-02-14 21:11:27 +00:00
```shell
minikube start --vm-driver vmware
2019-02-15 20:03:37 +00:00
```
2019-02-19 12:36:05 +00:00
or, to use vmware unified driver as a default driver:
```shell
minikube config set vm-driver vmware
```
and run minikube as usual:
```shell
minikube start
```
2019-05-21 21:46:59 +00:00
2019-07-12 22:18:47 +00:00
## Parallels driver
This driver is useful for users who own Parallels Desktop for Mac that do not have VT-x hardware support required by the hyperkit driver.
Pre-requisites: Parallels Desktop for Mac
Install the [Parallels docker-machine driver ](https://github.com/Parallels/docker-machine-parallels ) using [brew ](https://brew.sh ):
```shell
brew install docker-machine-parallels
```
To use the driver:
```shell
minikube start --vm-driver parallels
```
or, to use parallels as a default driver for minikube:
```shell
minikube config set vm-driver parallels
```
2019-06-22 17:04:43 +00:00
## Troubleshooting
2019-05-21 21:46:59 +00:00
minikube is currently unable to display the error message received back from the VM driver. Users can however reveal the error by passing `--alsologtostderr -v=8` to `minikube start` . For instance:
```shell
minikube start --vm-driver=kvm2 --alsologtostderr -v=8
```
Output:
2019-06-22 17:04:43 +00:00
```text
2019-05-21 21:46:59 +00:00
Found binary path at /usr/local/bin/docker-machine-driver-kvm2
Launching plugin server for driver kvm2
2019-06-22 17:04:43 +00:00
Error starting plugin binary: fork/exec /usr/local/bin/docker-machine-driver-kvm2: exec format error
2019-05-21 21:46:59 +00:00
```