Minikube Startup Issue - Container Not Running After VM Restart
Problem
After installing Minikube on an Ubuntu VirtualBox VM and working for some time, I shut down the VM. When I restarted the VM later, I discovered that Minikube was not running.
Running minikube status showed:
vagrant@vagrant:~$ minikube status minikube type: Control Plane host: Stopped kubelet: Stopped apiserver: Stopped kubeconfig: Stopped
I checked the Docker containers and found that the Minikube Docker container was not running:
vagrant@vagrant:~$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 62d8b2305e2c gcr.io/k8s-minikube/kicbase:v0.0.50 "/usr/local/bin/entr…" 28 hours ago Exited (255) About a minute ago 127.0.0.1:32768->22/tcp, 127.0.0.1:32769->2376/tcp, 127.0.0.1:32770->5000/tcp, 127.0.0.1:32771->8443/tcp, 127.0.0.1:32772->32443/tcp minikube
Initial Troubleshooting Attempt
I attempted to start the Docker container manually:
vagrant@vagrant:~$ docker start 62d8b 62d8b
However, after starting the Docker container, running minikube status still showed issues:
vagrant@vagrant:~$ minikube status minikube type: Control Plane host: Running kubelet: Stopped apiserver: Stopped kubeconfig: Configured
The host was running, but the kubelet and apiserver were still in a stopped state. This indicated that simply starting the Docker container was not the correct approach.
Solution
The correct way to start Minikube after a VM restart is to use the minikube start command:
minikube start
This command properly initializes and starts all Minikube cluster components (kubelet, apiserver, etc.). After running this, minikube status should show all components as running:
minikube type: Control Plane host: Running kubelet: Running apiserver: Running kubeconfig: Configured
Best Practices
To avoid this issue in the future, follow these practices:
-
Always use
minikube stopbefore powering off your VM:minikube stopThis gracefully shuts down the cluster and ensures proper state management.
-
Use
minikube startafter powering on your VM:minikube startThis properly restarts all cluster components.
-
Avoid manually starting Docker containers: Don't try to directly manage Minikube's Docker containers. Let Minikube handle its own lifecycle management through its CLI commands.
Key Takeaway
Remember: Use Minikube's native commands (minikube start and minikube stop) rather than directly managing Docker containers. This ensures all cluster components start and stop correctly, preventing inconsistent states like having a running host but stopped kubelet and apiserver.
Given limited infrastructure (running Minikube in a VM on Windows with limited resources), these manual start/stop procedures are occasionally necessary, but following the best practices above minimizes operational overhead.
