minikube is local Kubernetes, focusing on making it easy to learn and develop for Kubernetes.
Why write an article on installing minikube on Ubuntu with Windows Subsystem Linux (WSL) 2 backend? There are two reasons:
-
the official minikube site has documentation for installing on Windows, Linux, and macOS, but not on Ubuntu with WSL 2 backend.
-
compared to the macOS or Linux, the installation process on Ubuntu with WSL 2 backend is not a trivial task.
Preparing your Windows 10 machine
What you’ll need:
- 2 CPUs or more
- 2Gb of free memory
- 20Gb of free disk space
- Internet connection
- Windows Subsystem Linux [“WSL”] 2
You can install WSL 2 by following this article Install WSL on Windows 10
- Ubuntu 18.04+
You can install Ubuntu on WSL 2 by following this article Ubuntu on WSL 2 Is Generally Available
- Container or virtual machine manager
All you need is Docker (or similarly compatible) container or a Virtual Machine environment, and Kubernetes is a single command away:
minikube start
. You can install Docker Desktop for Windows by following this article Docker Desktop WSL 2 backend
Installing minikube on Ubuntu 18.04 with Windows Subsystem Linux 2 backend
Download and install the latest minikube package for Ubuntu.
|
|
Configuring VM driver
As we’re on a virtual machine, we should set VM driver to none, as we cannot virtualize on virtualization.
|
|
You should see the following output, which you can ignore as we don’t have minikube running yet.
|
|
Changing permissions
First, change permissions for your $USER
to the .minikube
directory.
|
|
Installing package dependencies
Ensure that the following packages are installed.
|
|
Deleting previous minikube profiles
Check if an existing profile exists using sudo minikube profile list
. Delete all existing profiles.
|
|
Starting minikube
Finally, start minikube
using the following command without sudo
privileges:
|
|
Warning: The option --driver=none
should not be used in Windows.
A successful output should have the following:
|
|
Troubleshooting
- If you get the following error on
sudo minikube start
:
|
|
The following command should resolve the above issue:
|
|
- If you get the following error on
sudo minikube start --driver=docker
:
|
|
You should perform minikube start --driver=docker
without sudo
privilege.
- If you get the following error on
minikube start --driver=docker
:
|
|
The following command should resolve the above issue:
|
|
- If you get the following error on
sudo minikube start --driver=docker
:
|
|
Check if an existing profile exists using sudo minikube profile list
. The following command should resolve the above issue:
|
|
Was this article useful? Help us to improve!
With your feedback, we can improve the newsletter. Click on a link to vote: 🗳️