Docker-machine cannot connect to default machine (Windows) - windows

I have problem with using docker-machine after windows update on my Windows 8.1 Enterprise.
I'm using Docker Toolbox 1.12.5. I can run docker with no problem, but after windows update docker-machine cannot connect to default machine.
I can see in VirtualBox that default machine is running, but when I tried to run
docker-machine env default
it gave me "Error checking TLS connection: Host is not running".
When I run
docker-machine ls
I get:
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default virtualbox Timeout
I found some suggestions to restart default machine so I ran
docker-machine restart default
but it always gives me following error:
Restarting "default"...
Starting "default"...
(default) Check network to re-create if needed...
Error setting up host only network on machine start: C:\Program Files\Oracle\Vir
tualBox\VBoxManage.exe modifyvm default --nic2 hostonly --nictype2 82540EM --nic
promisc2 deny --hostonlyadapter2 VirtualBox Host-Only Ethernet Adapter --cableco
nnected2 on failed:
VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended in
fo not available)
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at lin
e 507 of file VBoxManageModifyVM.cpp
I tried solutions suggested on :
https://www.bountysource.com/issues/29373416-vboxmanage-exe-error-context-lockmachine-a-session-locktype_write-at-line-493-of-file-vboxmanagemodifyvm-cpp
and https://github.com/docker/toolbox/issues/360 without success.
I would really appreciate any suggestions.

Can you try restarting your system and then check?
Docker has released Community and Enterprise edition for docker. I would recommend you to upgrade to community edition and recreate your default machine using below command. They claim to have fixed some bugs in these editions.
docker-machine create --driver virtualbox default
you can add more parameters to above command if you want.

Related

Minikube start issue on AWS EC2 ubuntu bionic

I have got AWS EC2 instance started.
Logged onto the instance using Putty client.
Below all commands I tried on EC2 instance which is Ubuntu 18.04.
Configuration details of EC2 are as follows
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
I have installed docker and virtualbox
~$ docker --version
Docker version 19.03.8, build afacb8b7f0
$ dpkg -l | grep 'virtualbox'
ii virtualbox-5.2 5.2.30-130521~Ubuntu~bionic amd64 Oracle VM VirtualBox
$ lscpu | grep Virtualization
Virtualization type: full
I tried to start minikube.
$ minikube start
* minikube 1.9.2 is available! Download it: https://github.com/kubernetes/minikube/releases/tag/v1.9.2
* To disable this notice, run: 'minikube config set WantUpdateNotification false'
! minikube v1.9.0 on Ubuntu 18.04
* Using the virtualbox driver based on existing profile
* Creating virtualbox VM (CPUs=2, Memory=1993MB, 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=2, Memory=1993MB, Disk=20000MB) ...
* StartHost failed again: creating host: create: precreate: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory
- Run: "minikube delete", then "minikube start --alsologtostderr -v=1" to try again with more logging
*
E0408 16:46:12.812503 5285 style.go:173] unable to parse "X Unable to start VM after repeated tries. Please try {{'minikube delete' if possible\n": template: X Unable to start VM after repeated tries. Please try {{'minikube delete' if possible
:1: malformed character constant: 'minikube delete' - returning raw string.
X Unable to start VM after repeated tries. Please try {{'minikube delete' if possible
* Error: [VBOX_VTX_DISABLED] 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=none'. 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
Based on error message, I also tried below command:
$ minikube start --no-vtx-check
* minikube v1.9.0 on Ubuntu 18.04
* Automatically selected the virtualbox driver
* Creating virtualbox VM (CPUs=2, Memory=1993MB, Disk=20000MB) ...
! StartHost failed, but will try again: creating host: create: creating: Unable to start the VM: /usr/bin/VBoxManage startvm minikube --type headless failed:
VBoxManage: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
Details: 00:00:00.455234 Power up failed (vrc=VERR_VMX_NO_VMX, rc=NS_ERROR_FAILURE (0X80004005))
* Deleting "minikube" in virtualbox ...
* Creating virtualbox VM (CPUs=2, Memory=1993MB, Disk=20000MB) ...
* StartHost failed again: creating host: create: creating: Unable to start the VM: /usr/bin/VBoxManage startvm minikube --type headless failed:
VBoxManage: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
Details: 00:00:00.270050 Power up failed (vrc=VERR_VMX_NO_VMX, rc=NS_ERROR_FAILURE (0X80004005))
- Run: "minikube delete", then "minikube start --alsologtostderr -v=1" to try again with more logging
*
E0408 16:52:12.324862 5411 style.go:173] unable to parse "X Unable to start VM after repeated tries. Please try {{'minikube delete' if possible\n": template: X Unable to start VM after repeated tries. Please try {{'minikube delete' if possible
:1: malformed character constant: 'minikube delete' - returning raw string.
X Unable to start VM after repeated tries. Please try {{'minikube delete' if possible
* Error: [VBOX_VERR_VMX_NO_VMX] creating host: create: creating: Unable to start the VM: /usr/bin/VBoxManage startvm minikube --type headless failed:
VBoxManage: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
Details: 00:00:00.270050 Power up failed (vrc=VERR_VMX_NO_VMX, rc=NS_ERROR_FAILURE (0X80004005))
* Suggestion: Your host does not support virtualization. If you are running minikube within a VM, try '--driver=none'. Otherwise, enable virtualization in your BIOS
* Related issues:
- https://github.com/kubernetes/minikube/issues/1994
- https://github.com/kubernetes/minikube/issues/5326
I went to all those jira specified in error log but of no use. Most of those doesn't talk about issue within Amazon EC2 ubuntu 18.04 .
Questions:
how do I enable VT-X/AMD-v in BIOS in logged in EC2 instance which is ubuntu 18.04? Is there any command I can try? note: I don't have access to go to AWS EC2 instance GUI.
is AWS EC2 Ubuntu 18 instance compatible with virtualbox 5 or 6 to start minikube ?
Questions: how do I enable VT-X/AMD-v in BIOS in logged in EC2 instance which is ubuntu 18.04? Is there any command I can try? note: I don't have access to go to AWS EC2 instance GUI.
You don't, EC2 is a virtual server and You have no access to the BIOS.
To use Minikube on EC2 you need to start it without vm driver so just execute $ minikube start --vm-driver=none. This is described here if you insist on using Minikube.
Instead of installing Minikube I would recommend using kubeadm and setting single control-plane cluster with kubeadm.

Unable to start minikube in windows using hyperv

I installed minikube successfully on my windows machine and was using it. All of a sudden minikube start command failed to work one day, so I force-deleted .minikube directory and also removed minikube from Hyper-V Manager on Windows.
After this, I am unable to create/start minikube on my windows machine. I can see that a VM is created in Hyper-V manager but minikube is not starting with below error.
minikube start --vm-driver=hyperv
* minikube v1.5.2 on Microsoft Windows 10 Enterprise 10.0.17763 Build 17763
* Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.
* Using the running hyperv "minikube" VM ...
* Waiting for the host to be provisioned ...
X minikube is unable to connect to the VM: dial tcp: address fe80::215:5dff:fe01:90b:22: too many colons in address
I came across this link which seems to be fixed long ago.
https://github.com/kubernetes/minikube/issues/576
Can any one suggest other way to fix this ?
It's trying to append the port to the ip address, but is formatting incorrectly when the IP Address is IPv6 Github Issue. Looks like there have been similar issues in the past and the solution has been to try again on a later version.
If you can force the VM to have an ipv4 address, that may work around this issue (hyper-V settings?)

Docker and Windows - Problems with SSH on default container

i'm new to Docker and i've just intalled Docker ToolBox 1.11.1 on my Windows 7 (64 bit).
When running Quickstart Terminal i've got problems with creating default container.
After reading a bunch of forums i've invoked :
docker-machine rm -f default
docker-machine --debug create -d virtualbox default
But still without result. Full logs from last operation are :
https://gist.github.com/anonymous/117e302c047492170a6f0c7d4e79199a
They end up with phrase :
"(default) DBG | Error dialing TCP: dial tcp 127.0.0.1:49659: connectex: No connection could be made because the target machine actively refused it."
I've have no idea how to fix that. Can someone help me ?
In windows and Mac OS Docker run in a virtual machine. When you install Docker using the Docker Toolbox, it takes care of install Virtual Box, create a “default” virtual machine and configure it to run a Boot2Docker image.
With the command:
docker-machine rm -f default
you are removing this default VM. Then running the command:
docker-machine --debug create -d virtualbox default
you are creating a new VM called “default”, so you are not creating or starting any default windows container.
"Actively refused it" means that the host sent a reset instead of an ack when you tried to connect. Please, check the firewall or the proxy configuration because this is a communication problem.
Hope this can help.

Error setting up docker on Windows

I am trying to set up docker machine on Windows and this problem has annoyed me for a few days.
I downloaded and installed DockerToolbox-1.9.1a on my Windows, so it came with Virtual Box version 5.0.10. After that I ran this command to create my virtual machine:
docker-machine create --driver virtualbox --engine-insecure-registry docker.pre-prod.ss.local:5000 --virtualbox-hostonly-cidr 192.168.99.100/24 mymachine
Here is what I got:
Waiting for machine to be running, this may take a few minutes...
Machine is running, waiting for SSH to be available... Detecting
operating system of created instance... Detecting the provisioner...
Provisioning created instance... Copying certs to the local machine
directory... Copying certs to the remote machine... Setting Docker
configuration on the remote daemon... WARNING >>> This machine has
been allocated an IP address, but Docker Machine could not reach it
successfully.
SSH for the machine should still work, but connecting to exposed
ports, such as the Docker daemon port (usually :2376), may not
work properly.
You may need to add the route manually, or use another related
workaround
This could be due to a VPN, proxy, or host file configuration issue.
You also might want to clear any VirtualBox host only interfaces you
are not using
The machine was created successfully. So I ran the docker-machine env command:
docker-machine env --shell=powershell mymachine| Invoke-Expression
and I got:
Error running connection boilerplate: Error checking and/or
regenerating the certs: There was icates for host
"192.168.99.100:2376": dial tcp 192.168.99.100:2376: connectex: No
connection target machine actively refused it. You can attempt to
regenerate them using 'docker-machine regenerate-certs name'. Be
advised that this will trigger a Docker daemon restart which will stop
running containers.
Running docker version returned
Client: Version: 1.9.1 API version: 1.21 Go version:
go1.4.3 Git commit: a34a1d5 Built: Fri Nov 20 17:56:04 UTC
2015 OS/Arch: windows/amd64 An error occurred trying to connect:
Get http://localhost:2375/v1.21/version: dial tcp connection could be
made because the target machine actively refused it.
Can someone help to point out the direction to fix this issue? It is really troublesome to set up docker on Windows. Thank you very much.
I use docker 1.9.1 on Windows (7, 8 and even 10), but without docker registry, and without using --virtualbox-hostonly-cidr.
If you are to use that last option, check "Set a specific address ip when i create a docker container", where I mention issue 1709, which uses cidr in .1, not .100 (but getting a .100 ip address as a result):
docker-machine create -d virtualbox --virtualbox-hostonly-cidr "192.168.99.1/24" m99
If there's no other machine with the same cidr (Classless Inter-Domain Routing), the machine should always get the .100 IP upon start.

boot2docker - An error occurred trying to connect when running docker version command

When I use boot2docker to start the boot2docker-vm, then in gitbash I run the docker version command I get the following:
$ docker version
Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 7c8fca2
OS/Arch (client): windows/amd64
FATA[0021] An error occurred trying to connect: Get https://192.168.59.103:2376/v1.18/version: dial tcp 192.168.59.103:2376: ConnectEx tcp: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
However when I go into virtual box I see the boot2docker-vm is running.
When I stop the boot2docker-vm, & then start it myself - I can use the vm to use docker - it would be much easier to use gitbash to work with it...anyone have any ideas?
You have to init shell inside gitbash, use:
$ $(boot2docker shellinit)
in terminal.
Here is documentation for mac: https://docs.docker.com/installation/mac/.
This blog post describes the configuration of VirtualBox for Win64 systems after the boot2docker installation.
Change VirtualBox Global Settings to provide DHCP server on network adapter #2 instead of #3 with exactly the same settings as of #3
Change boot2docker-vm network configuration of the host-only network adapter from preconfigured adapter #3 to #2

Resources