docker / machine

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

Another reason docker-machine create is hanging #1031

Closed far-blue closed 8 years ago

far-blue commented 9 years ago

I'm also seeing create hang during the creation process with Waiting for VM to start....

For me, the VM is being created fine but docker-machine never realises this and so will hang forever. In the process it also seems to take 100% cpu.

I believe the problem is rooted in the ssh port forwarding. I notice in the config.json for the machine that SSHPort is 0 and if I run docker-machine ip with debug I see this (notice the -p 0):

DEBU[0000] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectionAttempts=30 -o LogLevel=quiet -p 0 -i /Users/rgoldsmith/.docker/machine/machines/dev/id_rsa docker@localhost ip addr show dev eth1

which unsurprisingly errors with: Bad port '0'

I propose there is an issue in getAvailableTCPPort() that means it is returning 0 instead of an available port. Because 0 is being passed to VBoxManage it is then picking one itself. Querying VBoxManage I can see, in my case: Forwarding(0)="ssh,tcp,127.0.0.1,56069,,22”)

wires commented 9 years ago

Ha, just wanted to report the same issue:

> ./docker-machine create --driver virtualbox dev
INFO[0000] Creating SSH key...
INFO[0000] Image cache does not exist, creating it at /Users/jelle/.docker/machine/cache...
INFO[0000] No default boot2docker iso found locally, downloading the latest release...
INFO[0003] Downloading latest boot2docker release to /Users/jelle/.docker/machine/cache/boot2docker.iso...
INFO[0038] Creating VirtualBox VM...
INFO[0076] Starting VirtualBox VM...
INFO[0087] Waiting for VM to start...

Spinning with 100% CPU, same problem with ./docker-machine ip.

DEBU[0000] STDERR:
DEBU[0000] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectionAttempts=30 -o LogLevel=quiet -p 0 -i /Users/jelle/.docker/machine/machines/dev/id_rsa docker@localhost ip addr show dev eth1
Bad port '0'
FATA[0000] exit status 255
jfieber commented 9 years ago

The virtualbox driver has a bug that it checks for a free tcp port when the VM instance is created but there is no guarantee that the port will be there some days in the future. I submitted a PR (#1025) that addresses that. I've been digging a lot in the virtual box driver this past week but I haven't encountered. For a VM with this problem, can you verify the value of SSHPort in $HOME/.docker/machine/machines/{machine-name}/config.json?

jfieber commented 9 years ago

I suspect this is a duplicate of #479

far-blue commented 9 years ago

I don't think this is a duplicate of the original issue reported in #479 but I agree that some commenters have reported problems closer to the problem I've raised than to the original issue reported.

As I say in the original issue report, yes, the SSHPort value in the config.json file is set to 0 and this is why the docker-machine ip fails. I believe it is also why the docker-machine create fails in the first place (because internally it is calling basically the same code, polling for an available ssh connection on port 0). One notable difference is that I'm pretty sure in my logs the original VBoxManage command that sets up the ssh forwarding is passing 0 as the host port but I could be wrong in this and I don't have the logs to hand this evening at home.

Either way, I believe one of 2 things is happening: 1) Once the port has been selected it is not being correctly written to the config.son file 2) No port is being selected and it is defaulting to port 0

What I can't work out is why this might be happening. It seems more likely to me that getAvailableTCPPort() is failing to find a port but I guess there's always a chance some bug is overwriting the d.SSHPort value in the vm struct before it is being serialised to the config file.

jfieber commented 9 years ago

It looks like the only return case from getAvailableTCPPort() with a nil error value is in a conditional guaranteeing that the port is non-zero. The only caller is the driver Create method which does an early return with the error. At least in the current code. Need to pin down the versions showing the problem. It is a given that all sorts of things will fail later on if SSHport is zero.

thomschke commented 9 years ago

same problem, under 0.2.0-rc3 it works.

far-blue commented 9 years ago

Ok, I've had a chance to confirm the debug output and the correct port info is generated for VirtualBox. So this means getAvailableTCPPort() is fine and the issue is elsewhere. One thing I have noticed is that all the failing creates have high port numbers - could it be something as stupid as an int overflow during json encoding? There certainly seems to be no issue with reading back a json file with the large int value but there doesn't seem to be anywhere in the code where the d.SSHPort value is changed after getAvailableTCPPort() sets it.

The port number being somehow too large would also explain why it will work for a while and then start failing - I generated a large number of machines last week debugging an issue with upgrades and it was only last thing friday that creates started failing. Since then (I haven't restarted my laptop) I've been unable to create new VMs.

ehazlett commented 9 years ago

thanks for confirming @far-blue -- my hunch was it was just a side effect and not getAvailableTCPPort() -- thanks.

Would you happen to have the VirtualBox logs (~/.docker/machine/machines/<name>/<name>/Logs/Vbox.log) for one of the fails? If it is too high of a port then it should throw an error in virtualbox i would hope. That would then leave it at port 0 causing the issue.

far-blue commented 9 years ago

Added as a gist: https://gist.github.com/far-blue/f9be3350918b3d5163dc

far-blue commented 9 years ago

Although I can see in VirtualBox that a port has been setup for the forwarding so I don't think that's the issue.

ehazlett commented 9 years ago

Correct -- it does indeed get a port: https://gist.github.com/far-blue/f9be3350918b3d5163dc#file-vbox-log-L931

far-blue commented 9 years ago

I've had success today creating a vm where the port configured was 62016 so I guess this proves it's not an issue with large port numbers.

rossbachp commented 9 years ago

I've no success with current head. Complete day no chance to create a virtualbox machine.... Very Bad.

ehazlett commented 9 years ago

@rossbachp are you using any VPN software? can you post the output of VBoxManage list hostonlyifs and netstat -nr?

rossbachp commented 9 years ago

No VPN Software installed...

$ VBoxManage list hostonlyifs
Name:            vboxnet0
GUID:            786f6276-656e-4074-8000-0a0027000000
DHCP:            Disabled
IPAddress:       192.168.59.3
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

Name:            vboxnet2
GUID:            786f6276-656e-4274-8000-0a0027000002
DHCP:            Disabled
IPAddress:       192.168.99.1
NetworkMask:     255.255.255.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:02
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-vboxnet2

Name:            vboxnet3
GUID:            786f6276-656e-4374-8000-0a0027000003
DHCP:            Disabled
IPAddress:       192.168.33.1
NetworkMask:     255.255.255.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:03
MediumType:      Ethernet
Status:          Down
VBoxNetworkName: HostInterfaceNetworking-vboxnet3

Name:            vboxnet4
GUID:            786f6276-656e-4474-8000-0a0027000004
DHCP:            Disabled
IPAddress:       10.2.0.1
NetworkMask:     255.255.255.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:04
MediumType:      Ethernet
Status:          Down
VBoxNetworkName: HostInterfaceNetworking-vboxnet4

Name:            vboxnet5
GUID:            786f6276-656e-4574-8000-0a0027000005
DHCP:            Disabled
IPAddress:       172.30.8.1
NetworkMask:     255.255.255.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:05
MediumType:      Ethernet
Status:          Down
VBoxNetworkName: HostInterfaceNetworking-vboxnet5

Name:            vboxnet6
GUID:            786f6276-656e-4674-8000-0a0027000006
DHCP:            Disabled
IPAddress:       10.245.1.1
NetworkMask:     255.255.255.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:06
MediumType:      Ethernet
Status:          Down
VBoxNetworkName: HostInterfaceNetworking-vboxnet6

Name:            vboxnet7
GUID:            786f6276-656e-4774-8000-0a0027000007
DHCP:            Disabled
IPAddress:       172.16.255.1
NetworkMask:     255.255.255.0
IPV6Address:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:07
MediumType:      Ethernet
Status:          Down
VBoxNetworkName: HostInterfaceNetworking-vboxnet7
$ netstat -nr
Routing tables

Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            10.67.48.1         UGSc           59        1     en0
10.67.48/22        link#4             UCS             1        0     en0
10.67.48.1/32      link#4             UCS             1        0     en0
10.67.48.1         0:1f:9d:81:14:0    UHLWIir        63      106     en0    754
10.67.48.69/32     link#4             UCS             1        0     en0
10.67.51.255       ff:ff:ff:ff:ff:ff  UHLWbI          0       51     en0
127                127.0.0.1          UCS             0        0     lo0
127.0.0.1          127.0.0.1          UH              5    10937     lo0
169.254            link#4             UCS             0        0     en0
192.168.59         link#11            UC              3        0 vboxnet
192.168.59.3       a:0:27:0:0:0       UHLWIi          1        6     lo0
192.168.59.103     8:0:27:39:17:b6    UHLWI           0      130 vboxnet    769
192.168.59.255     ff:ff:ff:ff:ff:ff  UHLWbI          0       12 vboxnet
192.168.99         link#13            UC              2        0 vboxnet
192.168.99.1       a:0:27:0:0:2       UHLWIi          1       18     lo0
192.168.99.255     ff:ff:ff:ff:ff:ff  UHLWbI          0       12 vboxnet

Internet6:
Destination                             Gateway                         Flags         Netif Expire
::1                                     ::1                             UHL             lo0
fdd0:e482:fa34:53a7::/64                fe80::c5e9:1a18:51ff:d0aa%utun0 Uc            utun0
fdd0:e482:fa34:53a7:c5e9:1a18:51ff:d0aa link#10                         UHL             lo0
fe80::%lo0/64                           fe80::1%lo0                     UcI             lo0
fe80::1%lo0                             link#1                          UHLI            lo0
fe80::%en0/64                           link#4                          UCI             en0
fe80::4ad7:5ff:fec2:e3c9%en0            48:d7:5:c2:e3:c9                UHLI            lo0
fe80::%awdl0/64                         link#8                          UCI           awdl0
fe80::8f2:37ff:fe15:c697%awdl0          a:f2:37:15:c6:97                UHLI            lo0
fe80::%utun0/64                         fe80::c5e9:1a18:51ff:d0aa%utun0 UcI           utun0
fe80::c5e9:1a18:51ff:d0aa%utun0         link#10                         UHLI            lo0
ff01::%lo0/32                           ::1                             UmCI            lo0
ff01::%en0/32                           link#4                          UmCI            en0
ff01::%awdl0/32                         link#8                          UmCI          awdl0
ff01::%utun0/32                         fe80::c5e9:1a18:51ff:d0aa%utun0 UmCI          utun0
ff02::%lo0/32                           ::1                             UmCI            lo0
ff02::%en0/32                           link#4                          UmCI            en0
ff02::%awdl0/32                         link#8                          UmCI          awdl0
ff02::%utun0/32                         fe80::c5e9:1a18:51ff:d0aa%utun0 UmCI          utun0
ljrittle commented 9 years ago

I too am seeing this on one OS X 10.10.3 machine with docker-machine-0.2.0 (never had boot2docker installed thereupon; VirtualBox is the recommended 4.3.26). docker-machine works fine on another OS X 10.10.3 machine with both different network interfaces and network connectivity (and which also has the boot2docker CLI installed). If it helps, here is the output of the failing system:

$ docker-machine create -d virtualbox dev INFO[0000] Creating SSH key... INFO[0001] Creating VirtualBox VM... INFO[0012] Starting VirtualBox VM... INFO[0013] Waiting for VM to start... <<<hang for minutes while I can see in the VirtualBox GUI that docker is up inside the VM; am able to directly ssh in and verify that docker is up...>>>

$ 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

$ netstat -nr Routing tables

Internet: Destination Gateway Flags Refs Use Netif Expire default 10.43.151.254 UGSc 17 2 en0 10.43.150/23 link#4 UCS 17 0 en0 10.43.150.88 18:a9:5:b5:10:43 UHLWI 0 0 en0 1137 10.43.150.92/32 link#4 UCS 1 0 en0 10.43.150.111 c8:2a:14:28:1a:c UHLWI 0 0 en0 10.43.150.120 3c:97:e:49:be:c6 UHLWI 0 0 en0 690 10.43.151.66 54:ee:75:13:98:67 UHLWI 0 0 en0 1169 10.43.151.84 3c:97:e:54:5c:63 UHLWI 0 0 en0 1116 10.43.151.88 54:ee:75:c:a3:16 UHLWI 0 0 en0 1194 10.43.151.106 0:21:5a:e7:bb:68 UHLWI 0 0 en0 1133 10.43.151.135 3c:97:e:4c:63:88 UHLWI 0 0 en0 1094 10.43.151.139 28:d2:44:6f:8f:ca UHLWI 0 0 en0 1177 10.43.151.156 f0:1f:af:26:1d:6c UHLWI 0 0 en0 1149 10.43.151.161 0:21:cc:63:0:74 UHLWI 0 0 en0 1140 10.43.151.168 0:21:cc:cb:5b:7f UHLWI 0 0 en0 1198 10.43.151.174 c4:2c:3:3c:8b:de UHLWI 0 0 en0 234 10.43.151.185 0:21:cc:bf:87:9c UHLWI 0 0 en0 1156 10.43.151.207 88:ae:1d:ae:ad:1b UHLWI 0 0 en0 1169 10.43.151.224 28:d2:44:39:e2:14 UHLWI 0 0 en0 1169 10.43.151.254/32 link#4 UCS 1 0 en0 10.43.151.254 7c:69:f6:f2:a2:3f UHLWIir 18 0 en0 925 10.43.151.255 ff:ff:ff:ff:ff:ff UHLWbI 0 47 en0 127 127.0.0.1 UCS 0 0 lo0 127.0.0.1 127.0.0.1 UH 506 19003 lo0 169.254 link#4 UCS 0 0 en0 192.168.99 link#7 UC 3 0 vboxnet 192.168.99.100 8:0:27:e8:fa:9d UHLWI 0 233 vboxnet 1044 192.168.99.255 ff:ff:ff:ff:ff:ff UHLWbI 0 25 vboxnet

Internet6: Destination Gateway Flags Netif Expire ::1 ::1 UHL lo0 fe80::%lo0/64 fe80::1%lo0 UcI lo0 fe80::1%lo0 link#1 UHLI lo0 fe80::%en0/64 link#4 UCI en0 fe80::21f:5bff:fe3d:d5ac%en0 0:1f:5b:3d:d5:ac UHLI lo0 ff01::%lo0/32 ::1 UmCI lo0 ff01::%en0/32 link#4 UmCI en0 ff02::%lo0/32 ::1 UmCI lo0 ff02::%en0/32 link#4 UmCI en0

jfieber commented 9 years ago

For those with a hang-on-create, do the last few lines of output from this show?

docker-machine --debug create --driver virtualbox fubar

The routing tables look fine. A quick way to verify the routing without relying on eyeball scanning of the table is:

route get <ip address>

How about firewall rules? I found them a bit tricky to inspect because there are two firewalls in Yosemite, pf and ipfw. The latter is deprecated and in Yosemite they actually took the ipfw binary away. You can grab the binary from a Mavericks to see what lurks there.

ljrittle commented 9 years ago

(Thanks for the hint about checking firewall rules; I didn't think I had any enabled on this machine. However, this machine has been incrementally upgraded since ~Leopard ...; pf appears to be the default/off with status: Disabled; "ipfw list" reports "65535 allow ip from any to any")

The last few lines don't reveal anything extra:

[...] GuestMemoryBalloon=0

DEBU[0025] STDERR: DEBU[0025] executing: /usr/bin/VBoxManage startvm fubar --type headless DEBU[0025] STDOUT: Waiting for VM "fubar" to power on... VM "fubar" has been successfully started.

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

adamjgray commented 9 years ago

Description

I'm seeing this consistently on any vm creation in virtualbox past the first (or if there are pre-existing hostonlyifs).

Starting with no running vms and an empty list of hostonlyifs, the first vm will create correctly and work as expected. The next create for any other vm hangs at Waiting for VM to start....

I've been able to reproduce this every time I've tried so far (about 4-6 times). So if there's any other information you need or think would help, let me know and I can try to grab it.

Environment:

Pre-conditions:

$ VBoxManage list vms
$
$ VBoxManage list hostonlyifs
$
$ docker-machine ls
NAME   ACTIVE   DRIVER   STATE   URL   SWARM

Create first vm (shortened to show just the vm creation output)

$ docker-machine --debug create -d virtualbox dev
...
INFO[0000] Creating VirtualBox VM...                    
DEBU[0000] Creating 20000 MB hard disk image...         
Converting from raw image file="stdin" to file="/Users/agray/.docker/machine/machines/dev/disk.vmdk"...
Creating dynamic image with size 20971520000 bytes (20000MB)...
DEBU[0006] executing: /usr/bin/VBoxManage createvm --basefolder /Users/agray/.docker/machine/machines/dev --name dev --register 
DEBU[0006] STDOUT: Virtual machine 'dev' is created and registered.
UUID: 94b1feaa-798a-4b7a-a9bc-67a07ac8ccac
Settings file: '/Users/agray/.docker/machine/machines/dev/dev/dev.vbox'

DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage modifyvm dev --firmware bios --bioslogofadein off --bioslogofadeout off --natdnshostresolver1 on --bioslogodisplaytime 0 --biosbootmenu disabled --ostype Linux26_64 --cpus 8 --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[0006] STDOUT:                                      
DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage modifyvm dev --nic1 nat --nictype1 virtio --cableconnected1 on 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage modifyvm dev --natpf1 ssh,tcp,127.0.0.1,50289,,22 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage list hostonlyifs 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage hostonlyif create 
DEBU[0007] STDOUT: Interface 'vboxnet0' was successfully created

DEBU[0007] STDERR: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

DEBU[0007] executing: /usr/bin/VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.99.1 --netmask 255.255.255.0 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage list dhcpservers 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage dhcpserver add --netname HostInterfaceNetworking-vboxnet0 --ip 192.168.99.2 --netmask 255.255.255.0 --lowerip 192.168.99.100 --upperip 192.168.99.254 --enable 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage modifyvm dev --nic2 hostonly --nictype2 virtio --hostonlyadapter2 vboxnet0 --cableconnected2 on 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage storagectl dev --name SATA --add sata --hostiocache on 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage storageattach dev --storagectl SATA --port 0 --device 0 --type dvddrive --medium /Users/agray/.docker/machine/machines/dev/boot2docker.iso 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage storageattach dev --storagectl SATA --port 1 --device 0 --type hdd --medium /Users/agray/.docker/machine/machines/dev/disk.vmdk 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage guestproperty set dev /VirtualBox/GuestAdd/SharedFolders/MountPrefix / 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage guestproperty set dev /VirtualBox/GuestAdd/SharedFolders/MountDir / 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage sharedfolder add dev --name Users --hostpath /Users --automount 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage setextradata dev VBoxInternal2/SharedFoldersEnableSymlinksCreate/Users 1 
DEBU[0007] STDOUT:                                      
DEBU[0007] STDERR:                                      
INFO[0007] Starting VirtualBox VM...                    
DEBU[0007] executing: /usr/bin/VBoxManage showvminfo dev --machinereadable 
...
DEBU[0007] STDERR:                                      
DEBU[0007] executing: /usr/bin/VBoxManage startvm dev --type headless 
DEBU[0007] STDOUT: Waiting for VM "dev" to power on...
VM "dev" has been successfully started.

DEBU[0007] STDERR:                                      
INFO[0007] Waiting for VM to start...                   
DEBU[0039] Getting to WaitForSSH function...            
...
DEBU[0055] executing: ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectionAttempts=30 -o LogLevel=quiet -p 50289 -i /Users/agray/.docker/machine/machines/dev/id_rsa docker@localhost sudo /etc/init.d/docker start 
INFO[0056] "dev" has been created and is now the active machine. 
INFO[0056] To point your Docker client at it, run this in your shell: eval "$(docker-machine env dev)" 

Post-conditions

$ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL                         SWARM
dev    *        virtualbox   Running   tcp://192.168.99.100:2376   
$ VBoxManage list vms
"dev" {94b1feaa-798a-4b7a-a9bc-67a07ac8ccac}
$ 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

Create second vm (same shortened output)

$ docker-machine --debug create -d virtualbox dev2
...
INFO[0000] Creating VirtualBox VM...                    
DEBU[0000] Creating 20000 MB hard disk image...         
Converting from raw image file="stdin" to file="/Users/agray/.docker/machine/machines/dev2/disk.vmdk"...
Creating dynamic image with size 20971520000 bytes (20000MB)...
DEBU[0006] executing: /usr/bin/VBoxManage createvm --basefolder /Users/agray/.docker/machine/machines/dev2 --name dev2 --register 
DEBU[0006] STDOUT: Virtual machine 'dev2' is created and registered.
UUID: ee3124c8-0e7c-4ab1-8f9a-cfa16da8528a
Settings file: '/Users/agray/.docker/machine/machines/dev2/dev2/dev2.vbox'

DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage modifyvm dev2 --firmware bios --bioslogofadein off --bioslogofadeout off --natdnshostresolver1 on --bioslogodisplaytime 0 --biosbootmenu disabled --ostype Linux26_64 --cpus 8 --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[0006] STDOUT:                                      
DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage modifyvm dev2 --nic1 nat --nictype1 virtio --cableconnected1 on 
DEBU[0006] STDOUT:                                      
DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage modifyvm dev2 --natpf1 ssh,tcp,127.0.0.1,51613,,22 
DEBU[0006] STDOUT:                                      
DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage list hostonlyifs 
DEBU[0006] STDOUT: 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

DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage modifyvm dev2 --nic2 hostonly --nictype2 virtio --hostonlyadapter2 vboxnet0 --cableconnected2 on 
DEBU[0006] STDOUT:                                      
DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage storagectl dev2 --name SATA --add sata --hostiocache on 
DEBU[0006] STDOUT:                                      
DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage storageattach dev2 --storagectl SATA --port 0 --device 0 --type dvddrive --medium /Users/agray/.docker/machine/machines/dev2/boot2docker.iso 
DEBU[0006] STDOUT:                                      
DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage storageattach dev2 --storagectl SATA --port 1 --device 0 --type hdd --medium /Users/agray/.docker/machine/machines/dev2/disk.vmdk 
DEBU[0006] STDOUT:                                      
DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage guestproperty set dev2 /VirtualBox/GuestAdd/SharedFolders/MountPrefix / 
DEBU[0006] STDOUT:                                      
DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage guestproperty set dev2 /VirtualBox/GuestAdd/SharedFolders/MountDir / 
DEBU[0006] STDOUT:                                      
DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage sharedfolder add dev2 --name Users --hostpath /Users --automount 
DEBU[0006] STDOUT:                                      
DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage setextradata dev2 VBoxInternal2/SharedFoldersEnableSymlinksCreate/Users 1 
DEBU[0006] STDOUT:                                      
DEBU[0006] STDERR:                                      
INFO[0006] Starting VirtualBox VM...                    
DEBU[0006] executing: /usr/bin/VBoxManage showvminfo dev2 --machinereadable
...
DEBU[0006] STDERR:                                      
DEBU[0006] executing: /usr/bin/VBoxManage startvm dev2 --type headless 
DEBU[0007] STDOUT: Waiting for VM "dev2" to power on...
VM "dev2" has been successfully started.

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

Post-conditions

The create call for dev2 hangs on Waiting for VM to start....

Meanwhile, in another tab:

$ VBoxManage list vms
"dev" {94b1feaa-798a-4b7a-a9bc-67a07ac8ccac}
"dev2" {ee3124c8-0e7c-4ab1-8f9a-cfa16da8528a}
$ 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
$ docker-machine ls
Bad port '0'
ERRO[0000] error getting URL for host dev2: exit status 255 
NAME   ACTIVE   DRIVER       STATE     URL                         SWARM
dev    *        virtualbox   Running   tcp://192.168.99.100:2376   
dev2            virtualbox   Running                               
stephenlawrence commented 9 years ago

I am also unable to create a new vbox machine.

ehazlett commented 9 years ago

@stephenlawrence i'm trying to track this down. could you try to use b2d 1.5? you should be able to do docker-machine create -d virtualbox --virtualbox-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.5.0/boot2docker.iso test-vbox-1.5

stephenlawrence commented 9 years ago

@ehazlett Hung at:

INFO[0000] Creating SSH key...
INFO[0000] Downloading boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v1.5.0/boot2docker.iso...
INFO[0019] Creating VirtualBox VM...
INFO[0026] Starting VirtualBox VM...
INFO[0026] Waiting for VM to start...
00:00:05.692745 AHCI#0: Port 0 reset
00:00:06.054013 AHCI#0: Port 1 reset
00:00:17.190081 Guest Additions information report: Version 4.3.20 r96996 '4.3.20'
00:00:17.190546 Guest Additions information report: Interface = 0x00010004 osType = 0x00053100 (64-bit)
00:00:17.193385 Guest Additions capability report: (0x0 -> 0x0) seamless: no, hostWindowMapping: no, graphics: no
00:00:17.196270 Guest reported fixed hypervisor window at 00000800000 (size = 0x800000, rc = VINF_SUCCESS)
00:00:17.200647 Guest Log: vboxguest: major 0, IRQ 20, I/O port d020, MMIO at 00000000f0000000 (size 0x400000)
00:00:28.898130 NAT: DHCP offered IP address 10.0.2.15
00:00:28.998260 NAT: DHCP offered IP address 10.0.2.15
00:00:32.638452 NAT: IPv6 not supported
ehazlett commented 9 years ago

@stephenlawrence thx -- doing a bit of grasping here -- could you try VirtualBox 4.3.26?

wires commented 9 years ago

FWIW, for me it turns out I was running not the latest docker-machine, after upgrading docker-machine to 0.2 I am able to create VMs.

Here is a transcript:

I have these versions,

> docker-machine -v
docker-machine version 0.1.0
> docker -v
Docker version 1.5.0, build a8a31ef
> boot2docker -v
Boot2Docker-cli version: v1.3.2
Git commit: e41a9ae
> VBoxManage -v
4.3.26r98988

Trying to create a boot2docker 1.5 machine as you suggested fails as follows.

docker-machine --debug create -d virtualbox --virtualbox-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.5.0/boot2docker.iso test-vbox-1.5
DEBU[0000] executing: /usr/bin/VBoxManage
DEBU[0000] STDOUT: Oracle VM VirtualBox Command Line Management Interface Version 4.3.26
(C) 2005-2015 Oracle Corporation
All rights reserved.

Usage:

  VBoxManage [<general option>] <command>

  [..whole help page printed here..]

DEBU[0000] STDERR:
INFO[0000] Downloading boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v1.5.0/boot2docker.iso...
ERRO[0001] Error creating machine: open /Users/wires/.docker/machine/cache/boot2docker.iso/boot2docker.iso.tmp792217122: not a directory
WARN[0001] You will want to check the provider to make sure the machine and associated resources were properly removed.
FATA[0001] Error creating machine

If you try again,

> docker-machine create -d virtualbox --virtualbox-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.5.0/boot2docker.iso test-vbox-1.5
ERRO[0000] Error creating machine: Machine test-vbox-1.5 already exists
WARN[0000] You will want to check the provider to make sure the machine and associated resources were properly removed.
FATA[0000] Error creating machine

So

> docker-machine ls
ERRO[0000] error getting state for host test-vbox-1.5: machine does not exist
ERRO[0000] error getting URL for host test-vbox-1.5: machine does not exist
NAME            ACTIVE   DRIVER       STATE   URL   SWARM
dev             *        virtualbox   Saved
test-vbox-1.5            virtualbox   Error

But removing then fails

> docker-machine rm test-vbox-1.5
INFO[0000] machine does not exist, assuming it has been removed already

Force remove works

> docker-machine rm -f test-vbox-1.5
INFO[0000] machine does not exist, assuming it has been removed already
INFO[0000] The machine was successfully removed.

Ok, I realised docker-machine v0.2 is out, lets upgrade

> curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_darwin-amd64 > /usr/local/bin/docker-machine
> chmod +x /usr/local/bin/docker-machine

Seems to work...

> docker-machine create -d virtualbox --virtualbox-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.5.0/boot2docker.iso test-1

INFO[0000] Creating SSH key...
INFO[0000] Downloading boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v1.5.0/boot2docker.iso...
INFO[0037] Creating VirtualBox VM...
INFO[0045] Starting VirtualBox VM...
INFO[0047] Waiting for VM to start...
INFO[0095] "test-1" has been created and is now the active machine.
INFO[0095] To point your Docker client at it, run this in your shell: docker-machine env test-1 | source

But not every time

> docker-machine create -d virtualbox test-2
INFO[0000] Creating SSH key...
INFO[0000] Creating VirtualBox VM...
INFO[0007] Starting VirtualBox VM...
INFO[0008] Waiting for VM to start...
ERRO[0234] Error creating machine: Maximum number of retries (60) exceeded
WARN[0234] You will want to check the provider to make sure the machine and associated resources were properly removed.
FATA[0234] Error creating machine

This is what ls says

> docker-machine ls
Bad port '0'
ERRO[0003] error getting URL for host test-2: exit status 255
NAME            ACTIVE   DRIVER       STATE     URL                         SWARM
dev                      virtualbox   Saved
test-1          *        virtualbox   Running   tcp://192.168.99.103:2376
test-2                   virtualbox   Running
test-vbox-1.5            virtualbox   Running   tcp://192.168.99.102:2376

But eventually, ls gives a URL. Cannot seem to reproduce the earlier non-working behaviour.

ehazlett commented 9 years ago

@wires thanks for the feedback!

cwilkes commented 9 years ago

"docker-machine --debug create -d virtualbox dev10" hangs for me on my Mac as I'm running Cisco AnyConnect VPN software that has very restrictive firewall rules. In this case the virtual ethernet adapter "vboxnet1" that created for 192.168.99.x isn't in the rule list so packets to it are blocked.

I can't find an option in docker-machine create to specify a local IP address. If I could just tell it to run on one in the 127.0.0.x range I think it would start up.

jfieber commented 9 years ago

Cisco AnyConnect aggressively controls all host side interfaces. In some VPN configurations the only path from host to guest is through the virtualbox NAT port forwarding. Docker machine sets up port forwarding for ssh, but nothing else. With the VPN enabled, you will not be able to complete a create operation.

Also, the port forwarding is somewhat flakey. I've determined some docker operations that cause what appears to be a deadlock. There are workarounds though.

I have a branch that works with Cisco AnyConnect; I'll see about pushing that to my fork.

stephenlawrence commented 9 years ago

@ehazlett

Upgraded VirtualBox and your latest DM build:

docker-machine create --driver virtualbox testdelete Creating VirtualBox VM... Creating SSH key... Starting VirtualBox VM... Starting VM... Error creating machine: ssh: handshake failed: EOF You will want to check the provider to make sure the machine and associated resources were properly removed.

far-blue commented 9 years ago

Having had a chance to play with 0.3.0-rc2 I can confirm that I'm no longer experiencing the hanging on create. As a side, note, however, if you have modified your vm with additional network adaptors using virtio then I've found the vm will then not restart correctly. The solution to this is to switch the driver for the additional interfaces to use the PRO 1000 driver to match the normal interfaces.

ehazlett commented 9 years ago

@far-blue thanks for the feedback!

arthurk commented 9 years ago

Hi, I'm having the same issue. I'm running VirtualBox 4.3.28 and docker-machine 0.3 on OSX 10.10.4.

$ docker-machine create --driver virtualbox test
Creating VirtualBox VM...
Creating SSH key...
Starting VirtualBox VM...
Starting VM...
Error creating machine: Maximum number of retries (5) exceeded
You will want to check the provider to make sure the machine and associated resources were properly removed.
$ docker-machine ls
error getting URL for host test: exit status 255
NAME   ACTIVE   DRIVER       STATE     URL   SWARM
test            virtualbox   Running

Running with --debug shows the following error at the end:

ERROR getting IP: %sNo IP address found 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:17:90:e1 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::a00:27ff:fe17:90e1/64 scope link
       valid_lft forever preferred_lft forever
arthurk commented 9 years ago

I figured out a solution that works in my case.

Checking ifconfig showed a lot of vboxnet# adapters that were used by virtual machines that are long gone, but for some reason the one of the adapters was still holding on to its ip address:

vboxnet0: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:00
vboxnet1: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:01
vboxnet10: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:0a
    inet 192.168.99.1 netmask 0xffffff00 broadcast 192.168.99.255
vboxnet2: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:02
vboxnet3: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:03
vboxnet4: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:04
vboxnet5: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:05
vboxnet6: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:06
vboxnet7: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:07
vboxnet8: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:08

Docker-machine wanted to create a vm with an ip in the 192.168.99.* range, but vboxnet10 was still holding on to the 192.168.99.1 address. For some reason, this made machine fail. Removing the adapter with VBoxManage hostonlyif remove vboxnet10 fixed the issue and I can now use docker-machine successfully:

docker-machine create --driver virtualbox finaltest
Creating VirtualBox VM...
Creating SSH key...
Starting VirtualBox VM...
Starting VM...
To see how to connect Docker to this machine, run: docker-machine env finaltest
docker-machine ls
NAME          ACTIVE   DRIVER       STATE     URL                         SWARM
anothertest            virtualbox   Running   tcp://192.168.99.101:2376
finaltest              virtualbox   Running   tcp://192.168.99.102:2376
test                   virtualbox   Running   tcp://192.168.99.100:2376
mdub commented 9 years ago

I'm having the same problem here, with:

I've removed all existing VMs, and host-only networks:

$ VBoxManage list vms | wc -l
       0
$ VBoxManage list hostonlyifs | wc -l
       0

and cleaned out existing docker-machine state:

$ rm -fr ~/.docker/machine

But docker-machine create ... still hangs:

$ docker-machine --debug create --driver virtualbox dev
Creating CA: /Users/mike_williams/.docker/machine/certs/ca.pem
Creating client certificate: /Users/mike_williams/.docker/machine/certs/cert.pem
executing: /usr/local/bin/VBoxManage 
STDOUT: Oracle VM VirtualBox Command Line Management Interface Version 4.3.28
...
Image cache does not exist, creating it at /Users/mike_williams/.docker/machine/cache...
No default boot2docker iso found locally, downloading the latest release...
Downloading https://github.com/boot2docker/boot2docker/releases/download/v1.7.0/boot2docker.iso to /Users/mike_williams/.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="/Users/mike_williams/.docker/machine/machines/dev/disk.vmdk"...
Creating dynamic image with size 20971520000 bytes (20000MB)...
executing: /usr/local/bin/VBoxManage createvm --basefolder /Users/mike_williams/.docker/machine/machines/dev --name dev --register
STDOUT: Virtual machine 'dev' is created and registered.
UUID: 8be6fcce-db3c-47f4-a631-7c58880ca67b
Settings file: '/Users/mike_williams/.docker/machine/machines/dev/dev/dev.vbox'

STDERR: 
VM CPUS: 1
VM Memory: 1024
executing: /usr/local/bin/VBoxManage modifyvm dev --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 --synthcpu off --hpet on --hwvirtex on --nestedpaging on --largepages on --vtxvpid on --accelerate3d off --boot1 dvd
STDOUT: 
STDERR: 
executing: /usr/local/bin/VBoxManage modifyvm dev --nic1 nat --nictype1 82540EM --cableconnected1 on
STDOUT: 
STDERR: 
using 192.168.99.1 for dhcp address
executing: /usr/local/bin/VBoxManage list hostonlyifs
STDOUT: 
STDERR: 
executing: /usr/local/bin/VBoxManage hostonlyif create
STDOUT: Interface 'vboxnet0' was successfully created

STDERR: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

executing: /usr/local/bin/VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.99.1 --netmask 255.255.255.0
STDOUT: 
STDERR: 
executing: /usr/local/bin/VBoxManage list dhcpservers
STDOUT: 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

NetworkName:    HostInterfaceNetworking-vboxnet1
IP:             192.168.99.2
NetworkMask:    255.255.255.0
lowerIPAddress: 192.168.99.100
upperIPAddress: 192.168.99.254
Enabled:        Yes

STDERR: 
executing: /usr/local/bin/VBoxManage dhcpserver modify --netname HostInterfaceNetworking-vboxnet0 --ip 192.168.99.1 --netmask 255.255.255.0 --lowerip 192.168.99.100 --upperip 192.168.99.254 --enable
STDOUT: 
STDERR: 
executing: /usr/local/bin/VBoxManage modifyvm dev --nic2 hostonly --nictype2 82540EM --hostonlyadapter2 vboxnet0 --cableconnected2 on
STDOUT: 
STDERR: 
executing: /usr/local/bin/VBoxManage storagectl dev --name SATA --add sata --hostiocache on
STDOUT: 
STDERR: 
executing: /usr/local/bin/VBoxManage storageattach dev --storagectl SATA --port 0 --device 0 --type dvddrive --medium /Users/mike_williams/.docker/machine/machines/dev/boot2docker.iso
STDOUT: 
STDERR: 
executing: /usr/local/bin/VBoxManage storageattach dev --storagectl SATA --port 1 --device 0 --type hdd --medium /Users/mike_williams/.docker/machine/machines/dev/disk.vmdk
STDOUT: 
STDERR: 
executing: /usr/local/bin/VBoxManage guestproperty set dev /VirtualBox/GuestAdd/SharedFolders/MountPrefix /
STDOUT: 
STDERR: 
executing: /usr/local/bin/VBoxManage guestproperty set dev /VirtualBox/GuestAdd/SharedFolders/MountDir /
STDOUT: 
STDERR: 
executing: /usr/local/bin/VBoxManage sharedfolder add dev --name Users --hostpath /Users --automount
STDOUT: 
STDERR: 
executing: /usr/local/bin/VBoxManage setextradata dev VBoxInternal2/SharedFoldersEnableSymlinksCreate/Users 1
STDOUT: 
STDERR: 
Starting VirtualBox VM...
executing: /usr/local/bin/VBoxManage showvminfo dev --machinereadable
STDOUT: name="dev"
groups="/"
ostype="Linux 2.6 / 3.x (64 bit)"
UUID="8be6fcce-db3c-47f4-a631-7c58880ca67b"
CfgFile="/Users/mike_williams/.docker/machine/machines/dev/dev/dev.vbox"
SnapFldr="/Users/mike_williams/.docker/machine/machines/dev/dev/Snapshots"
LogFldr="/Users/mike_williams/.docker/machine/machines/dev/dev/Logs"
hardwareuuid="8be6fcce-db3c-47f4-a631-7c58880ca67b"
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-07-08T01:04:51.305000000"
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"="/Users/mike_williams/.docker/machine/machines/dev/boot2docker.iso"
"SATA-ImageUUID-0-0"="ae0e613c-0264-48a1-b426-e55c217e70ae"
"SATA-tempeject"="off"
"SATA-IsEjected"="off"
"SATA-1-0"="/Users/mike_williams/.docker/machine/machines/dev/disk.vmdk"
"SATA-ImageUUID-1-0"="afaf5480-6840-49a7-bd84-c5421dd6672f"
"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="08002779180D"
cableconnected1="on"
nic1="nat"
nictype1="82540EM"
nicspeed1="0"
mtu="0"
sockSnd="64"
sockRcv="64"
tcpWndSnd="64"
tcpWndRcv="64"
hostonlyadapter2="vboxnet0"
macaddress2="080027FF1B3B"
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"
SharedFolderNameMachineMapping1="Users"
SharedFolderPathMachineMapping1="/Users"
VRDEActiveConnection="off"
VRDEClients=0
vcpenabled="off"
vcpscreens=0
vcpfile="/Users/mike_williams/.docker/machine/machines/dev/dev/dev.webm"
vcpwidth=1024
vcpheight=768
vcprate=512
vcpfps=25
GuestMemoryBalloon=0

STDERR: 
using 192.168.99.1 for dhcp address
executing: /usr/local/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:     
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:00
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-vboxnet0

STDERR: 
executing: /usr/local/bin/VBoxManage modifyvm dev --nic2 hostonly --nictype2 82540EM --hostonlyadapter2 vboxnet0 --cableconnected2 on
STDOUT: 
STDERR: 
executing: /usr/local/bin/VBoxManage modifyvm dev --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/local/bin/VBoxManage modifyvm dev --natpf1 ssh,tcp,127.0.0.1,51246,,22
STDOUT: 
STDERR: 
executing: /usr/local/bin/VBoxManage startvm dev --type headless
STDOUT: Waiting for VM "dev" to power on...
VM "dev" has been successfully started.

STDERR: 
Starting VM...
Getting to WaitForSSH function...
Testing TCP connection to: localhost:51246
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 /Users/mike_williams/.docker/machine/machines/dev/id_rsa -p 51246 docker@localhost exit 0] []  <nil> <nil> <nil> [] <nil> <nil> <nil> ?reflect.Value? false [] [] [] [] <nil>}
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:51246
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 /Users/mike_williams/.docker/machine/machines/dev/id_rsa -p 51246 docker@localhost exit 0] []  <nil> <nil> <nil> [] <nil> <nil> <nil> ?reflect.Value? false [] [] [] [] <nil>}
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:51246
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 /Users/mike_williams/.docker/machine/machines/dev/id_rsa -p 51246 docker@localhost exit 0] []  <nil> <nil> <nil> [] <nil> <nil> <nil> ?reflect.Value? false [] [] [] [] <nil>}
SSH cmd err, output: exit status 255: 
(HANGS HERE)
mdub commented 9 years ago

More info: the SSH command that is "failing" appears to work fine when run from the command-line:

$ /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 /Users/mike_williams/.docker/machine/machines/dev/id_rsa -p 51246 docker@localhost echo hello
hello
smo921 commented 9 years ago

Resolved this on my instance after finding another post pointing at ssh_config changes that may be needed (https://github.com/docker/machine/issues/878). I had a block in my users .ssh/config file for 'Host *' that I commented out and docker-machine is working as expected now. You may want to look at your .ssh/config or /etc/ssh_config file.

mdub commented 9 years ago

Great tip, thanks @smo921! Indeed, I had the following in my ~/.ssh/config:

ControlPath ~/.ssh/mux/%r@%h:%p
ControlMaster auto
ControlPersist 10m

and removing them solved the problem.

The solution I settled on was to explicitly override those defaults for "localhost":

Host localhost
  ControlMaster no
  ControlPath none
  ControlPersist no

Host *
  ControlPath ~/.ssh/mux/%r@%h:%p
  ControlMaster auto
  ControlPersist 10m
generalov commented 9 years ago

@arthurk, +1

Docker-machine wanted to create a vm with an ip in the 192.168.99.* range, but vboxnet10 was still holding on to the 192.168.99.1 address. For some reason, this made machine fail. Removing the adapter with VBoxManage hostonlyif remove vboxnet10 fixed the issue and I can now use docker-machine successfully:

Removing the adapter with 192.168.99.1 address helps me too.

JrCs commented 9 years ago

I used the docker-machine 0.3.1 and it hang creating the VM on my Mac. All is working if i remove the ControlXXXX options in my ~/.ssh/config. The best is to add -S none to the options passed to ssh in ssh/client.go: https://github.com/docker/machine/blob/master/ssh/client.go#L57

mattes commented 9 years ago

+1

aaronbwcollins commented 9 years ago

It seems to get stuck at the Starting VM stage. Once using --debug we find that its waiting to make a connection with the machine via ssh. Our temporary workaround was to add unset SSH_AUTH_SOCKto our bashrc and retry docker-machine create. We are using openssh via brew version OpenSSH_6.9p1. Once we unset the ssh variable the setup worked as expected. You can replicate this by using ssh -v elsewhere, If it hangs during the debug1: SSH2_MSG_SERVICE_ACCEPT receivedthen unsetting the SSH_AUTH_SOCK variable should do the trick.

jitakirin commented 9 years ago

Looks like SSH connection multiplexing is a different issue so I opened a new bug report for that #1572

manik2131 commented 9 years ago

I am also finding the same issue running the command

docker-machine --debug create --driver virtualbox manik221

STDERR: 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/manik221/disk.vmdk"... Creating dynamic image with size 20971520000 bytes (20000MB)... executing: /usr/bin/VBoxManage createvm --basefolder /root/.docker/machine/machines/manik221 --name manik221 --register STDOUT: Virtual machine 'manik221' is created and registered. UUID: 760c0375-f32a-4327-b04b-5a45d5802527 Settings file: '/root/.docker/machine/machines/manik221/manik221/manik221.vbox'

STDERR: VM CPUS: 1 VM Memory: 1024 executing: /usr/bin/VBoxManage modifyvm manik221 --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 --synthcpu off --hpet on --hwvirtex on --nestedpaging on --largepages on --vtxvpid on --accelerate3d off --boot1 dvd STDOUT: STDERR: executing: /usr/bin/VBoxManage modifyvm manik221 --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 manik221 --nic2 hostonly --nictype2 82540EM --hostonlyadapter2 vboxnet0 --cableconnected2 on STDOUT: STDERR: executing: /usr/bin/VBoxManage storagectl manik221 --name SATA --add sata --hostiocache on STDOUT: STDERR: executing: /usr/bin/VBoxManage storageattach manik221 --storagectl SATA --port 0 --device 0 --type dvddrive --medium /root/.docker/machine/machines/manik221/boot2docker.iso STDOUT: STDERR: executing: /usr/bin/VBoxManage storageattach manik221 --storagectl SATA --port 1 --device 0 --type hdd --medium /root/.docker/machine/machines/manik221/disk.vmdk STDOUT: STDERR: executing: /usr/bin/VBoxManage guestproperty set manik221 /VirtualBox/GuestAdd/SharedFolders/MountPrefix / STDOUT: STDERR: executing: /usr/bin/VBoxManage guestproperty set manik221 /VirtualBox/GuestAdd/SharedFolders/MountDir / STDOUT: STDERR: Starting VirtualBox VM... executing: /usr/bin/VBoxManage showvminfo manik221 --machinereadable STDOUT: name="manik221" ostype="Linux26_64" UUID="760c0375-f32a-4327-b04b-5a45d5802527" CfgFile="/root/.docker/machine/machines/manik221/manik221/manik221.vbox" SnapFldr="/root/.docker/machine/machines/manik221/manik221/Snapshots" LogFldr="/root/.docker/machine/machines/manik221/manik221/Logs" hardwareuuid="760c0375-f32a-4327-b04b-5a45d5802527" memory=1024 pagefusion="off" vram=8 cpuexecutioncap=100 hpet="on" chipset="piix3" firmware="BIOS" cpus=1 synthcpu="off" bootmenu="disabled" boot1="dvd" boot2="dvd" boot3="disk" boot4="none" acpi="on" ioapic="on" pae="on" biossystemtimeoffset=0 rtcuseutc="on" hwvirtex="on" hwvirtexexcl="on" nestedpaging="on" largepages="on" vtxvpid="on" VMState="poweroff" VMStateChangeTime="2015-08-05T09:34:00.339000000" monitorcount=1 accelerate3d="off" accelerate2dvideo="off" teleporterenabled="off" teleporterport=0 teleporteraddress="" teleporterpassword="" storagecontrollername0="SATA" storagecontrollertype0="IntelAhci" storagecontrollerinstance0="0" storagecontrollermaxportcount0="30" storagecontrollerportcount0="30" storagecontrollerbootable0="on" "SATA-0-0"="/root/.docker/machine/machines/manik221/boot2docker.iso" "SATA-ImageUUID-0-0"="c332199c-1773-4d7e-a735-8f8f062246d5" "SATA-tempeject"="off" "SATA-IsEjected"="off" "SATA-1-0"="/root/.docker/machine/machines/manik221/disk.vmdk" "SATA-ImageUUID-1-0"="12f600c7-e9bb-4faa-96f6-146993e592db" "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="080027002661" cableconnected1="on" nic1="nat" mtu="0" sockSnd="64" sockRcv="64" tcpWndSnd="64" tcpWndRcv="64" hostonlyadapter2="vboxnet0" macaddress2="08002714E5BB" cableconnected2="on" nic2="hostonly" nic3="none" nic4="none" nic5="none" nic6="none" nic7="none" nic8="none" hidpointing="ps2mouse" hidkeyboard="ps2kbd" uart1="off" uart2="off" audio="none" clipboard="bidirectional" vrde="off" usb="off" VRDEActiveConnection="off" VRDEClients=0 GuestMemoryBalloon=0 GuestOSType="Linux26_64" GuestAdditionsRunLevel=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 manik221 --nic2 hostonly --nictype2 82540EM --hostonlyadapter2 vboxnet0 --cableconnected2 on STDOUT: STDERR: executing: /usr/bin/VBoxManage modifyvm manik221 --natpf1 delete ssh STDOUT: STDERR: VBoxManage: error: Code NS_ERROR_INVALID_ARG (0x80070057) - Invalid argument value (extended info not available) Context: "RemoveRedirect(Bstr(ValueUnion.psz).raw())" at line 1479 of file VBoxManageModifyVM.cpp

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

STDERR: Starting VM... Getting to WaitForSSH function... Testing TCP connection to: localhost:33655 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/manik221/id_rsa -p 33655 docker@localhost exit 0] [] [] ?reflect.Value? 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:33655 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/manik221/id_rsa -p 33655 docker@localhost exit 0] [] [] ?reflect.Value? 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:33655 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/manik221/id_rsa -p 33655 docker@localhost exit 0] [] [] ?reflect.Value? false [] [] [] [] }

manik2131 commented 9 years ago
  <Network>
    <Adapter slot="0" enabled="true" MACAddress="080027002661" cable="true" speed="0" type="82540EM">
      <DisabledModes/>
      <NAT>
        <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
        <Alias logging="false" proxy-only="false" use-same-ports="false"/>
        <Forwarding name="ssh" proto="1" hostip="127.0.0.1" hostport="33655" guestport="22"/>
      </NAT>
    </Adapter>
    <Adapter slot="1" enabled="true" MACAddress="08002714E5BB" cable="true" speed="0" type="82540EM">
      <DisabledModes>
        <NAT>
          <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
          <Alias logging="false" proxy-only="false" use-same-ports="false"/>
        </NAT>
        <HostOnlyInterface name="vboxnet0"/>
      </DisabledModes>
      <HostOnlyInterface name="vboxnet0"/>
    </Adapter>
mecp commented 9 years ago

+1 Same issue here!

kkoudev commented 9 years ago

+1

ScOut3R commented 9 years ago

Hi,

just installed the toolbox on OS X Yosemite and I am also affected by something which prevents me to create the VM.

STDERR: 
Starting VM...
Getting to WaitForSSH function...
Testing TCP connection to: localhost:52599
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 /Users/mgabri/.docker/machine/machines/default/id_rsa -p 52599 docker@localhost exit 0] []  <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>}
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:52599
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 /Users/mgabri/.docker/machine/machines/default/id_rsa -p 52599 docker@localhost exit 0] []  <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>}
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:52599
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 /Users/mgabri/.docker/machine/machines/default/id_rsa -p 52599 docker@localhost exit 0] []  <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>}
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:52599
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 /Users/mgabri/.docker/machine/machines/default/id_rsa -p 52599 docker@localhost exit 0] []  <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>}

And it just hangs there. If I try to use that SSH command in another terminal it works fine, so the VM is booted just fine. Any clue what might be causing this?

jitakirin commented 9 years ago

@ScOut3R IIRC OS X enables SSH session multiplexing by default so your issue could be caused by #1572

As mentioned somewhere before a workaround is to set ControlMaster no option for your host in .ssh/config file.

On Fri, 14 Aug 2015 09:47 Mate Gabri notifications@github.com wrote:

Hi,

just installed the toolbox on OS X Yosemite and I am also affected by something which prevents me to create the VM.

STDERR: Starting VM... Getting to WaitForSSH function... Testing TCP connection to: localhost:52599 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 /Users/mgabri/.docker/machine/machines/default/id_rsa -p 52599 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:52599 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 /Users/mgabri/.docker/machine/machines/default/id_rsa -p 52599 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:52599 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 /Users/mgabri/.docker/machine/machines/default/id_rsa -p 52599 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:52599 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 /Users/mgabri/.docker/machine/machines/default/id_rsa -p 52599 docker@localhost exit 0] [] [] false [] [] [] [] }

And it just hangs there. If I try to use that SSH command in another terminal it works fine, so the VM is booted just fine. Any clue what might be causing this?

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

ScOut3R commented 9 years ago

@jitakirin Thanks, that solved it! :)

diimdeep commented 9 years ago

Works after removing from ~/.ssh/config

Host *
    PubkeyAuthentication no
    IdentitiesOnly yes
oscarrenalias commented 9 years ago

I can confirm that removing a stale virtual network adapter that was holding onto IP address 192.168.99.1 fixed it for me, and subsequent nodes created with the VirtualBox driver work perfectly. I am also running the Cisco AnyConnect Secure Mobility client but that did not seem to have any impact (the process works with and without the client running).

This is on OS X 10.10.5, VirtualBox 5.0.0 and Docker-machine 0.4.0.