While setting up and starting minikube in my lab How to Install Minikube on Ubuntu - Step by Step, I was receiving two errors. First error was related to not running minikube start as root privileges. Which was resolved after existing from the root account and running minikube as a normal user.
But another error occurred related to Intel VT-X/AMD-V not enabled after running minikube start again.
root@AnsibleAWX:~# minikube start --cpus=4 --memory=6g --addons=ingress * minikube v1.28.0 on Ubuntu 20.04 * Automatically selected the virtualbox driver. Other choices: none, ssh * The "virtualbox" driver should not be used with root privileges. If you wish to continue as root, use --force. * If you are running minikube within a VM, consider using --driver=none: * https://minikube.sigs.k8s.io/docs/reference/drivers/none/ X Exiting due to DRV_AS_ROOT: The "virtualbox" driver should not be used with root privileges. root@AnsibleAWX:~# root@AnsibleAWX:~# exit logout ubuntu@AnsibleAWX:~$ ubuntu@AnsibleAWX:~$ whoami ubuntu ubuntu@AnsibleAWX:~$ ubuntu@AnsibleAWX:~$ minikube start --cpus=4 --memory=6g --addons=ingress * minikube v1.28.0 on Ubuntu 20.04 * Automatically selected the virtualbox driver. Other choices: ssh, none * Downloading VM boot image ... > minikube-v1.28.0-amd64.iso....: 65 B / 65 B [---------] 100.00% ? p/s 0s > minikube-v1.28.0-amd64.iso: 274.45 MiB / 274.45 MiB 100.00% 113.66 MiB * Starting control plane node minikube in cluster minikube * Downloading Kubernetes v1.25.3 preload ... > preloaded-images-k8s-v18-v1...: 385.44 MiB / 385.44 MiB 100.00% 109.33 * Creating virtualbox VM (CPUs=4, Memory=6144MB, Disk=20000MB) ... ! StartHost failed, but will try again: creating host: create: precreate: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory * Creating virtualbox VM (CPUs=4, Memory=6144MB, Disk=20000MB) ... * Failed to start virtualbox VM. Running "minikube delete" may fix it: creating host: create: precreate: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory X Exiting due to HOST_VIRT_UNAVAILABLE: Failed to start host: creating host: create: precreate: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory * Suggestion: Virtualization support is disabled on your computer. If you are running minikube within a VM, try '--driver=docker'. Otherwise, consult your systems BIOS manual for how to enable virtualization. * Related issues: - https://github.com/kubernetes/minikube/issues/3900 - https://github.com/kubernetes/minikube/issues/4730
To resolve the error of virtualization not enabled in CPU, I opened Edit Settings of Virtual Machine, in the Virtual Hardware expand CPU and enabled check box of Hardware virtualization --> Expose hardware assisted virtualization to the guest OS. In case if the system is bare metal enable virtualization in BIOS. (System will require reboot).
Once the configuration is done, start minikube and get the list of nodes.
ubuntu@AnsibleAWX:~$ ubuntu@AnsibleAWX:~$ minikube start --cpus=4 --memory=6g --addons=ingress * minikube v1.28.0 on Ubuntu 20.04 * Using the virtualbox driver based on existing profile * Starting control plane node minikube in cluster minikube * Creating virtualbox VM (CPUs=4, Memory=6144MB, Disk=20000MB) ... * Preparing Kubernetes v1.25.3 on Docker 20.10.20 ... - Generating certificates and keys ... - Booting up control plane ... - Configuring RBAC rules ... * Verifying Kubernetes components... - Using image k8s.gcr.io/ingress-nginx/controller:v1.2.1 - Using image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1 - Using image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1 - Using image gcr.io/k8s-minikube/storage-provisioner:v5 * Verifying ingress addon... * Enabled addons: storage-provisioner, default-storageclass, ingress * kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A' * Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default ubuntu@AnsibleAWX:~$ ubuntu@AnsibleAWX:~$ minikube kubectl get nodes > kubectl.sha256: 64 B / 64 B [-------------------------] 100.00% ? p/s 0s > kubectl: 42.93 MiB / 42.93 MiB [----------] 100.00% 125.13 MiB p/s 500ms NAME STATUS ROLES AGE VERSION minikube Ready control-plane 102s v1.25.3
Useful Articles
Configure Nginx Load Balancer for the Kubernetes API Server - Part 1
Install and configure Kubernetes cluster master nodes using kubeadm - Part 2
Install and configure Kubernetes cluster worker nodes using kubeadm - Part 3
Kubernetes kubeadm join couldn't validate the identity of the API server connection refused
Kubernetes kubeadm join could not find a jws signature in the cluster-info ConfigMap for token ID
Setup and deploy Ingress controller for Kubernetes on Bare Metal servers
Setup HAProxy for Ingress Controller Kubernetes Cluster