Minikube install in Ubuntu vm_VT-X/AMD-v enabling to VM inside another VM

2/17/2017

I'm tring to install minikube in Ubuntu vm (in virtual box). I have enabled VT-X/AMD-v for the vm. But i'm getting following error.

# minikube start
Starting local Kubernetes cluster...
E0217 15:00:35.395801    3869 start.go:107] Error starting host: Error creating host: Error with pre-create check: "This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory".

 Retrying.
E0217 15:00:35.396019    3869 start.go:113] Error starting host:  Error creating host: Error with pre-create check: "This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory"
================================================================================
An error has occurred. Would you like to opt in to sending anonymized crash
information to minikube to help prevent future errors?
To opt out of these messages, run the command:
    minikube config set WantReportErrorPrompt false
================================================================================
Please enter your response [Y/n]:

I found a reference, according to that, we can not have virtualization inside virtualization. Is it true? How can i fix this?

-- Lakmal Vithanage
kubernetes
minikube
ubuntu

6 Answers

4/7/2017

Virtual Box does not support VT-X/AMD-v in nested virtualisation. See this open ticket/feature request on virtualbox.org.

There are also some more questions and answers here on SO discussing this topic.

Possible solutions:

  1. As already mentioned: Use a different hypervisor that does support VT-X/AMD-v in nested virtualisation (like Xen, KVM or VMware).
  2. Install Minikube on the host OS and not in a VM.
  3. Run Minikube directly using Docker and the "none" driver option as described in Tad Guskis answer.
-- Phonolog
Source: StackOverflow

10/3/2018

Run Minikube directly on the VM using Docker and the "none" driver option which does not require nested virtualization.

Set the none driver option:

[root@minikube ~]# minikube config set vm-driver none

Install Docker-ce following instructions for your VM OS version.

Lastly run minikube start:

[root@minikube ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@minikube ~]# systemctl start docker
[root@minikube ~]# minikube start
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Downloading kubeadm v1.10.0
Downloading kubelet v1.10.0
Finished Downloading kubelet v1.10.0
Finished Downloading kubeadm v1.10.0
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
===================
WARNING: IT IS RECOMMENDED NOT TO RUN THE NONE DRIVER ON PERSONAL WORKSTATIONS
        The 'none' driver will run an insecure kubernetes apiserver as root that may leave the host vulnerable to CSRF attacks

When using the none driver, the kubectl config and credentials generated will be root owned and will appear in the root home directory.
You will need to move the files to the appropriate location and then set the correct permissions.  An example of this is below:

        sudo mv /root/.kube $HOME/.kube # this will write over any previous configuration
        sudo chown -R $USER $HOME/.kube
        sudo chgrp -R $USER $HOME/.kube

        sudo mv /root/.minikube $HOME/.minikube # this will write over any previous configuration
        sudo chown -R $USER $HOME/.minikube
        sudo chgrp -R $USER $HOME/.minikube

This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true
Loading cached images from config file.
-- Tad Guski
Source: StackOverflow

11/30/2018

Try running minikube without nested virtualization (docker should be installed):

minikube start --vm-driver=none

From Kubernetes documentation:

Minikube also supports a --vm-driver=none option that runs the Kubernetes components on the host and not in a VM. Using this driver requires Docker and a linux environment, but not a hypervisor.

-- k13i
Source: StackOverflow

2/17/2017

Check if it's properly enabled for the VM (run inside the VM):

egrep -i '^flags.*(svm|vmx)' /proc/cpuinfo

And in VM kernel:

dmesg | egrep 'DMAR|IOMMU'

VirtualBox only works with 32-bit nested guest, so also check (it doesn't support nested guests, but works with 32-bit):

uname -m
-- Janos Lenart
Source: StackOverflow

12/13/2017

"Install Minikube on the host OSĀ and not in a VM."

it is not completely correct, in fact you can install minikube in Linux VM on top of virtualbox or vmware etc with none driver option, which uses localkube directly deal with kubernetes in VM host docker.

you can this small script in Linux VM to startup minikube in few mins.

https://github.com/robertluwang/docker-hands-on-guide/blob/master/minikube-none-installation.md

-- robertluwang
Source: StackOverflow

2/22/2017

I installed VM ware and installed Virtualbox inside the VM. And enabled VT-X/AMD-v in outer VM. it's works fine.

-- Lakmal Vithanage
Source: StackOverflow