Docker Quickstart Terminal fails to start VirtualBox VM in Windows 10 - windows

I've tried several times to start the Docker VM via the Docker Quickstart Terminal. After deleting the default virtual machine in VirtualBox I receive the following output
Creating Machine default...
Running pre-create checks...
Creating machine...
(default) OUT | Creating VirtualBox VM...
(default) OUT | Creating SSH key...
(default) OUT | Starting VirtualBox VM...
Error creating machine: Error in driver during machine creation: exit status 1
Looks like something went wrong... Press any key to continue...
To troubleshoot further, I attempted to start the default machine in the VirtualBox GUI directly using Start > Headless Start, as suggested in other Docker issues. The startup failed and I received an error dialog box with the content:
Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter' (VERR_INTNET_FLT_IF_NOT_FOUND).
Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND).
Result Code:
E_FAIL (0x80004005)
Component:
ConsoleWrap
Interface:
IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
Versions of related components:
VirtualBox Version 5.0.11 r104393
Docker Toolbox 1.9.1a
Windows 10 Version 1511 (OS Build 10586.14)

One of the answers to this question solved my problem. Here it is with a few edits:
I found a solution
Open Windows Network Connections
Right click on VirtualBox Host only adapter that was created
Choose properties
Check "VirtualBox NDIS6 Bridged Networking driver"
Disable and Enable the highlighted item
For me "VirtualBox NDIS6 Bridged Networking Driver" was not checked. I checked it and clicked OK to close the Properties window. After that, the Docker Quickstart Terminal was able to start the VM successfully.

The same thing happened to me. At this moment I am using Windows Home.
At least in my case, what happened was that the environment variables DOCKER_MACHINE and DOCKER_TOOLBOX_INSTALL_PATH were not created for the system.
I just had to add them and it worked.

I tried to follow #chris-hunt answer, but I didn't found the highlighted item. I realized it was due to the fact I didn't installed the VirtualBOX that comes in the Docket Tools installation. I think I was using an older version.
So I uninstalled docker tools AND VitualBOX, both on windows Control Panel. After that, I reinstalled Docker Tools with the VirtualBOX checked, and it finally worked.

Related

Starting minikube on Windows 7 fails to start with - Error getting state for host: machine does not exist

Have been trying to setup Kubernetes for local development on my Windows 7 machine with a VirtualBox VM Driver. Installing and running minikube fails each time with the below error:
D:\minikube>minikube start --vm-driver=virtualbox
Starting local Kubernetes v1.9.0 cluster...
Starting VM...
E0219 09:47:24.441727 4220 start.go:159] Error starting host: Error getting state for host: machine does not exist.
Retrying.
E0219 09:47:24.448727 4220 start.go:165] Error starting host: Error getting state for host: machine does not exist
E0219 09:47:54.448727 4220 util.go:151] Error uploading error message: :
Post https://clouderrorreporting.googleapis.com/v1beta1/projects/k8s-minikube/events:report?key=AIzaSyACUwzG0dEPcl-eOgpDKnyKoUFgHdfoFuA: dial tcp 172.217.25.138:443: i/o timeout
I suspected this may be happening due to minikube cache downloading at a network drive folder (N:) due to enterprise configurations in my laptop, however, copying the .minikube folder from N:\.minikube to C:\Users\abc123\.minikube has not abated the problem.
Do let me know if someone has managed to solve it.
I ran into the same error on osx after re-installing minikube. Simply deleting the minikube VM and restarting fixed everything:
$ minikube delete
$ minikube start
Go to C:\Users\\
Delete the .minikube folder
Start minikube (minikube.exe start --kubernetes-version="v1.10.0" --vm-driver="virtualbox")
Try using powershell/cygwin instead of cmd.
Also delete .minikube folder
do minikube delete
then minikube start
In certain scenarios, it may be an issue with your VM driver. If you don't specify one, it may default to VirtualBox. But if you have HyperV instead (due to installing docker on windows, for example) then it won't start. You may have to start it like so:
minikube start --vm-driver hyperv
Or whatever is appropriate.

Vagrant + Virtual Box Session error

I am trying to fire up a vm via Vagrant using VirtualBox.
I got this error when I execute the command vagrant up (see below) using the latest versions of Virtual box 5.1.4 and Vagrant 1.7.4, therefore I downgraded Virtual box to 5.0 and Vagrant to 1.7.4 but it did not help.
I have installed the vagrant plugins vagrant-omnibus, vagrant-cashier and vagrant-berkshelf (version=4.1).
My OS is Mac OS X El Capitan and the vm that I am trying to run is a centos 6.
The final part of the output of the command "vagrant up" is:
default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "63825f6b-5189-4b66-bb7a-167c7f742c49", "--type", "headless"]
Stderr: VBoxManage: error: The VM session was aborted
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component SessionMachine, interface Session
I googled this error and as many threads suggest I tried to restart VirtualBox, but I haven't had any success..
Below I copied the last few lines of the VM logs:
00:00:00.085763 APIC: Activating Local APIC
00:00:00.085782 CPUM: SetGuestCpuIdFeature: Enabled APIC
00:00:00.086115 PIT: mode=3 count=0x10000 (65536) - 18.20 Hz (ch=0)
00:00:00.089080 Shared Folders service loaded
00:00:00.094857 DrvBlock: Flushes will be ignored
00:00:00.094868 DrvBlock: Async flushes will be passed to the disk
00:00:00.094970 VD: VDInit finished
00:00:00.095086 AIOMgr: Endpoint for file '/Users/daniele/VirtualBox VMs/my-vm_default_1475241914862_51348/centos-6.7-x86_64-disk1.vmdk' (flags 000c0723) created successfully
00:00:00.098079 VD: Opening the disk took 3191386 ns
00:00:00.098106 AHCI: LUN#0: disk, PCHS=16383/16/63, total number of sectors 83886080
00:00:00.098115 AHCI: LUN#0: using async I/O
00:00:00.098190 AHCI#0: Reset the HBA
00:00:00.098353 PIIX3 ATA: LUN#0: no unit
00:00:00.098358 PIIX3 ATA: LUN#1: no unit
00:00:00.098376 PIIX3 ATA: LUN#2: no unit
00:00:00.098380 PIIX3 ATA: LUN#3: no unit
00:00:00.098398 PIIX3 ATA: Ctl#0: finished processing RESET
00:00:00.098411 PIIX3 ATA: Ctl#1: finished processing RESET
00:00:00.104664 NAT: Guest address guess set to 10.0.2.15 by initialization
I ran out of ideas
Possible Solution 1:
I'm troubleshooting the same problem but with another Linux distro. I found a workaround for Mint 18 that may work for you too.
When I go into VirtualBox, and set the troublesome VM's Settings>Network value to 'Bridged..' or 'NAT network', then the VM starts. Further, I can browse/curl the Internet from that running VM.
The VirtualBox forums show that others are getting this error too.
Possible Solution 2:
In my experiments, older VirtualBox versions don't have this network problem. For example, versions 5.0.24 and 5.0.18 allow VM creation with no need for manual intervention.
Additional Info:
It's worth noting, that if you use Docker Toolbox, it will silently upgrade VirtualBox to whatever version it wants (e.g. Docker Toolbox 1.12.2 forces VirtualBox to 5.1.6).
At first I thought this problem was caused by VirtualBox defaulting to "NAT" as the network choice. But that's not the cause. VirtualBox 5.0.24 and 5.018 both use "NAT" and they work fine.
It was a bug in VirtualBox, it is now fixed in 5.1.8.
For reference: https://www.virtualbox.org/ticket/15687

Vagrant Windows 10 'hangs" on vagrant up

I've been having a problem with Vagrant (1.8.1, using VirtualBox 5.0.20) on Windows 10.
When I follow the getting started tutorial https://www.vagrantup.com/docs/getting-started/ after I have typed vagrant up, my console is stuck on:
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
It does not continue, i can see the VM boot inside of VirtualBox, and i can use the VirtualBox GUI to log in with the default credentials, so the VM itself is working.
According to https://www.vagrantup.com/docs/virtualbox/common-issues.html
I should run VirtualBox as admin and do vagrant up from a cmd.exe with admin rights, but when i do that i get the message:
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["modifyvm", "1b9d4f9b-04d8-48bf-8d16-d3aed99d341b", "--natpf1", "delete", "ssh"]
Stderr: VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended info not available)
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at line 493 of file VBoxManageModifyVM.cpp
This seems different from the 100's of posts all around the net like these:
https://github.com/Varying-Vagrant-Vagrants/VVV/issues/375
since I am not getting antying after the output listed above, it just sits there and after alike 10 minutes it comes up with the message:
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
I've also read Vagrant stuck in "Waiting for VM to Boot" but it did not help me.
Is there anything else I am missing here?
In my case, vagrant up was hanging on 'Syncing VM folder' , on Windows 7 with Vagrant 1.9.3 and VBox 5.1.18 . It turned out that it requires Powershell >= 3.0.
I downloaded it from https://www.google.ca/search?q=powershell+3.0+download&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&ei=x0fdWLfsBubQXu2OorAD, and worked fine afterwards.
try to turn off the VM from VirtualBox or from command line
C:\Progra~1\Oracle\VirtualBox\VBoxManage.exe controlvm default poweroff
then restart the VM from vagrant.
In case you get an error when powering off the VM, force the shutdown
C:\Progra~1\Oracle\VirtualBox\VBoxManage.exe startvm default --type emergencystop
Then vagrant up will should work nicely
I actually already found my problem. It was a .dll from some addware scanner that was preventing the virtualbox VM from starting. I lost the link to the forum topic which helped me solve this unfortunately.
What i did was open the logs from the VM in VirtualBox and had a read trough. At some point, a line indicating an error appeared with a .dll name which was the culprit. I deleted the offending .dll files from my pc and it was fixed.
If i find the link again to the topic explaining exactly what dll it was i will post it here. Im not at the machine that i fixed the problem on now so i can't access my search history.
Hope it will work for you as it worked for me
I'm still investigating why, but as a solution it works.
our case - when typed in cmd (inside vagrand image directory) "vagrant up"
it open virtual box vm and stuck on "default: SSH auth method:
private key" as mentioned in question
so fix by this steps:
open manually virtual box (besides what already opened by vagrant up)
run the vm that had added to the list (by vagrant up)
open CMD
type "Vagrant ssh"
and it will work
hope it helped,
best regards

Docker unreachable after computer sleep

I have just installed docker using docker-toolbox 1.8.2 on Windows 10.
Due to due to this issue I had to recreate the docker image using these commands
docker-machine rm default
docker-machine --native-ssh create -d virtualbox default
After that it has been working fine, except for one problem:
When the PC has gone to sleep and then wakes again, the docker commands can no longer connect. Example:
> docker images
An error occurred trying to connect: Get https://192.168.99.100:2376/v1.20/images/json:
dial tcp 192.168.99.100: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 the docker-machine lists the machine as running:
> docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
default * virtualbox Running tcp://192.168.99.100:2376
I can also confirm in VirtualBox that the VM screen seems to be active.
I have tried starting and stopping the machine, but that does not help
C:\x> docker-machine stop default
C:\x> docker-machine start default
Starting VM...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
C:\x> docker-machine env default --shell=powershell
Ironically, the last command hangs, so I never get any environment settings.
The only thing that helps is to restart the whole PC. But that should be unnecessary?
I have also posted this as an issue on the docker github repository,but that was closed. A related issue seems to be this one, but no workaround or solution has been posted for Windows.
After hous of fighting with VirtualBox + Docker Toolbox, I finally found the way, how to make Docker working again (even without restarting all the containers):
Wake up PC from sleep
Try docker images (won`t work)
Open VirtualBox -> Close VM with saving state (CTRL+V)
Run your VM again
Try docker images again (now should work)
Please note: All steps are in VirtualBox only! Running docker-machine restart default will create another host-only adapter, which is something you do not want. If you did it anyway, delete all additionally created adapters (File->Preferences->Network on VirtualBox), then follow steps 1-5.
I have experienced the exact same symptoms on Windows 8.1... The thing is that it's not really a docker-specific issue, but more how Windows manages the VirtualBox network adapters after sleep (I think...). The culprit in my case is that the network adapter's addresses were becoming private after sleep (they became 169.* addresses).
Credits to this guy who gave me the idea: http://lyngtinh.blogspot.ca/2011/12/how-to-disable-autoconfiguration-ipv4.html
Fix:
Start a command prompt as Administrator
Find out the "useful" network adapters: ipconfig /all. The useful ones in my case were the ones labeled "VirtualBox Host-Only Ethernet Adapter" that didn't have private ips (not starting with 169.*).
Run this command and note the "Idx" of the useful VirtualBox network adapters: netsh interface ipv4 show inter.
Run this command to disable the IP auto configuration: netsh interface ipv4 set interface <idx> dadtransmits=0 store=persistent. Replace <idx> with each index found in the previous step.
Restart Windows
Afterwards, I was able to docker-machine start default, then docker-machine env default --shell cmd, put the PC to sleep, wake up and run docker-machine env default --shell cmd again.
I found that removing 'host only adapter' (File->Preferences->Network on VirtualBox), and restart the docker-machine helps.
Not a real solution. But probably better over restart the computer.
Having tried all the other answers here, and having varying but not consistent success, the following seems to reliably bring it back for me after this problem occurs.
Open a powershell/command window (I have most success if I run all docker-machine commands in a powershell window opened as administrator, I don't know if that's important or not) then run (where "dev" is the name of your docker machine instance):
docker-machine ssh dev
Then on the terminal that is opened, run:
sudo shutdown -r now
When the machine restarts, it seems to refresh the network and work correctly. Note, however, that simply running docker-machine restart dev did not have the same effect for me.
Your machine needs to be running before you can do the ssh, so if it's not running, execute docker-machine start dev before trying to SSH.
Had the same problem on Windows 8.1 and docker toolbox 1.12.0
None of the above solutions worked for me, too.
[edited]
Found another way to make docker work after system wake up:
In the docker Quickstart Terminal window, stop docker process Ctrl-C (if it is still running)
Run command docker-compose down
Shut down docker with docker-machine stop default
Exit terminal window Ctrl-D
Run Quickstart Terminal again and do all subsequent steps you need.
This worked for me, on Windows host machine.
Configure your network adapter to
1) Allow the network adapter to wake the computer,
2) Allow a magic packet to wake the computer,
3) Allow IPV6
http://www.worldstart.com/dropped-internet-connection-in-sleep-mode/
Also, on virtual box network settings, go to advanced, and allow promiscuous mode to VM machines, or allow all

A connection with the name you specified already exists

I am setting up my previously working vagrant environment in Windows 10. I've updated to the newest version of both VirtualBox (https://www.virtualbox.org/ticket/14040) and Vagrant.
When I vagrant up I get an error: Cannot rename this connection. A connection with the name you specified already exists. Specify a different name.
I've since tried deleting all of my boxes, deleting the .vagrant and .virtualbox directories, reinstalling both virtualbox and vagrant. Yet, I always get the same error. Here is the error message from my console:
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.
If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run vagrant up while the
VirtualBox GUI is open.
The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.
I had the same issue with Scotchbox, and even after installing the test build the issue was still there.
This is how I fixed the issue.
Step 1: Download and install https://www.virtualbox.org/attachment/ticket/14040/VBox-Win10-fix-14040.exe and leave it running in the background
Step 2: Head to the Virtual box program files ( C:\Program Files\Oracle\VirtualBox ).
Step 3: Go to compatibility for these three .exe ( Virtualbox.exe, VBoxHeadless.exe, and VBoxManage.exe ) and choose windows 7.
Then just run vagrant up again and it should work.
Right, I've spent a lot of time trying to resolve this. And I finally came across a post on the laracasts forum:
I've been able to get Homestead up and running after a day of troubleshooting with the following steps:
Installed the VirtualBox 5.0.1 test build
https://www.virtualbox.org/download/testcase/VirtualBox-5.0.1-101902-Win.exe
Information at: https://www.virtualbox.org/ticket/14040
I also reinstalled Vagrant 1.7.4
This solved the initial issue with VirtualBox, but presented another
issue. When I attempted to "vagrant up" I would get a pop-up error
message from VirtualBox about not being able to rename the connection,
the VM wouldn't boot, and I would get the error message that
#antonybudianto posted in terminal.
I applied a suggestion made by Venimus in this thread:
https://github.com/mitchellh/vagrant/issues/6059
I edited line 17 in /Homestead/scripts/homestead.rb as follows:
config.vm.network "private_network", ip: "192.168.10.10", name: "VirtualBox Host-Only Ethernet Adapter #3"
Apparently the trick is to include the name of the host-only adapter
that you've already set up in VirtualBox. By doing this, you prevent
Vagrant from attempting to rename the connection. You just need to
make sure that the name matches the name of your adapter in Windows.
Also, go into the VirtualBox GUI and make sure that the host-only
adapter is on the same network, but not the same ip. My homestead is
192.168.10.10, my VirtualBox host-only adapter is set to 192.168.10.9.
This seems to be working well for me, and has the advantage of not
changing your Vagrant install at all. It's a Homestead-only
modification.
https://laracasts.com/discuss/channels/general-discussion/windows-10-vagrant-virtualbox-homestead/replies/87037
It has worked for me. Do note this part:
You just need to make sure that the name matches the name of your
adapter in Windows. Also, go into the VirtualBox GUI and make sure
that the host-only adapter is on the same network, but not the same
ip. My homestead is 192.168.10.10, my VirtualBox host-only adapter is
set to 192.168.10.9.
Hope it helps.
You have to uncheck the actual Ethernet network adapter by click rightclick >> Properties>> uncheckbox for virtualBox NDIS6 Brdige Networking Drive
so you have to check that checkbox on Virtual adapter only
This problem appears on my Windows 7, using vagrant 1.9.6 and VirtualBox 5.1.22.
The problem was that I previously removed some of the Host-Only adapters.
A workaround for this problem was to change the IPv4 address of existing Host-Only adapter to match the VagrantFile configuration:
look for IP in Vagrantfile for config.vm.network:
config.vm.network "private_network", ip: "192.168.42.10"
modify the IPv4 address of existing Host-only adapter to match the IP. Got to VirtualBox -> File -> Preferences -> Network -> Host-only Networks - > right click on VirtualBox Host-Only Ethernet Adapter (Edit Host-only Network). Change IPv4 address to:
192.168.42.1
Uninstall VirtualBox using CCLeaner then remove virtual adapter if it still exist from network and sharing center. For remove try using Device Manager and find networks and find the virtualbox adapters and remove them.
Then finally install it and don't launch it. Go to installation folder and right click on it and run it as Administrator.
:)
Njoy... Happy coding. :)

Resources