How to setup Minikube with KVM on Solus

- 3 min read

Setting up Minikube required a little bit of trial and error on my part under Solus when trying to use the KVM2 driver. This guide provides repeatable instructions to successfully install Minikube with KVM.

Requisites for Minikube

First, ensure /usr/local/bin/ exists, this is where we’ll install the minikube executable. The two fresh installs I tried this on—including an eopkg upgrade—did not, even though it was in $PATH.

sudo mkdir -p /usr/local/bin

Also, this guide builds upon the How to setup Docker on Solus post I wrote a few days ago. If you haven’t yet installed and configured Docker, you may wish to follow that guide first. If you choose not to install Docker and you encounter any issues please let me know on Twitter.

Install dependencies for KVM virtualization

First, install dependencies for KVM virtualization through the package manager:

sudo eopkg install libvirt qemu virt-manager

Add your current user to the libvirt group:

sudo usermod -a -G libvirt $(whoami)
newgrp libvirt

Then start the libvirt daemon to enable the libvirt virtualization management system:

sudo systemctl start libvirtd.service

If you want to have libvirt daemon start automatically on boot, run:

sudo systemctl enable libvirtd.service

Setup Minikube on Solus with KVM2 driver

To ensure we receive the latest Minikube, run the command from the Minikube README (the current command at time of publication is included below):

curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& chmod +x minikube \
&& sudo cp minikube /usr/local/bin/ \
&& rm minikube

Install KVM2 Driver for Minikube, taken from the Minikube drivers documentation:

curl -Lo docker-machine-driver-kvm2 https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \
&& chmod +x docker-machine-driver-kvm2 \
&& sudo cp docker-machine-driver-kvm2 /usr/local/bin/ \
&& rm docker-machine-driver-kvm2

Run Minikube with KVM2 driver

To start Minikube with the KVM2 driver run:

minikube start --vm-driver kvm2

Note, this will take a while to run, be patient.

If you don’t have the kubectl program installed yet, the prior minikube start command will notify you and supply the command to install it.

Minikube Bash completions

Since I’m useless without Bash command completions (<tab> <tab> when typing arguments for commands), I installed Minikube’s completions with the following command:

minikube completion bash | sudo tee /etc/bash_completion.d/minikube

If you use a shell other than Bash you’ll need to replace “bash” in the command above with your shell and likely save the output to another file location.

Bonus tip: Install kubectl completions

If you absolutely can’t live without like completions and you haven’t yet installed them for kubectl—you can add them to your ~/.bashrc file with the following command:

echo "source <(kubectl completion bash)" >> ~/.bashrc

Be sure to then perform one of the following to see the kubectl completions work:

  • Open a new terminal window
  • Run source ~/.bashrc to receive the update in your current terminal session
  • Run source <(kubectl completion bash) to source the completions into your current terminal session

Author

Cody Craven enjoys sharing tidbits of information that he learns through his life-long journey developing websites and configuring web servers.

When at work, Cody can often be found banging his head against his keyboard for hours days weeks-on-end trying to solve technical issues that would otherwise prevent his teammates from creating Member value at AAA.

All content that Cody contributes to this site are his own ideas and do not necessarily represent AAA's positions or opinions.