Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

virtualbox: intermittent machine create fails #479

Closed
ramschmaerchen opened this issue Feb 3, 2015 · 76 comments
Closed

virtualbox: intermittent machine create fails #479

ramschmaerchen opened this issue Feb 3, 2015 · 76 comments

Comments

@ramschmaerchen
Copy link

If running --virtualbox-disk-size docker-machine create on OSX, no new docker machines can be generated anymore. To resolve, .docker needs to be deleted.

After deleting .docker, creating a machine works flawlessly again.

Please see my first comment for updated information

Behaviour

Most of the times, docker-machine --virtualbox-disk-size waits endlessly for VM to start, although it was started already (regarding to virtualbox).

Stopping the start process, docker ls shows the instance as running, without URL however:

dockermachine ls
NAME     ACTIVE   DRIVER       STATE     URL
mine            virtualbox   Running
    dockermachine config mine
    Bad port '0'
    FATA[0000] Error getting machine url: exit status 255
@ehazlett
Copy link
Contributor

ehazlett commented Feb 3, 2015

thanks for reporting. I just confirmed this is working. Can you paste the exact create command you used?

@ehazlett
Copy link
Contributor

ehazlett commented Feb 3, 2015

@ramschmaerchen there was a bug with the way the cli args were processed. could you try this again from master and see if it still errors? thx

@ramschmaerchen
Copy link
Author

Ok, I tried to investigate this issue further.

First of all, master did not fix it.

Specs

  • OSX 10.9.5
  • docker-machine master branch (0.1.0, 2.4.2015)
  • docker 1.4.1
  • boot2docker not installed (well, uninstalled,...)
  • VirtualBox 4.3.20 r96996

Investigation

  • The behaviour is not reproducible, at least not yet
  • Sometimes, machines are created successfully, sometimes they are not.
  • Failure is not dependent on --virtual-disk-size anymore (?) (master branch). I guess --virtual-disk-size could be misleading.

Step by step

  • docker-machine create -d virtualbox dev
  • Endlessly Waiting for VM to start...
  • docker-machine ls shows that the machine did start, but did not get a URI
  • Shutting dev down via VirtualBox
  • Starting dev via VirtualBox
  • The machine dev generates a new server certificate on docker init
  • Shutting dev down via virtualbox
  • docker-machine start dev
  • Waiting for VM to start... endlessly
  • Virtualmachine shows that, again, this machine generated a new cert on start
  • Build TLS certs for...

Conclusion

The only thing I could see was, that non-working machines are generating a new certificate in the docker init process on every boot.

Side effects

Both, working and non-working machines, fail on ipv6

@sthulb
Copy link
Contributor

sthulb commented Feb 5, 2015

The IPv6 support in machine for virtual box doesn't exist, I'm not sure anyone has tried yet.

But we should look into why this is failing. I'd also like to see unified arguments for drivers. There's no reason drivers can't share flags. Things like disk size, ram and auth credentials could be reused.

@ehazlett
Copy link
Contributor

ehazlett commented Feb 5, 2015

+1 sthulb

@ramschmaerchen could you also run the command with debug (docker-machine -D create -d virtualbox ...). This will help us troubleshoot as well.

@ramschmaerchen
Copy link
Author

Sure. I censored keys and stuff but made sure the keys and names are the same (same name for same key)

Working machine

dockermachine -D create -d virtualbox dev

INFO[0001] Creating SSH key...
DEBU[0001] executing: /usr/bin/ssh-keygen ssh-keygen -t rsa -N -f /Users/thisuser/.docker/machines/dev/id_rsa

Generating public/private rsa key pair.
Your identification has been saved in /Users/thisuser/.docker/machines/dev/id_rsa.
Your public key has been saved in /Users/thisuser/.docker/machines/dev/id_rsa.pub.
The key fingerprint is:
foobar thisuser@localhost
The key's randomart image is:
+--[ RSA 2048]----+
| foobar |
+-----------------+
INFO[0001] Creating VirtualBox VM...
DEBU[0001] Creating 20000 MB hard disk image...
Converting from raw image file="stdin" to file="/Users/thisuser/.docker/machines/dev/disk.vmdk"...
Creating dynamic image with size 20971520000 bytes (20000MB)...
DEBU[0017] executing: VBoxManage createvm --basefolder /Users/thisuser/.docker/machines/dev --name dev --register
Virtual machine 'dev' is created and registered.
UUID: d6ec89a6-98d1-40b7-85c5-79d109230e9a
Settings file: '/Users/thisuser/.docker/machines/dev/dev/dev.vbox'
DEBU[0017] executing: VBoxManage modifyvm dev --firmware bios --bioslogofadein off --bioslogofadeout off --natdnshostresolver1 on --bioslogodisplaytime 0 --biosbootmenu disabled --ostype Linux26_64 --cpus 2 --memory 1024 --acpi on --ioapic on --rtcuseutc on --cpuhotplug off --pae on --synthcpu off --hpet on --hwvirtex on --nestedpaging on --largepages on --vtxvpid on --accelerate3d off --boot1 dvd
DEBU[0018] executing: VBoxManage modifyvm dev --nic1 nat --nictype1 virtio --cableconnected1 on
DEBU[0018] executing: VBoxManage modifyvm dev --natpf1 ssh,tcp,127.0.0.1,49178,,22
DEBU[0018] executing: VBoxManage list hostonlyifs
DEBU[0018] executing: VBoxManage modifyvm dev --nic2 hostonly --nictype2 virtio --hostonlyadapter2 vboxnet2 --cableconnected2 on
DEBU[0018] executing: VBoxManage storagectl dev --name SATA --add sata --hostiocache on
DEBU[0018] executing: VBoxManage storageattach dev --storagectl SATA --port 0 --device 0 --type dvddrive --medium /Users/thisuser/.docker/machines/dev/boot2docker.iso
DEBU[0018] executing: VBoxManage storageattach dev --storagectl SATA --port 1 --device 0 --type hdd --medium /Users/thisuser/.docker/machines/dev/disk.vmdk
DEBU[0018] executing: VBoxManage guestproperty set dev /VirtualBox/GuestAdd/SharedFolders/MountPrefix /
DEBU[0018] executing: VBoxManage guestproperty set dev /VirtualBox/GuestAdd/SharedFolders/MountDir /
DEBU[0018] executing: VBoxManage sharedfolder add dev --name Users --hostpath /Users --automount
DEBU[0018] executing: VBoxManage setextradata dev VBoxInternal2/SharedFoldersEnableSymlinksCreate/Users 1
INFO[0018] Starting VirtualBox VM...
DEBU[0018] executing: VBoxManage startvm dev --type headless
Waiting for VM "dev" to power on...
VM "dev" has been successfully started.
INFO[0019] Waiting for VM to start...
DEBU[0062] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 49178 -i /Users/thisuser/.docker/machines/dev/id_rsa docker@localhost sudo hostname dev && echo "dev" | sudo tee /var/lib/boot2docker/etc/hostname
dev
DEBU[0066] executing: VBoxManage showvminfo dev --machinereadable
DEBU[0066] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 49178 -i /Users/thisuser/.docker/machines/dev/id_rsa docker@localhost ip addr show dev eth1
DEBU[0066] SSH returned: 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:98:75:ca brd ff:ff:ff:ff:ff:ff
inet 192.168.99.100/24 brd 192.168.99.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe98:75ca/64 scope link
valid_lft forever preferred_lft forever

END SSH

DEBU[0066] generating server cert: /Users/thisuser/.docker/machines/dev/server.pem
DEBU[0067] Stopping Docker...
DEBU[0067] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 49178 -i /Users/thisuser/.docker/machines/dev/id_rsa docker@localhost if [ -e /var/run/docker.pid ]; then sudo /etc/init.d/docker stop ; fi
DEBU[0068] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 49178 -i /Users/thisuser/.docker/machines/dev/id_rsa docker@localhost sudo mkdir -p /var/lib/boot2docker
DEBU[0068] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 49178 -i /Users/thisuser/.docker/machines/dev/id_rsa docker@localhost echo "-----BEGIN CERTIFICATE-----
Mycert
-----END CERTIFICATE-----
" | sudo tee -a /var/lib/boot2docker/ca.pem
-----BEGIN CERTIFICATE-----
Mycert
-----END CERTIFICATE-----

DEBU[0068] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 49178 -i /Users/thisuser/.docker/machines/dev/id_rsa docker@localhost echo "-----BEGIN RSA PRIVATE KEY-----
superkey==
-----END RSA PRIVATE KEY-----
" | sudo tee -a /var/lib/boot2docker/server-key.pem
-----BEGIN RSA PRIVATE KEY-----
superkey==
-----END RSA PRIVATE KEY-----

DEBU[0068] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 49178 -i /Users/thisuser/.docker/machines/dev/id_rsa docker@localhost echo "-----BEGIN CERTIFICATE-----
boringcert
-----END CERTIFICATE-----
" | sudo tee -a /var/lib/boot2docker/server.pem
-----BEGIN CERTIFICATE-----
boringcert
-----END CERTIFICATE-----

DEBU[0068] executing: VBoxManage showvminfo dev --machinereadable
DEBU[0068] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 49178 -i /Users/thisuser/.docker/machines/dev/id_rsa docker@localhost ip addr show dev eth1
DEBU[0068] SSH returned: 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:98:75:ca brd ff:ff:ff:ff:ff:ff
inet 192.168.99.100/24 brd 192.168.99.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe98:75ca/64 scope link
valid_lft forever preferred_lft forever

END SSH

DEBU[0068] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 49178 -i /Users/thisuser/.docker/machines/dev/id_rsa docker@localhost echo "EXTRA_ARGS='--tlsverify
--tlscacert=/var/lib/boot2docker/ca.pem
--tlskey=/var/lib/boot2docker/server-key.pem
--tlscert=/var/lib/boot2docker/server.pem -H tcp://0.0.0.0:2376'
CACERT=/var/lib/boot2docker/ca.pem
SERVERCERT=/var/lib/boot2docker/server-key.pem
SERVERKEY=/var/lib/boot2docker/server.pem
DOCKER_TLS=no" | sudo tee -a /var/lib/boot2docker/profile
EXTRA_ARGS='--tlsverify --tlscacert=/var/lib/boot2docker/ca.pem --tlskey=/var/lib/boot2docker/server-key.pem --tlscert=/var/lib/boot2docker/server.pem -H tcp://0.0.0.0:2376'
CACERT=/var/lib/boot2docker/ca.pem
SERVERCERT=/var/lib/boot2docker/server-key.pem
SERVERKEY=/var/lib/boot2docker/server.pem
DOCKER_TLS=no
DEBU[0068] Starting Docker...
DEBU[0068] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 49178 -i /Users/thisuser/.docker/machines/dev/id_rsa docker@localhost sudo /etc/init.d/docker start
INFO[0069] "dev" has been created and is now the active machine
INFO[0069] Configure docker client with: $(dockermachine env dev)

@ramschmaerchen
Copy link
Author

The non-working machine is not generating certs and keys upon creation.

Non-Working Machine

dockermachine -D create -d virtualbox dev2

INFO[0001] Creating SSH key...
DEBU[0001] executing: /usr/bin/ssh-keygen ssh-keygen -t rsa -N -f /Users/thisuser/.docker/machines/dev2/id_rsa

Generating public/private rsa key pair.
Your identification has been saved in /Users/thisuser/.docker/machines/dev2/id_rsa.
Your public key has been saved in /Users/thisuser/.docker/machines/dev2/id_rsa.pub.
The key fingerprint is:
myfingerprint thisuser@localhost
The key's randomart image is:
+--[ RSA 2048]----+
| myfingerprint |
+-----------------+
INFO[0001] Creating VirtualBox VM...
DEBU[0001] Creating 20000 MB hard disk image...
Converting from raw image file="stdin" to file="/Users/thisuser/.docker/machines/dev2/disk.vmdk"...
Creating dynamic image with size 20971520000 bytes (20000MB)...
DEBU[0020] executing: VBoxManage createvm --basefolder /Users/thisuser/.docker/machines/dev2 --name dev2 --register
Virtual machine 'dev2' is created and registered.
UUID: b743f20e-fcc9-4c26-8c63-fb5f4e8ef423
Settings file: '/Users/thisuser/.docker/machines/dev2/dev2/dev2.vbox'
DEBU[0020] executing: VBoxManage modifyvm dev2 --firmware bios --bioslogofadein off --bioslogofadeout off --natdnshostresolver1 on --bioslogodisplaytime 0 --biosbootmenu disabled --ostype Linux26_64 --cpus 2 --memory 1024 --acpi on --ioapic on --rtcuseutc on --cpuhotplug off --pae on --synthcpu off --hpet on --hwvirtex on --nestedpaging on --largepages on --vtxvpid on --accelerate3d off --boot1 dvd
DEBU[0020] executing: VBoxManage modifyvm dev2 --nic1 nat --nictype1 virtio --cableconnected1 on
DEBU[0020] executing: VBoxManage modifyvm dev2 --natpf1 ssh,tcp,127.0.0.1,49175,,22
DEBU[0020] executing: VBoxManage list hostonlyifs
DEBU[0020] executing: VBoxManage modifyvm dev2 --nic2 hostonly --nictype2 virtio --hostonlyadapter2 vboxnet2 --cableconnected2 on
DEBU[0021] executing: VBoxManage storagectl dev2 --name SATA --add sata --hostiocache on
DEBU[0021] executing: VBoxManage storageattach dev2 --storagectl SATA --port 0 --device 0 --type dvddrive --medium /Users/thisuser/.docker/machines/dev2/boot2docker.iso
DEBU[0021] executing: VBoxManage storageattach dev2 --storagectl SATA --port 1 --device 0 --type hdd --medium /Users/thisuser/.docker/machines/dev2/disk.vmdk
DEBU[0021] executing: VBoxManage guestproperty set dev2 /VirtualBox/GuestAdd/SharedFolders/MountPrefix /
DEBU[0021] executing: VBoxManage guestproperty set dev2 /VirtualBox/GuestAdd/SharedFolders/MountDir /
DEBU[0021] executing: VBoxManage sharedfolder add dev2 --name Users --hostpath /Users --automount
DEBU[0021] executing: VBoxManage setextradata dev2 VBoxInternal2/SharedFoldersEnableSymlinksCreate/Users 1
INFO[0021] Starting VirtualBox VM...
DEBU[0021] executing: VBoxManage startvm dev2 --type headless
Waiting for VM "dev2" to power on...
VM "dev2" has been successfully started.

@ehazlett
Copy link
Contributor

ehazlett commented Feb 5, 2015

Thanks. Could you also post the actual machine command line you are running?

@ramschmaerchen
Copy link
Author

Sure, nothing fancy:
dockermachine -D create -d virtualbox dev

Edited the comments above.

@ehazlett
Copy link
Contributor

ehazlett commented Feb 6, 2015

Ok. Is this from the RC2 or master? Also, can you try to remove (or backup) the existing ~/.docker/machines directory and try creation again?

I guess the obvious question is what is the difference between machines? OS version, arch, VirtualBox version, etc?

@ramschmaerchen
Copy link
Author

Besides of the original entry, I always used master branch 4th Feb 2015.

Sorry for not mentioning: Removing .docker does not fix anything. I did not edit the original message as I was trying with RC2 then. With RC2, removing .docker worked. With master, everything is happening by chance. Sometimes it works, sometimes not. There is no way I am able to tell why it works.

Here is what I tried between creation of new machines:

  • Restarting the Computer
  • Starting / Stopping with dockermachine
  • Starting / Stopping with virtualbox
  • Removing .docker

I created 100 machines the last two days and was not able to figure out any pattern.

@ehazlett
Copy link
Contributor

ehazlett commented Feb 6, 2015

Ok so just to confirm, it is working some times? If that's the case, what is your Host OS (version) and VirtualBox version of the machine that isn't working?

@ramschmaerchen
Copy link
Author

Yes, sometimes it is working, sometimes it is not, as mentioned in the comments. Specs are in the third comment. I added VirtualBox information. Quick access: VirtualBox 4.3.20 r96996

@ehazlett ehazlett changed the title docker-machine --virtualbox-disk-size breaks behaviour (OSX) virtualbox: intermittent machine create fails Feb 6, 2015
@ramschmaerchen
Copy link
Author

After several tests I can confirm that RC2 is NOT working any better if .docker has been deleted before creating new machines.

@nathanleclaire
Copy link
Contributor

I have, with a decent enough level of frequency to be considered worrisome, gotten that "Bad port '0'" error from VBox machines as well.

@ehazlett ehazlett added this to the 0.2.0 milestone Feb 26, 2015
@vdemeester
Copy link

Same here, sometimes it works, most of the time not.

DEBU[0025] STDOUT: Waiting for VM "node1" to power on...
VM "node1" has been successfully started.

DEBU[0025] STDERR:                                      
INFO[0025] Waiting for VM to start...

For example, I made a script that create 5 docker-machine with the driver virtualbox (one is going to be a swarm-master, the other agents) for a demo. The creation of the first machine is ok, then it fails most of the time on the second one (hanging on Waiting for VM to start...).

Cleaning $HOME/.docker, $HOME/.config/VirtualBox, remove dhcpservers (VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnetX) and hostonly interfaces (vboxmanage hostonlyif remove vboxnet0) doesn't make it work better. No real idea why it's hanging though..

@ehazlett
Copy link
Contributor

ehazlett commented Mar 6, 2015

@vdemeester are you adding delays in the script? with VirtualBox, if you create the VMs too quickly, virtualbox will do that exact error. For example, in @nathanleclaire multiple instance PR, he doesn't launch them concurrently but rather queues them because of this behavior.

@vdemeester
Copy link

@ehazlett Yes I added a delay 5 to 10s and it's working a little better, few of nodes have created but in the end I got same error for one node.

What's strange is that docker-machine is waiting for the VM to start, but if I look at the VirtualBox machine (using the UI), I see that boot2docker is started.. It seems that for a reason I don't know, docker-machine do not detect that it's started in some cases. I'll try to take a look at the driver code (my golang knowledge is kinda small but :P), on how it's checking the availability of the VM.

@nathanleclaire
Copy link
Contributor

@vdemeester Sorry to hear about the trouble. Could you please post the following information when you get a chance (it will help greatly in debugging):

  • Host OS and OS version
  • Virtualbox Version
  • Full debug output from a failed command

Thanks!

@ehazlett
Copy link
Contributor

ehazlett commented Mar 6, 2015

@vdemeester that's the same behavior I've seen too. You can see the thumbnail of it running but never gets an IP. I think it would be beneficial to add a flag to not make the VM headless -- then we could at least login via the console to debug.

@vdemeester
Copy link

@nathanleclaire Yes :)

The Host is Archlinux, current update (as it's a rolling release, there no real way to point out a version). It makes me think I did not try my script on Ubuntu 14.04 for example, I'll keep you update when I do that (this week-end probably)

$ VBoxManage --version 
4.3.22_OSEr98236
$ pacman -Q | grep virtual # It's Archlinux
virtualbox 4.3.22-2
virtualbox-host-modules 4.3.22-1

The output is big (and I did not redirect it in a file so for now, it's just the end part — creation of node3 and node4) so I posted a gist I'll update : https://gist.github.com/vdemeester/452b7455ac85d904d0c0 . I also added the script I'm using to run it.

Last time I tried I wasn't on the same network (@work vs @home now..) and here it's failing on the node4, @work it was on the node3 each time. No idea why :).

I'll re-run the script from a clean environment with the output redirect to a file and will update the gist.

@ghost
Copy link

ghost commented Mar 11, 2015

Hi, Just tried docker-machine and I'm encountering the same issue.
Here's the details of the system that I'm running on.. (hope it helps).

I'm running this on Linux Mint, here are the details..

--8<-- snip -----------------------------------------------
johnzan@johnzan-lxc-wks ~ $ cat /etc/release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=17
DISTRIB_CODENAME=qiana
DISTRIB_DESCRIPTION="Linux Mint 17 Qiana"
NAME="Ubuntu"
VERSION="14.04, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
cat: /etc/upstream-release: Is a directory
johnzan@johnzan-lxc-wks ~ $

--8<-- snip -----------------------------------------------

My Virtualbox version is 4.3.22 r98236

Other info:
Virtualbox is running other VMs, and they are active when I run the 'docker-machine create --driver virtualbox dev' command.

Here's the output . . .

--8<-- snip -----------------------------------------------

johnzan@johnzan-lxc-wks ~ $ docker-machine create --driver virtualbox dev
INFO[0000] Creating CA: /home/johnzan/.docker/machine/certs/ca.pem
INFO[0000] Creating client certificate: /home/johnzan/.docker/machine/certs/cert.pem
INFO[0003] Downloading boot2docker.iso to /home/johnzan/.docker/machine/cache/boot2docker.iso...
INFO[0015] Creating SSH key...
INFO[0015] Creating VirtualBox VM...
INFO[0033] Starting VirtualBox VM...
INFO[0034] Waiting for VM to start...

^Cjohnzan@johnzan-lxc-wks ~ $ docker-machine ls
Bad port '0'
ERRO[0000] error getting URL for host dev: exit status 255
NAME ACTIVE DRIVER STATE URL SWARM
dev virtualbox Running

--8<-- snip -----------------------------------------------

The binary is the 64bit Linux binary downloaded from the links provided in the documentation. Note that I created a symlink from ~/bin to the actual binary.

--8<-- snip -----------------------------------------------

johnzan@johnzan-lxc-wks ~ $ docker-machine -v
docker-machine version 0.1.0

johnzan@johnzan-lxc-wks ~/bin $ ls -l
total 15984
lrwxrwxrwx 1 johnzan johnzan 26 Mar 11 13:47 docker-machine -> docker-machine_linux-amd64
-rwxr-x--x 1 johnzan johnzan 16365408 Mar 11 13:46 docker-machine_linux-amd64
johnzan@johnzan-lxc-wks ~/bin $

--8<-- snip -----------------------------------------------

Hope that this info is of use.

Regards,
J.

@vdemeester
Copy link

It might no be related (and hasn't been referencing this issue) but it may help debugging problems : #775

@ehazlett ehazlett modified the milestone: 0.2.0 Mar 17, 2015
@ehazlett
Copy link
Contributor

@ljrittle could you try this build to see if it helps?

https://public.evanhazlett.com/docker-machine/vbox-intel-nic/

@ljrittle
Copy link

Thank you @ehazlett . I can confirm that this version works on my machine.

I ran "docker-machine_darwin-amd64 create -d virtualbox dev" multiple
times; both with and without --debug . Reviewed the debug output closely
(LGTM). Please note that I had not tested docker/master without this patch.

Regards,
Loren

@ljrittle https://github.com/ljrittle could you try this build to see if

it helps?

https://public.evanhazlett.com/docker-machine/vbox-intel-nic/

@ehazlett
Copy link
Contributor

@ljrittle thanks!

@linkyndy do you think you could also try the above build and see if it works for you?

@ljrittle
Copy link

@ehazlett : I can now inform you that a recent docker/master (the one
you published ~May 14) also works for me on this machine. However,
the patch to use the non-paravirtual network works better since I see
(20x):
"Error dialing TCP: ssh: handshake failed: EOF" with that recent master.

On Tue, May 19, 2015 at 10:56 AM, Loren James Rittle ljrittle@gmail.com wrote:

Thank you @ehazlett . I can confirm that this version works on my machine.

I ran "docker-machine_darwin-amd64 create -d virtualbox dev" multiple times;
both with and without --debug . Reviewed the debug output closely (LGTM).
Please note that I had not tested docker/master without this patch.

Regards,
Loren

@ljrittle could you try this build to see if it helps?

https://public.evanhazlett.com/docker-machine/vbox-intel-nic/

@nathanleclaire
Copy link
Contributor

@ljrittle FYI I've seen that error quite a bit as well; if I'm not mistaken, it should be fixed by #1174, and hopefully isn't related to the other issues discussed in this thread.

@lenybernard
Copy link

thank you @ehazlett, I had the same issue in a fresh yosemite install and your https://public.evanhazlett.com/docker-machine/vbox-intel-nic/ fix it

@johnkeenleyside
Copy link

Still not working for me. This is the state before I created a machine with docker-machine.
VirtualBox 4.3.28
docker-machine Version: 0.3.0-dev (76ba5b2)

$ VBoxManage list hostonlyifs
Name: vboxnet0
GUID: 786f6276-656e-4074-8000-0a0027000000
DHCP: Disabled
IPAddress: 192.168.99.1
NetworkMask: 255.255.255.0
IPV6Address:
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:00
MediumType: Ethernet
Status: Up
VBoxNetworkName: HostInterfaceNetworking-vboxnet0

Name: vboxnet1
GUID: 786f6276-656e-4174-8000-0a0027000001
DHCP: Disabled
IPAddress: 192.168.50.1
NetworkMask: 255.255.255.0
IPV6Address:
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:01
MediumType: Ethernet
Status: Down
VBoxNetworkName: HostInterfaceNetworking-vboxnet1

$ VBoxManage list dhcpservers
NetworkName: HostInterfaceNetworking-vboxnet0
IP: 192.168.99.2
NetworkMask: 255.255.255.0
lowerIPAddress: 192.168.99.100
upperIPAddress: 192.168.99.254
Enabled: Yes

Last debug message:
Daemon not responding yet: dial tcp 192.168.99.101:2376: operation timed out

@ehazlett
Copy link
Contributor

@johnkeenleyside can you try the latest master? it has several fixes including the nic driver in. You can get the latest builds from https://docker-machine-builds.evanhazlett.com/latest/. Thanks!

@jfieber
Copy link
Contributor

jfieber commented May 26, 2015

I just built master, 0.3.0-dev (0a0bbf7), here is the tail end of docker-machine --debug create --driver virtualbox foobar:

Using SSH client type: external
About to run SSH command:
ip addr show dev eth1
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -t -i /Users/jfieber/scratch/docker/machines/foobar/id_rsa -p 52934 docker@localhost ip addr show dev eth1] []  <nil> <nil> <nil> [] <nil> <nil> <nil> ?reflect.Value? false [] [] [] [] <nil>}
SSH cmd err, output: <nil>: 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:72:7a:36 brd ff:ff:ff:ff:ff:ff
    inet 192.168.99.106/24 brd 192.168.99.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe72:7a36/64 scope link 
       valid_lft forever preferred_lft forever

SSH returned: 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:72:7a:36 brd ff:ff:ff:ff:ff:ff
    inet 192.168.99.106/24 brd 192.168.99.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe72:7a36/64 scope link 
       valid_lft forever preferred_lft forever

END SSH

Using SSH client type: external
About to run SSH command:
printf "
EXTRA_ARGS='
--label provider=virtualbox

'
CACERT=/var/lib/boot2docker/ca.pem
DOCKER_HOST='-H tcp://0.0.0.0:2376'
DOCKER_STORAGE=aufs
DOCKER_TLS=auto
SERVERKEY=/var/lib/boot2docker/server-key.pem
SERVERCERT=/var/lib/boot2docker/server.pem
" | sudo tee /var/lib/boot2docker/profile
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -t -i /Users/jfieber/scratch/docker/machines/foobar/id_rsa -p 52934 docker@localhost printf "
EXTRA_ARGS='
--label provider=virtualbox

'
CACERT=/var/lib/boot2docker/ca.pem
DOCKER_HOST='-H tcp://0.0.0.0:2376'
DOCKER_STORAGE=aufs
DOCKER_TLS=auto
SERVERKEY=/var/lib/boot2docker/server-key.pem
SERVERCERT=/var/lib/boot2docker/server.pem
" | sudo tee /var/lib/boot2docker/profile] []  <nil> <nil> <nil> [] <nil> <nil> <nil> ?reflect.Value? false [] [] [] [] <nil>}
SSH cmd err, output: <nil>: 
EXTRA_ARGS='
--label provider=virtualbox

'
CACERT=/var/lib/boot2docker/ca.pem
DOCKER_HOST='-H tcp://0.0.0.0:2376'
DOCKER_STORAGE=aufs
DOCKER_TLS=auto
SERVERKEY=/var/lib/boot2docker/server-key.pem
SERVERCERT=/var/lib/boot2docker/server.pem

Using SSH client type: external
About to run SSH command:
sudo /etc/init.d/docker start
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -t -i /Users/jfieber/scratch/docker/machines/foobar/id_rsa -p 52934 docker@localhost sudo /etc/init.d/docker start] []  <nil> <nil> <nil> [] <nil> <nil> <nil> ?reflect.Value? false [] [] [] [] <nil>}
SSH cmd err, output: <nil>: Need TLS certs for foobar,10.8.52.113,10.0.2.15,192.168.99.106
-------------------

Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
…

At this point, docker-machine ssh foobar does work, but docker-machine --debug env foobar ends up like this:

…
Using SSH client type: external
About to run SSH command:
ip addr show dev eth1
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -t -i /Users/jfieber/scratch/docker/machines/foobar/id_rsa -p 52934 docker@localhost ip addr show dev eth1] []  <nil> <nil> <nil> [] <nil> <nil> <nil> ?reflect.Value? false [] [] [] [] <nil>}
SSH cmd err, output: <nil>: 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:72:7a:36 brd ff:ff:ff:ff:ff:ff
    inet 192.168.99.106/24 brd 192.168.99.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe72:7a36/64 scope link 
       valid_lft forever preferred_lft forever

SSH returned: 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:72:7a:36 brd ff:ff:ff:ff:ff:ff
    inet 192.168.99.106/24 brd 192.168.99.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe72:7a36/64 scope link 
       valid_lft forever preferred_lft forever

END SSH

Using SSH client type: external
About to run SSH command:
printf "
EXTRA_ARGS='
--label provider=virtualbox

'
CACERT=/var/lib/boot2docker/ca.pem
DOCKER_HOST='-H tcp://0.0.0.0:2376'
DOCKER_STORAGE=aufs
DOCKER_TLS=auto
SERVERKEY=/var/lib/boot2docker/server-key.pem
SERVERCERT=/var/lib/boot2docker/server.pem
" | sudo tee /var/lib/boot2docker/profile
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -t -i /Users/jfieber/scratch/docker/machines/foobar/id_rsa -p 52934 docker@localhost printf "
EXTRA_ARGS='
--label provider=virtualbox

'
CACERT=/var/lib/boot2docker/ca.pem
DOCKER_HOST='-H tcp://0.0.0.0:2376'
DOCKER_STORAGE=aufs
DOCKER_TLS=auto
SERVERKEY=/var/lib/boot2docker/server-key.pem
SERVERCERT=/var/lib/boot2docker/server.pem
" | sudo tee /var/lib/boot2docker/profile] []  <nil> <nil> <nil> [] <nil> <nil> <nil> ?reflect.Value? false [] [] [] [] <nil>}
SSH cmd err, output: <nil>: 
EXTRA_ARGS='
--label provider=virtualbox

'
CACERT=/var/lib/boot2docker/ca.pem
DOCKER_HOST='-H tcp://0.0.0.0:2376'
DOCKER_STORAGE=aufs
DOCKER_TLS=auto
SERVERKEY=/var/lib/boot2docker/server-key.pem
SERVERCERT=/var/lib/boot2docker/server.pem

Using SSH client type: external
About to run SSH command:
sudo /etc/init.d/docker start
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -t -i /Users/jfieber/scratch/docker/machines/foobar/id_rsa -p 52934 docker@localhost sudo /etc/init.d/docker start] []  <nil> <nil> <nil> [] <nil> <nil> <nil> ?reflect.Value? false [] [] [] [] <nil>}
SSH cmd err, output: <nil>: Need TLS certs for foobar,10.8.52.113,10.0.2.15,192.168.99.106
-------------------

Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
Daemon not responding yet: dial tcp 192.168.99.106:2376: connection refused
…

@nathanleclaire
Copy link
Contributor

Hey @jfieber, is the issue you are seeing the daemon not starting up again (typified by the endless "connection refused" on 2376 errors?) I am seeing that issue as well; a sudo /etc/init.d/docker restart inside of the VM fixes it, so I'm wondering if I may have simply forgotten to start the daemon again with the Swarm Options changes, or something like that.

@jfieber
Copy link
Contributor

jfieber commented May 26, 2015

Indeed, the daemon is not running, but it looks like it was started. The log show registering all the URL path handlers, setting up iptables, and then the end of /var/lib/boot2docker/docker.log

time="2015-05-26T22:39:34Z" level="debug" msg="/usr/local/sbin/iptables, [-C FORWARD -o docker0 -j DOCKER]" 
time="2015-05-26T22:39:34Z" level="debug" msg="/usr/local/sbin/iptables, [-I FORWARD -o docker0 -j DOCKER]" 
time="2015-05-26T22:39:34Z" level="info" msg="-job init_networkdriver() = OK (0)" 
time="2015-05-26T22:39:35Z" level="debug" msg="Restarting containers..." 
time="2015-05-26T22:39:35Z" level="info" msg="docker daemon: 1.5.0 a8a31ef; execdriver: native-0.2; graphdriver: aufs" 
time="2015-05-26T22:39:35Z" level="info" msg="+job acceptconnections()" 
time="2015-05-26T22:39:35Z" level="info" msg="-job acceptconnections() = OK (0)" 
2015/05/26 22:39:37 http: TLS handshake error from 192.168.99.1:49566: EOF
time="2015-05-26T22:39:39Z" level="info" msg="Received signal 'terminated', starting shutdown of docker..." 
time="2015-05-26T22:39:39Z" level="debug" msg="starting clean shutdown of all containers..." 
------------------------
/usr/local/bin/docker -d -D -g "/var/lib/docker" -H unix:// -H tcp://0.0.0.0:2376 
--label provider=virtualbox

 --tlsverify --tlscacert=/var/lib/boot2docker/ca.pem --tlscert=/var/lib/boot2docker/server.pem --tlskey=/var/lib/boot2docker/server-key.pem -s aufs >> "/var/lib/boot2docker/docker.log"

@jfieber
Copy link
Contributor

jfieber commented May 27, 2015

This last case of the daemon appearing to start, but then exit is also reported as #1028.

@ehazlett
Copy link
Contributor

@jfieber this should be fixed in #1242

@dhawal55
Copy link

I'm running into the same issue:

DEBU[0036] STDERR:
DEBU[0036] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectionAttempts=30 -o LogLevel=quiet -p 52920 -i /Users/xacj/.docker/machine/machines/dev/id_rsa docker@localhost ip addr show dev eth1
DEBU[0036] SSH returned: 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:ec:c3:24 brd ff:ff:ff:ff:ff:ff
inet 192.168.99.108/24 brd 192.168.99.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:feec:c324/64 scope link tentative
valid_lft forever preferred_lft forever

END SSH

DEBU[0111] Got an error it was dial tcp 192.168.99.108:2376: operation timed out
DEBU[0191] Got an error it was dial tcp 192.168.99.108:2376: operation timed out
DEBU[0271] Got an error it was dial tcp 192.168.99.108:2376: operation timed out
DEBU[0350] Got an error it was dial tcp 192.168.99.108:2376: operation timed out
DEBU[0428] Got an error it was dial tcp 192.168.99.108:2376: operation timed out

I install docker-machine using the below command:
curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine

UPDATE: It worked after I deleted the host interfaces

@kalbasit
Copy link

docker-machine version 0.2.0 (8b9eaf2) worked for me. docker-machine version 0.3.0 (HEAD) did not.

full log for docker-machine version 0.3.0 (HEAD): https://gist.github.com/kalbasit/03bf8464a6163d485a6f

full log for docker-machine version 0.2.0 (8b9eaf2): https://gist.github.com/kalbasit/c17485a3941404b7d8c5

@jobinar
Copy link

jobinar commented Jun 29, 2015

I was facing the same issue and found that virtualization was not enabled in the BIOS of the machine on which I was trying to create the docker swarm container.

I enabled VT-x on the host machine and it works fine now.

@tsalzinger
Copy link

For me i got it working only after downgrading msysgit to 1.9.5-preview141217 and virtualbox to 4.3.20

i tried this because on one of my notebooks everything worked fine, on the other it didn't. the one where it wasn't working was running msysgit at version 1.9.5-preview20150319 and virtualbox 4.3.28 as i installed everything according to instructions on that machine. the other one had both things already installed.

with the msysgit version i also encountered #1430 but after downgrading i got the Bad port '0' error, befor that it was just trying to connect endlessly. after downgrading virtualbox as well everything worked as expected.

@manik2131
Copy link

i am getting the below error while running two nodes on my docker-machine .Kindly help ..

$ docker-machine ls
error getting state for host dev: machine does not exist
error getting state for host local: machine does not exist
error getting URL for host local: machine does not exist
error getting URL for host dev: machine does not exist
NAME ACTIVE DRIVER STATE URL SWARM
dev virtualbox Error
local virtualbox Error

Even not able to get the url where to point... Has anybody have solution for this??

@JackChen255
Copy link

@ehazlett I am facing the similar issue. The swarm machine can't get URL. I have copied this patch https://docker-machine-builds.evanhazlett.com/latest/. Could someone help on it?
[root@jackswarm ~]# uname -a
Linux jackswarm.testlab.commvault.com 2.6.32-573.3.1.el6.x86_64 #1 SMP Thu Aug 13 22:55:16 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

[root@jackswarm ~]# docker-machine ls
error getting URL for host swarm-master: exit status 255
error getting URL for host swarm-master: exit status 255
error determining if host is active for host swarm-master: exit status 255
NAME ACTIVE DRIVER STATE URL SWARM
swarm-master virtualbox Running swarm-master (master)

[root@jackswarm ~]# rm -fr .docker/
[root@jackswarm ~]# docker-machine -D create -d virtualbox --swarm --swarm-master --swarm-discovery token://b64ddc74f9096642bef42380b4eea53e swarm-master
Creating CA: /root/.docker/machine/certs/ca.pem
Creating client certificate: /root/.docker/machine/certs/cert.pem
executing: /usr/bin/VBoxManage
STDERR:
Image cache does not exist, creating it at /root/.docker/machine/cache...
No default boot2docker iso found locally, downloading the latest release...
Downloading https://github.com/boot2docker/boot2docker/releases/download/v1.8.1/boot2docker.iso to /root/.docker/machine/cache/boot2docker.iso...
Creating VirtualBox VM...
Creating SSH key...
Creating disk image...
Creating 20000 MB hard disk image...
Converting from raw image file="stdin" to file="/root/.docker/machine/machines/swarm-master/disk.vmdk"...
Creating dynamic image with size 20971520000 bytes (20000MB)...
executing: /usr/bin/VBoxManage createvm --basefolder /root/.docker/machine/machines/swarm-master --name swarm-master --register
STDOUT: Virtual machine 'swarm-master' is created and registered.
UUID: 78d40216-534b-41f3-974f-68f7ac602483
Settings file: '/root/.docker/machine/machines/swarm-master/swarm-master/swarm-master.vbox'

STDERR:
VM CPUS: 1
VM Memory: 1024
executing: /usr/bin/VBoxManage modifyvm swarm-master --firmware bios --bioslogofadein off --bioslogofadeout off --bioslogodisplaytime 0 --biosbootmenu disabled --ostype Linux26_64 --cpus 1 --memory 1024 --acpi on --ioapic on --rtcuseutc on --natdnshostresolver1 off --natdnsproxy1 off --cpuhotplug off --pae on --hpet on --hwvirtex on --nestedpaging on --largepages on --vtxvpid on --accelerate3d off --boot1 dvd
STDOUT:
STDERR:
executing: /usr/bin/VBoxManage modifyvm swarm-master --nic1 nat --nictype1 82540EM --cableconnected1 on
STDOUT:
STDERR:
using 192.168.99.1 for dhcp address
executing: /usr/bin/VBoxManage list hostonlyifs
STDOUT: Name: vboxnet0
GUID: 786f6276-656e-4074-8000-0a0027000000
DHCP: Disabled
IPAddress: 192.168.99.1
NetworkMask: 255.255.255.0
IPV6Address: fe80:0000:0000:0000:0800:27ff:fe00:0000
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:00
MediumType: Ethernet
Status: Up
VBoxNetworkName: HostInterfaceNetworking-vboxnet0

STDERR:
executing: /usr/bin/VBoxManage modifyvm swarm-master --nic2 hostonly --nictype2 82540EM --hostonlyadapter2 vboxnet0 --cableconnected2 on
STDOUT:
STDERR:
executing: /usr/bin/VBoxManage storagectl swarm-master --name SATA --add sata --hostiocache on
STDOUT:
STDERR:
executing: /usr/bin/VBoxManage storageattach swarm-master --storagectl SATA --port 0 --device 0 --type dvddrive --medium /root/.docker/machine/machines/swarm-master/boot2docker.iso
STDOUT:
STDERR:
executing: /usr/bin/VBoxManage storageattach swarm-master --storagectl SATA --port 1 --device 0 --type hdd --medium /root/.docker/machine/machines/swarm-master/disk.vmdk
STDOUT:
STDERR:
executing: /usr/bin/VBoxManage guestproperty set swarm-master /VirtualBox/GuestAdd/SharedFolders/MountPrefix /
STDOUT:
STDERR:
executing: /usr/bin/VBoxManage guestproperty set swarm-master /VirtualBox/GuestAdd/SharedFolders/MountDir /
STDOUT:
STDERR:
Starting VirtualBox VM...
executing: /usr/bin/VBoxManage showvminfo swarm-master --machinereadable
STDOUT: name="swarm-master"
groups="/"
ostype="Linux 2.6 / 3.x (64-bit)"
UUID="78d40216-534b-41f3-974f-68f7ac602483"
CfgFile="/root/.docker/machine/machines/swarm-master/swarm-master/swarm-master.vbox"
SnapFldr="/root/.docker/machine/machines/swarm-master/swarm-master/Snapshots"
LogFldr="/root/.docker/machine/machines/swarm-master/swarm-master/Logs"
hardwareuuid="78d40216-534b-41f3-974f-68f7ac602483"
memory=1024
pagefusion="off"
vram=8
cpuexecutioncap=100
hpet="on"
chipset="piix3"
firmware="BIOS"
cpus=1
pae="on"
longmode="on"
synthcpu="off"
bootmenu="disabled"
boot1="dvd"
boot2="dvd"
boot3="disk"
boot4="none"
acpi="on"
ioapic="on"
biossystemtimeoffset=0
rtcuseutc="on"
hwvirtex="on"
nestedpaging="on"
largepages="on"
vtxvpid="on"
vtxux="on"
VMState="poweroff"
VMStateChangeTime="2015-08-14T16:38:24.326000000"
monitorcount=1
accelerate3d="off"
accelerate2dvideo="off"
teleporterenabled="off"
teleporterport=0
teleporteraddress=""
teleporterpassword=""
tracing-enabled="off"
tracing-allow-vm-access="off"
tracing-config=""
autostart-enabled="off"
autostart-delay=0
defaultfrontend=""
storagecontrollername0="SATA"
storagecontrollertype0="IntelAhci"
storagecontrollerinstance0="0"
storagecontrollermaxportcount0="30"
storagecontrollerportcount0="30"
storagecontrollerbootable0="on"
"SATA-0-0"="/root/.docker/machine/machines/swarm-master/boot2docker.iso"
"SATA-ImageUUID-0-0"="25aae067-b35e-4e7c-9a84-cbe4b437b107"
"SATA-tempeject"="off"
"SATA-IsEjected"="off"
"SATA-1-0"="/root/.docker/machine/machines/swarm-master/disk.vmdk"
"SATA-ImageUUID-1-0"="eecfddfd-4128-4e0c-8a6e-1c25c8704dc5"
"SATA-2-0"="none"
"SATA-3-0"="none"
"SATA-4-0"="none"
"SATA-5-0"="none"
"SATA-6-0"="none"
"SATA-7-0"="none"
"SATA-8-0"="none"
"SATA-9-0"="none"
"SATA-10-0"="none"
"SATA-11-0"="none"
"SATA-12-0"="none"
"SATA-13-0"="none"
"SATA-14-0"="none"
"SATA-15-0"="none"
"SATA-16-0"="none"
"SATA-17-0"="none"
"SATA-18-0"="none"
"SATA-19-0"="none"
"SATA-20-0"="none"
"SATA-21-0"="none"
"SATA-22-0"="none"
"SATA-23-0"="none"
"SATA-24-0"="none"
"SATA-25-0"="none"
"SATA-26-0"="none"
"SATA-27-0"="none"
"SATA-28-0"="none"
"SATA-29-0"="none"
natnet1="nat"
macaddress1="080027851503"
cableconnected1="on"
nic1="nat"
nictype1="82540EM"
nicspeed1="0"
mtu="0"
sockSnd="64"
sockRcv="64"
tcpWndSnd="64"
tcpWndRcv="64"
hostonlyadapter2="vboxnet0"
macaddress2="0800271605DE"
cableconnected2="on"
nic2="hostonly"
nictype2="82540EM"
nicspeed2="0"
nic3="none"
nic4="none"
nic5="none"
nic6="none"
nic7="none"
nic8="none"
hidpointing="ps2mouse"
hidkeyboard="ps2kbd"
uart1="off"
uart2="off"
lpt1="off"
lpt2="off"
audio="none"
clipboard="disabled"
draganddrop="disabled"
vrde="off"
usb="off"
ehci="off"
VRDEActiveConnection="off"
VRDEClients=0
vcpenabled="off"
vcpscreens=0
vcpfile="/root/.docker/machine/machines/swarm-master/swarm-master/swarm-master.webm"
vcpwidth=1024
vcpheight=768
vcprate=512
vcpfps=25
GuestMemoryBalloon=0

STDERR:
using 192.168.99.1 for dhcp address
executing: /usr/bin/VBoxManage list hostonlyifs
STDOUT: Name: vboxnet0
GUID: 786f6276-656e-4074-8000-0a0027000000
DHCP: Disabled
IPAddress: 192.168.99.1
NetworkMask: 255.255.255.0
IPV6Address: fe80:0000:0000:0000:0800:27ff:fe00:0000
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:00
MediumType: Ethernet
Status: Up
VBoxNetworkName: HostInterfaceNetworking-vboxnet0

STDERR:
executing: /usr/bin/VBoxManage modifyvm swarm-master --nic2 hostonly --nictype2 82540EM --hostonlyadapter2 vboxnet0 --cableconnected2 on
STDOUT:
STDERR:
executing: /usr/bin/VBoxManage modifyvm swarm-master --natpf1 delete ssh
STDOUT:
STDERR: VBoxManage: error: Code NS_ERROR_INVALID_ARG (0x80070057) - Invalid argument value (extended info not available)
VBoxManage: error: Context: "RemoveRedirect(Bstr(ValueUnion.psz).raw())" at line 1717 of file VBoxManageModifyVM.cpp

executing: /usr/bin/VBoxManage modifyvm swarm-master --natpf1 ssh,tcp,127.0.0.1,41827,,22
STDOUT:
STDERR:
executing: /usr/bin/VBoxManage startvm swarm-master --type headless
STDOUT: Waiting for VM "swarm-master" to power on...
VM "swarm-master" has been successfully started.

STDERR:
Starting VM...
Getting to WaitForSSH function...
Testing TCP connection to: localhost:41827
Using SSH client type: external
About to run SSH command:
exit 0
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -i /root/.docker/machine/machines/swarm-master/id_rsa -p 41827 docker@localhost exit 0] [] [] false [] [] [] [] }
SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : exit status 255
Getting to WaitForSSH function...
Testing TCP connection to: localhost:41827
Using SSH client type: external
About to run SSH command:
exit 0
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -i /root/.docker/machine/machines/swarm-master/id_rsa -p 41827 docker@localhost exit 0] [] [] false [] [] [] [] }
SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : exit status 255
Getting to WaitForSSH function...
Testing TCP connection to: localhost:41827
Using SSH client type: external
About to run SSH command:
exit 0
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -i /root/.docker/machine/machines/swarm-master/id_rsa -p 41827 docker@localhost exit 0] [] [] false [] [] [] [] }
SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : exit status 255
Getting to WaitForSSH function...
Testing TCP connection to: localhost:41827
Using SSH client type: external
About to run SSH command:
exit 0
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -i /root/.docker/machine/machines/swarm-master/id_rsa -p 41827 docker@localhost exit 0] [] [] false [] [] [] [] }
SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : exit status 255
Getting to WaitForSSH function...
Testing TCP connection to: localhost:41827
Using SSH client type: external
About to run SSH command:
exit 0
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -i /root/.docker/machine/machines/swarm-master/id_rsa -p 41827 docker@localhost exit 0] [] [] false [] [] [] [] }
SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : exit status 255
Getting to WaitForSSH function...
Testing TCP connection to: localhost:41827
Using SSH client type: external
About to run SSH command:
exit 0

@fuzzkat
Copy link

fuzzkat commented Aug 20, 2015

I can confirm that both the vbox-intel-nic version solves this issue for me, but that the latest (b101c29) does not.

# VBoxManage list hostonlyifs
Name:            vboxnet0
GUID:            786f6276-656e-4074-8000-0a0027000000
DHCP:            Disabled
IPAddress:       192.168.99.1
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:0800:27ff:fe00:0000
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:00
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-vboxnet0

# VBoxManage list dhcpservers
NetworkName:    HostInterfaceNetworking-vboxnet0
IP:             192.168.99.1
NetworkMask:    255.255.255.0
lowerIPAddress: 192.168.99.100
upperIPAddress: 192.168.99.254
Enabled:        Yes

@phpguru
Copy link

phpguru commented Aug 23, 2015

FWIW, I arrived here getting the same problem on docker quickstart terminal bootup (after it was working fine a few days back). I deleted the VM in Virtualbox and restarted MacbookPro then re-ran the quickstart terminal. It launched this time but I could not connect in Mac terminal. Turns out it was simply that the IP .101 was assigned instead of .100 as I had in DOCKER_HOST env variable in ~/.bash_profile. After editing that and sourcing it, I'm back in business.

@jonashackt
Copy link

@phpguru Thanks, that was the right hint... I followed a Mac-Docker-Tutorial months ago and also edited the ~/.bash_profile - now with the right DOCKER_HOST, DOCKER_CERT_PATH and DOCKER_MACHINE_NAME exported everything runs fine again.

@csk
Copy link

csk commented Sep 16, 2015

When running Docker QuickStart Terminal i ran into a similar issue. Luckily I found this thread #1591 which solved my problem . Someone suggested as a workaround prepending to every docker-machine command the following argument: --native-ssh , e.g

$ eval "$(docker-machine --native-ssh env default)"

Good luck!

@jeanlaurent jeanlaurent added this to the 0.5.1 milestone Nov 3, 2015
@ragavendra
Copy link

I had corrupt ~/.ssh/config . Once I corrected it, I was able to create machine like before. One way to check this is trying to ssh to some other server and see if works to make sure the docker-machine isn't failing due to ssh.

@nathanleclaire
Copy link
Contributor

This issue is very long and contains a lot of digressions. If someone continues to encounter similar ones please open a new one at https://github.com/docker/machine/issues/new with detailed information including:

  • Which OS you are on
  • Anything atypical in networking configuration (VPN, proxy, SSH configuration settings, etc.),
  • Output of the misbehaving commands with the --debug flag
  • the VirtualBox logs from ~/.docker/machine/machines/name/name.

Thanks!

  • N

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests