I do have an Ubuntu VM in VirtualBox on Windows 10. If i follow the instructions to install Minikube I get a start error:
> minikube start &
[1] 4297
vagrant#ubuntu-xenial:~$ o minikube v0.35.0 on linux (amd64)
> Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
# Downloading Minikube ISO ...
184.42 MB / 184.42 MB [============================================] 100.00%
0s
! Unable to start VM: create: precreate: VBoxManage not found. Make sure
VirtualBox is installed and VBoxManage is in the path
Does it mean i need to install VirtualBox in the Ubuntu VM too? Kind of VB inside VB..
thanks
I'd recommend to install Minikube on your host OS (Windows) and use the already installed Virtual box as a hypervisor provider.
If for any reason you want to launch it on Ubuntu VM, there are two options:
I. Minikube 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. In this case you have to provide an address to you local API server
`minikube start --vm-driver=none --apiserver-ips 127.0.0.1 --apiserver-name localhost`
And then go and edit ~/.kube/config, replacing the server IP that was
detected from the main network interface with "localhost". For example:
apiVersion: v1
clusters:
- cluster:
certificate-authority-data:/home/asuh/.minikube/ca.crt
server: https://localhost:8443
name: minikube
II. Install VM Ware on Windows and run Ubuntu within installed Virtualbox
and and enabled VT-X/AMD-v in outer VM.
Regarding the error you have at the moment:
However now i get another error like: /usr/local/bin/minikube: cannot
execute binary file
Make sure you have installed a proper version of Minikube. For your Ubuntu VM it should be
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& chmod +x minikube
It is not recommended to use VM inside VM to run minikube. Check this answer. Try to run minikube with no vm drivers.
minikube start --vm-driver=none
I have read on minikube issues, but can not find it right now.
HTH
Related
I am trying to create the minikube cluster, but It always fails.
Any suggestions are very welcome:
C:\WINDOWS\system32>minikube start --driver=vmware
minikube v1.16.0 on Microsoft Windows 10 Home 10.0.19042 Build 19042
Using the vmware driver based on user configuration
Starting control plane node minikube in cluster minikube
Creating vmware VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
Deleting "minikube" in vmware ...
! StartHost failed, but will try again: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
Creating vmware VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
Failed to start vmware VM. Running "minikube delete" may fix it: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
X Exiting due to DRV_NO_IP: Failed to start host: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting
Suggestion: Check your firewall rules for interference, and run 'virt-host-validate' to check for KVM configuration issues. If you are running minikube within a VM, consider using --driver=none
Documentation: https://minikube.sigs.k8s.io/docs/reference/drivers/kvm2/
Related issues:
https://github.com/kubernetes/minikube/issues/4249
https://github.com/kubernetes/minikube/issues/3566
I had a similar error when setting up Minikube on Mac OS.
When I run the command minikube start I get the error below:
😄 minikube v1.22.0 on Darwin 11.4
✨ Using the vmware driver based on existing profile
👍 Starting control plane node minikube in cluster minikube
🏃 Updating the running vmware "minikube" VM ...
🤦 StartHost failed, but will try again: provision: IP not found for MAC 00:0c:29:41:e9:b9 in DHCP leases
🏃 Updating the running vmware "minikube" VM ...
😿 Failed to start vmware VM. Running "minikube delete" may fix it: provision: IP not found for MAC 00:0c:29:41:e9:b9 in DHCP leases
❌ Exiting due to GUEST_PROVISION: Failed to start host: provision: IP not found for MAC 00:0c:29:41:e9:b9 in DHCP leases
The issue was caused by an interruption when I was creating the VMWare VM for Minikube.
I tried fixing it by deleting the existing minikube vm and creating another one using:
minikube delete
minikube start
But then I ran into another issue this time:
Exiting due to DRV_NO_IP: Failed to start host: creating host: create: Error creating machine: Error in driver during machine creation: Machine didn't return an IP after 120 seconds, aborting.
Here's how I fixed it
After multiple research, it's just best to set up minikube with docker driver which will save you all this hassle.
For Mac OS:
If you already have docker installed or docker-compose simply uninstall it using:
brew uninstall docker
brew uninstall docker-compose
Next, install Docker desktop. This will install Docker/Docker Desktop, Docker-compose and other dependencies using:
brew install --cask docker
Next, start the docker engine by opening the Docker application. Afterwhich you can confirm the docker version using:
docker --version
Finally, setup minikube using docker driver:
minikube start --driver=docker
On my laptop I have Linux Mint OS. Details as below:
Mint version 19,
Code name : Tara,
PackageBase : Ubuntu Bionic
Cinnamon (64-bit)
I have installed kubectl binary using curl from this reference site: https://kubernetes.io/docs/tasks/tools/install-kubectl/
commands used for kubectl installation:
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
installed minikube on local linux machine using the link:
https://github.com/kubernetes/minikube/releases
command used for minikube installation:
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.29.0/minikube-linux-amd64 && chmod +x minikube && sudo cp minikube /usr/local/bin/ && rm minikube
Downloaded this VirtualBox 5.2.18 for Linux Ubuntu 18.04 / Debian 10 AMD64 from https://www.virtualbox.org/wiki/Downloads
THen I lanuched virtualbox manager. There is no virtual machine created.
Then followed quickstart guide on my local Linux Mint machine:
https://github.com/kubernetes/minikube/blob/v0.29.0/README.md
On my local Linux mint machine under downloads directory, the moment I run command "minikube start" :
xxxxxxxx:~/Downloads$ minikube start
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Downloading Minikube ISO
171.87 MB / 171.87 MB [============================================] 100.00% 0s
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.
Loading cached images from config file.
Though I am running minikue start command on my local Linux machine, it says its starting minikube in virtualmachine inside Oracle virtualbox manager.
My first question is HOW? Is there any specific setting that is being done behind the scenes to have minikube getting started in VM installed on my operating system (in this case I am on Linux mint 19)
minikube getting started in VM
If I double click on minikube running on VM, then it opens up a screen where it asks me logging to minikube. Please see below screenshot.
minikube asking credentials
My second question is: I haven't set any credentials for minikube. What could be the credentials? Is there any way to set credentials?
UPDATE 1
As per comment by #Rico , for his 2nd point, he said "to connect to minikube VM you can run minikube ssh" isn't it same like what I showed in 2nd attached screenshot in my issue? I mean double click on minikube VM running inside oracle virtualbox manager and that pops up screen asking for login credentials.
However, I tried to use command: minikube ssh on my local machine after starting minikube.
xxxxxxxxxxxxxx:~$ minikube ssh
_ _
_ _ ( ) ( )
___ ___ (_) ___ (_)| |/') _ _ | |_ __
/' _ ` _ `\| |/' _ `\| || , < ( ) ( )| '_`\ /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )( ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)
$ ls
$ pwd
/home/docker
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
k8s.gcr.io/coredns 1.2.2 367cdc8433a4 4 weeks ago 39.2MB
k8s.gcr.io/kubernetes-dashboard-amd64 v1.10.0 0dab2435c100 5 weeks ago 122MB
k8s.gcr.io/kube-apiserver-amd64 v1.10.0 af20925d51a3 6 months ago 225MB
k8s.gcr.io/kube-controller-manager-amd64 v1.10.0 ad86dbed1555 6 months ago 148MB
k8s.gcr.io/kube-scheduler-amd64 v1.10.0 704ba848e69a 6 months ago 50.4MB
k8s.gcr.io/etcd-amd64 3.1.12 52920ad46f5b 6 months ago 193MB
k8s.gcr.io/kube-addon-manager v8.6 9c16409588eb 7 months ago 78.4MB
k8s.gcr.io/k8s-dns-kube-dns-amd64 1.14.8 80cc5ea4b547 8 months ago 50.5MB
k8s.gcr.io/pause-amd64 3.1 da86e6ba6ca1 9 months ago 742kB
k8s.gcr.io/echoserver 1.4 a90209bb39e3 2 years ago 140MB
$
It didn't ask me any credentials.
So should I say that "Minikube uses boot2docker as its base image, so the default SSH login to the VM ends up being docker:tcuser"
UPDATE 2
As per #Rico: "basically when you do minikube ssh it connects to the VM using private/public key authentication" - I agree. It didn't ask me any credentials when I did "minikube ssh" command from my host machine.
also as per point 1: "with command 'minikube start' it starts the VM that has all the kubernetes components in it" - So for this I went ahead and tried to run any kubectl command after ssh ing into minikube and its saying command not found.
$ kubectle get pods
-bash: kubectle: command not found
However it does recognize docker command
$ docker --version
Docker version 17.12.1-ce, build 7390fc6
I also tried to find VM details
$ uname -a
Linux minikube 4.15.0 #1 SMP Thu Sep 27 17:28:06 UTC 2018 x86_64 GNU/Linux
The short answer, minkube downloads a VM image to your host machine, in this case, Mint Linux for you then it starts the VM that has all the kubernetes components in it.
Credentials can be from any user in the VM OS. To connect to the minikube VM you can run minikube ssh from your host. From there you can run something like sudo adduser to add any user you like and set the credentials that you'd like too.
Note: when you run minikube ssh you connect to the VM using ssh and it uses private/public key ssh authentication.
As a based image Minikube uses boot2docker, and default login details are docker:tcuser, you can also login using minikube ssh and tokens created by Minikube will be used to login without prompting for your login details.
You should first remove the old cluster minikube delete and create a new one minikube start.
You do not need to have VirtualBox installed as Minikube will stat it's own VM.
Of course, you can specify which VM driver should be used, using minikube start --vm-driver=virtualbox.
Please read the instructions provided on kubernetes.io regarding Minikube installation.
Thanks Shivraj and Rico for the posting questions and replies. They were badly needed.
To your problem Shivraj, please fire the kubectl commands on host machine.
I have also done a similar setup on my laptop with minikube creating a Linux VM for me. Docker images are running within the VM and kubectl is on the host machine.
I am following the link below; issuing kubectl commands on my host and is working perfectly fine.
Hope it helps.
I am working on openam deployment on Google cloud platform (GCP) and the OS is RHEL7.
I am facing issue while running minikube start.
[root#test ~]# minikube start
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Downloading Minikube ISO
150.53 MB / 150.53 MB [============================================] 100.00% 0s
E0509 06:20:12.950109 16264 start.go:159] Error starting host: Error creating host: Error executing step: Running precreate checks.
: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory.
Retrying.
E0509 06:20:12.951500 16264 start.go:165] Error starting host: Error creating host: Error executing step: Running precreate checks.
: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory
I already installed virtualbox on RHEL.
I want to know how to enable VT-X on GCP?
Thanks
Ashish
You can use --vm-driver=none to run your minikube in cloud. This flag will run your minukube in Docker. You should have installed Docker first.
Also you can create a custom image where VMX will be enabled. Just follow the official documentation instruction.
Example from the documentation on how to create a custom image with enabled VMX:
gcloud compute images create nested-vm-image --source-disk disk1 --source-disk-zone us-central1-a --licenses "https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx"
Then, just create a new VM with the custom image.
gcloud compute instances create example-nested-vm --zone us-central1-b --image nested-vm-image
After all, you can install the VirtualBox or KVM and start minikube.
I have installed Minikube and am following the "Hello minikube" tutorial:
https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/#create-a-minikube-cluster
I have started minikube using the Hyperv driver:
minikube start --vm-driver="hyperv" --hyperv-virtual-switch="New Virtual Switch" --alsologtostderr
When I try to build an image using the Minikube Docker daemon, get the following error:
Step 1/4 : FROM node:6.9.2
Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 172.24.209.161:53: server misbehaving
What is going wrong here, and how can I fix it?
Here is some info about my environment:
minikube version: v0.23.0
OS: Windows 10 17_09
Try to clear all Docker data. This has done the job to me ;)
Try this if you can build your images on the local machine then take a copy of
/etc/resolv.conf
and copy the values and insert into the minikube cluster's /etc/resolv.conf using minikube ssh after all its just a VM and you are accessing the docker-engine/server using the environment variables..!!!
cheers :)
I'm wondering how can install a package inside the minikube VM. I need some tools.
I have tried the /bin/toolbox container, but It does not have internet conexion.
[root#docker-fedora-24 ~]# dnf update --verbose
cachedir: /var/cache/dnf
DNF version: 1.1.9
Cannot download 'https://mirrors.fedoraproject.org/metalink?repo=updates-released-f24&arch=x86_64': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f24&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org].
Error: Failed to synchronize cache for repo 'updates'
I have tried the same toolbox script in my computer and it is properly working.
What configuration parameters I'm missing in minikube or systemd-nspaw?
Or how can I cook a customized minikube VM?
Thanks a lot
You can run minicube without VM on your local docker (if you use linux):
minikube start --vm-driver=none
A alternative, run toolbox with docker run --net=host ... to make network for container more transparent. Troubleshoot your internet connection with nslookup, traceroute/tracepath, curl -v, ifconfig.
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:Ch04:_Simple_Network_Troubleshooting#.WfY1xGi0OUk
Minikube is not meant to be tweaked. The advised method is to prepare a helm chart for your application. As part of the helm chart you can add whatever tool you need in your docker file... Including make... Then you can install or upgrade your package in kubernetes/minikube using helm.
I had a similar problem when I wanted to use tcpdump in the minikube VM.
I ended up using minikube mount SRC-dir:DST-dir to mount the host folder inside the VM and copying the tcpdump binary along with dependent libs (libcrypto and libpcap) to the mount point.
Then I executed tcpdump from the minikube VM and it worked.
Note: My host arch and the minikube VM arch (x86_64) was the same.
Note also: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:DST-dir has to be done.