Minikube without VirtualBox

Nicolas Doye
Aug 24, 2017 · 2 min read

Because VirtualBox sucks

VirtualBox really sucks. I mean really, really sucks. It’s inefficient, and has a habit of killing my MBP overnight. In my previous article, I wrote a bare bones intro to getting minikube up on macOS.

You can also run minikube against VMware Fusion (which isn’t free but is a lot better than VirtualBox). To do this, you will need to destroy your current cluster and bring up a new one. Copy any data you require off first.

❯ minikube delete
❯ minikube config set vm-driver vmwarefusion

You can also use Docker for Mac/Docker Machine/xhyve to deploy. This needs an extra driver to work.

❯ minikube delete
❯ brew install docker-machine-driver-xhyve xhyve
❯ 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
❯ minikube config set vm-driver xhyve

Now, some parts of this are fragile. Switching driver does not work cleanly, and I chose to reboot to clear problems with the xhyve driver. (I bet you can do it without rebooting: this is UNIX after all).

Stopping minikube can also leave your cluster in a state where it can’t start. Logging at a high level (I chose 10, which may be higher than the highest defined level; I haven’t checked will show you when there are problems):

❯ minikube start --v=10 --logtostderr --vm-driver=xhyve

Hitting Ctrl-C or accidentally starting it more than once can also render minikube unusable. So caveat hackor.


A quick note on reconnecting to running pods:

Once you’ve restarted minikube, you may want to reconnect to an existing pod (such as the PostgreSQL-supplied, client pod). This is a simple task and can be achieved by (in my case):

❯ kubectl attach agile-shrimp-postgresql-client-421007103-g7jxs -i

As blog-entries rot over time, this was run on:

  1. Kubernetes (client) 1.7.4
  2. Kubernetes (server) 1.7.0
  3. Helm (client and server) 2.6.0
  4. Minikube 0.21.0
  5. VMware Fusion 8.5.8
  6. Docker (client and server) 17.07.0-ce-rc3
  7. xhyve 0.2.0
  8. docker-machine-driver-xhyve 0.3.3
  9. macOS Sierra 10.12.6

)

Nicolas Doye

Written by

Person of UNIX descent.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade