docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.96k forks source link

virtualbox: intermittent machine create fails #479

Closed ramschmaerchen closed 9 years ago

ramschmaerchen commented 9 years ago

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
ljrittle commented 9 years ago

State with zero docker-machine creations:

$ 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: Down VBoxNetworkName: HostInterfaceNetworking-vboxnet0

$ 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

docker-machine-0.2.0

vbox 4.3.26

Run: $ docker-machine --debug create -d virtualbox dev

State with that one docker-machine creation (currently stuck on "INFO[0013] Waiting for VM to start...":

$ 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

$ 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

On Sat, May 16, 2015 at 1:19 PM, Nathan LeClaire notifications@github.com wrote:

Hi everyone, we are working hard to resolve this issue or issue(s) and we have it narrowed down to a specific section in the code but it is proving quite hard to reliably reproduce. If anyone on this thread is still encountering this issue, or happens to stumble across it while running into the issue, will you please post what the output of the following commands is on your system (it will help greatly with debugging):

$ VBoxManage list hostonlyifs

$ VBoxManage list dhcpservers

Thanks a bunch!

— Reply to this email directly or view it on GitHub https://github.com/docker/machine/issues/479#issuecomment-102663081.

ehazlett commented 9 years ago

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

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

ljrittle commented 9 years ago

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 commented 9 years ago

@ljrittle thanks!

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

ljrittle commented 9 years ago

@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 commented 9 years ago

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

lenybernard commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

@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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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

ehazlett commented 9 years ago

@jfieber this should be fixed in https://github.com/docker/machine/pull/1242

dhawal55 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

@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 commented 9 years ago

I can confirm that both the vbox-intel-nic version solves this issue for me, but that the latest (b101c290114f35e94689d133f1365f10f2638f39) 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 commented 9 years ago

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 commented 9 years ago

@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 commented 9 years ago

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!

ragavendra commented 9 years ago

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 commented 9 years ago

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:

Thanks!