docker does not run on windows error - windows

I've installed docker and followed the directions here: https://docs.docker.com/installation/windows/#installation but when I run boot2docker start this happens:
Trying to get IP one more time
exit status 255
Docker client does not run on Windows for now. Please use
"boot2docker" ssh
to SSH into the VM instead
Trying boot2docker ssh results in the same 255 error. I tried to get the VM IP with boot2docker IP but that also yielded nothing - I presume because boot2locker wasn't successful in the start process.
A couple of observations...I lloked at the vm settings and there wasn't any network or storage settings specified and the memory allocation in the vm settings didn't match the values in the config (boot2docker config). The boot2docker start/stop commands work.
I'm stumped.

I observed similar issue. Following steps helped me:
Open VirtualBox GUI.
Remove boot2docker-vm virtual machine.
Start Boot2Docker Start --- it will recreate boot2docker-vm virtual machine.

We had exactly this on someone's machine.
The solution for us was to find the
Run the VirtualBox UI (C:\program files\oracle....)
locate the VM (at the top)
select 'power off'
Once all that was done, boot2docker started correctly again.
In extremis, you could delete the boot2docker-vm image out of virtualbox, and it ought to re-install it.

go to the Oracle VM VirtualBox Manager, power off boot2docker-vm and start again. It worked for me.

just in case it helps. My problem was because boot2docker's default settings is beyond my laptop's capability (I know). I fixed the problem by changing the properties of boot2docker-vm through the VirtualBox GUI. Soon as I open thr properties I saw a few warnings at the bottom of the dialogue box, so I followed the hint and resolve those warnings, save the setttings and was able to start docker then.
I changed the CPU from 4->1, memory from 2G to 1.5G and video memory to 20M. Hope it helps.

Mostly you didn't enable the "Virtualization" in your BIOS. boot2docker needs to install 64bit OS in Virtualbox.

Its worth noting I had some huge problems trying to run docker on windows. Boot2docker would install OK with VritualBox 4.3.20. I could NOT run boot2docker or docker itself.
It took me ages to figure out that I had uninstall VirtualBox 4.3.20 and use 4.3.12 instead which worked first time like a treat!
So.. for Windows boot2docker only use VirtualBox 4.3.12.

Related

docker-machine does not create virtual machine

I have been going through the Docker get starting tutorial. I can't get docker-machine to create a virtual machine.
My setup:
Host Operating System: Windows 10 Professional
Guest Operating System: Ubuntu 18.04 running on Oracle VirtualBox.
All the Docker stuff is installed on the Ubuntu VM. Oracle VirtualBox is also installed on the Ubuntu machine.
Hyper-Threading is enabled in the BIOS of the physical machine. VirtualBox on Windows 10 also has Hyper-Threading enabled. Despite this, the following command gives an error.
sudo docker-machine create --driver virtualbox myvm1
Running pre-create checks...
Error with pre-create check: "This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory"
This error makes no sense, because VT-X is already enabled. This led me to try the following:
sudo docker-machine create default2 --virtualbox-no-vtx-check
This goes well until it tries to get an IP. Then it just hangs at the following:
Waiting for an IP...
I have tried searching on this. The only answers I can seem to find suggest saving the machine state of the VM created by docker-machine in VirtualBox and then running it in terminal mode. The problem is, there is never a machine created to begin with. I am at a loss of how to proceed. Does anyone know how to troubleshoot from this point forward?

Setting up docker on the mac: Cannot connect via localhost

I'm just setting up docker on my Mac. The installation worked and I got some containers running (following the getting-stared guide), but now I want to connect with my browser to localhost, to show a web app.
For that I'm following this guide: https://docs.docker.com/engine/userguide/containers/usingdocker/
In the last section it is said, that you simple go with your browser to: localhost:XXXXX wheras XXXXX is the port, that you found out using the command
docker ps -l
First problem: here nothing happends. The browser is showing an empty page (ERR_CONNECTION_REFUSED)
Further more in the guide it is explained, that for Mac you can check your ip address via the command:
docker-machine ip your_vm_name
Here appears the second problem: This command results in an error-message:
Host does not exist: "your_vm_name"
So my questions are:
How to set up the virtual machine (or "your_vm_name" respectively)?
Does it have to do anything with the vhosts file on my Mac OS?
Is there mybe a conflict with MAMP (which I'm also using sometimes)?
Thanks in advance!
And thanks to GianArb for the very fast answer! That solution works as well.
Just to contribute to the community, I just found out by myself, that the solution was too simple to be true.
Instead of your-vm-name use default (obviously the default-host that is set up by docker), so I just used:
docker-machine ip default
and then I got the right IP.
Hello the process to start to use docker on mac with docker-machine is like:
Create a new docker machine on virtualbox, you can use a name like "your_vm_name" or just "default" in this way you can not use the name because "default" is a keyword that docker-machine try to use when you don't specify nothing.
The problem here is, why docker-machine ip your_vm_name doesn't provide the good ip? Can you copy the result of your command
echo $DOCKER_HOST
Usually it's 192.168.99.100
thanks a lot
Actual for Mac OS:
If there is no real need in VirtualBox machine you can just remove it.
Docker can start Linux containers under Mac OS without any VirtualBox machines.
Without any VirtualBox machines, all exported ports are available on the localhost:*.
Remove docker machine
docker-machine ls
docker-machine stop default
docker-machine rm default
Make sure that you don't have the command eval $(docker-machine env ...) in your ~/.bashrc or ~/.zshrc.
Otherwise, nothing will work. You will see the error Error: No machine name(s) specified and no "default" machine exists.
By the default configuration no need to have any env variables like $DOCKER_*
In my case, the only docker installed by downloading a .dmg image from the official site works without any problems. Any versions installed via brew didn't work out of the box.
PS: tested on Mac OS 10.13 and 10.14

Boot2docker : image don't save

I'm starting to play with docker on my PC (windows 7) so I'm using Boot2Docker, but when I stop the VM all my work are remove. My questions are:
Why ?
How to solve this problems ?
finally I resolve my problem:
Solution I've made a boot2docker delete and then a boot2docker init, when I start/stop the VM it works correctly (and it starts faster
Why : I don't know, the only possible reason is that I install boot2docker ant activate the VT-x in the BIOS after

Vagrant Connection Refused Error

Virtual Box 4.3.14
Vagrant 1.6.3
and when I vagrant up I get this error
default: warning: connection refused. Retying...
it goes on and on until it gives up and says
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 am on windows 7, I even tried running cmd on administrator mode same thing
I even tried vagrant reload as I read on on other web resources, still same thing, it outputs the same thing
I did not tweak my virtualbox after install, basically just install virtualbox and install vagrant then run vagrant up
and oh by the way my vagrantfile and provisioning script is from here
https://gist.github.com/JeffreyWay/9244801
https://gist.github.com/JeffreyWay/9244714
Been googling and unfurtunately I can't find clear answer
Tnx in advance
It seems its a virtual box / vagrant version incompatibility issue
I uninstalled Virtual Box 4.3.14 and installed Virtual Box 4.3.12 and it worked. Basically I downgraded virtual box.
I hope this gets fixed soon.
Hope this helps anyone.
Open your vagrantfile using notepad and edit it so that it looks like this:
Please tally your vagrantfile with this one word by word. Then open BIOS and turn on virtualisation. Watch this video to learn how to do it. It is a very short video.
PS: You may need to uninstall vagrant before doing this. And in your Users folder in C:, there will be a folder named .vagrant.d, please delete that as well before following these steps.
Uninstalling vagrant will require that you run your machine as administrator. You can right click on Command Prompt (search cmd in windows search box) and click run as administrator. Type the following command: net user administrator /active:yes
You will get a message called command completed successfully. Now you can log off and see that there are two accounts, one of them is admin. You can log in from that and uninstall vagrant.

Unable to run vagrant up due to Vbox error (MS 81.)

I am on Windows 8.1
When i attempt to install vagrant and run it with virtual box i always get the following error.
"The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:
Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
Vagrant uses the VBoxManage binary that ships with VirtualBox, and requires
this to be available on the PATH. If VirtualBox is installed, please find the
VBoxManage binary and add it to the PATH environmental variable."
I have tried different things such as uninstalling both virtual box and vagrant and re-installing them.
I have tried installing vagrant first then vbox and the other way around also but no change.
I am new to vagrant so if anyone can assist please.
I bet that you're using the latest VirtualBox version (4.3.12). If so, there's a known issue which will be addressed in Vagrant 1.6.3:
https://github.com/mitchellh/vagrant/issues/3852
As a workaround you can install VirtualBox 4.3.10 and it will work flawlessly.
As Emyl said, you can either downgrade your VirtualBox or upgrade your Vagrant to 1.6.3(as the issue has been fixed in this version).
But if you want to have a quick fix on this issue you can simply change the environmental variable name for the Virtual Box installation path from VBOX_MSI_INSTALL_PATH to VBOX_INSTALL_PATH
(This PC -> Advanced System Settings -> Environmental Variables -> Search for VBOX_MSI_INSTALL_PATH and change it to VBOX_INSTALL_PATH)
Make sure to restart your terminal before doing vagrant up again.
You are done!
changing VBOX_MSI_INSTALL_PATH and change it to VBOX_INSTALL_PATH in environment variables and then restarting terminal resolved my issue :)
I also had this problem on Windows 8.1 and solved it by restarting my computer. If you have just installed VirtualBox, you may need to restart your command prompt or Windows for the environment variables to get read correctly when you run "vagrant up".
i had to run the cmd.exe as administrator to make this work after using Sri Harsha Kappala solution

Resources