{"action":"created","issue":{"url":"https://api.github.com/repos/docker/machine/issues/1031","labels_url":"https://api.github.com/repos/docker/machine/issues/1031/labels{/name}","comments_url":"https://api.github.com/repos/docker/machine/issues/1031/comments","events_url":"https://api.github.com/repos/docker/machine/issues/1031/events","html_url":"https://github.com/docker/machine/issues/1031","id":69559571,"number":1031,"title":"Another reason docker-machine create is hanging","user":{"login":"far-blue","id":344317,"avatar_url":"https://avatars.githubusercontent.com/u/344317?v=3","gravatar_id":"","url":"https://api.github.com/users/far-blue","html_url":"https://github.com/far-blue","followers_url":"https://api.github.com/users/far-blue/followers","following_url":"https://api.github.com/users/far-blue/following{/other_user}","gists_url":"https://api.github.com/users/far-blue/gists{/gist_id}","starred_url":"https://api.github.com/users/far-blue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/far-blue/subscriptions","organizations_url":"https://api.github.com/users/far-blue/orgs","repos_url":"https://api.github.com/users/far-blue/repos","events_url":"https://api.github.com/users/far-blue/events{/privacy}","received_events_url":"https://api.github.com/users/far-blue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-04-20T10:47:39Z","updated_at":"2015-04-28T05:41:48Z","closed_at":null,"body":"I'm also seeing `create` hang during the creation process with `Waiting for VM to start...`.\r\n\r\nFor 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.\r\n\r\nI 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`):\r\n```\r\nDEBU[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\r\n```\r\nwhich unsurprisingly errors with: `Bad port '0'`\r\n\r\nI 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”)`"},"comment":{"url":"https://api.github.com/repos/docker/machine/issues/comments/96920825","html_url":"https://github.com/docker/machine/issues/1031#issuecomment-96920825","issue_url":"https://api.github.com/repos/docker/machine/issues/1031","id":96920825,"user":{"login":"rossbachp","id":692278,"avatar_url":"https://avatars.githubusercontent.com/u/692278?v=3","gravatar_id":"","url":"https://api.github.com/users/rossbachp","html_url":"https://github.com/rossbachp","followers_url":"https://api.github.com/users/rossbachp/followers","following_url":"https://api.github.com/users/rossbachp/following{/other_user}","gists_url":"https://api.github.com/users/rossbachp/gists{/gist_id}","starred_url":"https://api.github.com/users/rossbachp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossbachp/subscriptions","organizations_url":"https://api.github.com/users/rossbachp/orgs","repos_url":"https://api.github.com/users/rossbachp/repos","events_url":"https://api.github.com/users/rossbachp/events{/privacy}","received_events_url":"https://api.github.com/users/rossbachp/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T05:41:48Z","updated_at":"2015-04-28T05:41:48Z","body":"No VPN Software installed...\r\n\r\n```\r\n$ VBoxManage list hostonlyifs\r\nName:            vboxnet0\r\nGUID:            786f6276-656e-4074-8000-0a0027000000\r\nDHCP:            Disabled\r\nIPAddress:       192.168.59.3\r\nNetworkMask:     255.255.255.0\r\nIPV6Address:     \r\nIPV6NetworkMaskPrefixLength: 0\r\nHardwareAddress: 0a:00:27:00:00:00\r\nMediumType:      Ethernet\r\nStatus:          Up\r\nVBoxNetworkName: HostInterfaceNetworking-vboxnet0\r\n\r\nName:            vboxnet1\r\nGUID:            786f6276-656e-4174-8000-0a0027000001\r\nDHCP:            Disabled\r\nIPAddress:       192.168.50.1\r\nNetworkMask:     255.255.255.0\r\nIPV6Address:     \r\nIPV6NetworkMaskPrefixLength: 0\r\nHardwareAddress: 0a:00:27:00:00:01\r\nMediumType:      Ethernet\r\nStatus:          Down\r\nVBoxNetworkName: HostInterfaceNetworking-vboxnet1\r\n\r\nName:            vboxnet2\r\nGUID:            786f6276-656e-4274-8000-0a0027000002\r\nDHCP:            Disabled\r\nIPAddress:       192.168.99.1\r\nNetworkMask:     255.255.255.0\r\nIPV6Address:     \r\nIPV6NetworkMaskPrefixLength: 0\r\nHardwareAddress: 0a:00:27:00:00:02\r\nMediumType:      Ethernet\r\nStatus:          Up\r\nVBoxNetworkName: HostInterfaceNetworking-vboxnet2\r\n\r\nName:            vboxnet3\r\nGUID:            786f6276-656e-4374-8000-0a0027000003\r\nDHCP:            Disabled\r\nIPAddress:       192.168.33.1\r\nNetworkMask:     255.255.255.0\r\nIPV6Address:     \r\nIPV6NetworkMaskPrefixLength: 0\r\nHardwareAddress: 0a:00:27:00:00:03\r\nMediumType:      Ethernet\r\nStatus:          Down\r\nVBoxNetworkName: HostInterfaceNetworking-vboxnet3\r\n\r\nName:            vboxnet4\r\nGUID:            786f6276-656e-4474-8000-0a0027000004\r\nDHCP:            Disabled\r\nIPAddress:       10.2.0.1\r\nNetworkMask:     255.255.255.0\r\nIPV6Address:     \r\nIPV6NetworkMaskPrefixLength: 0\r\nHardwareAddress: 0a:00:27:00:00:04\r\nMediumType:      Ethernet\r\nStatus:          Down\r\nVBoxNetworkName: HostInterfaceNetworking-vboxnet4\r\n\r\nName:            vboxnet5\r\nGUID:            786f6276-656e-4574-8000-0a0027000005\r\nDHCP:            Disabled\r\nIPAddress:       172.30.8.1\r\nNetworkMask:     255.255.255.0\r\nIPV6Address:     \r\nIPV6NetworkMaskPrefixLength: 0\r\nHardwareAddress: 0a:00:27:00:00:05\r\nMediumType:      Ethernet\r\nStatus:          Down\r\nVBoxNetworkName: HostInterfaceNetworking-vboxnet5\r\n\r\nName:            vboxnet6\r\nGUID:            786f6276-656e-4674-8000-0a0027000006\r\nDHCP:            Disabled\r\nIPAddress:       10.245.1.1\r\nNetworkMask:     255.255.255.0\r\nIPV6Address:     \r\nIPV6NetworkMaskPrefixLength: 0\r\nHardwareAddress: 0a:00:27:00:00:06\r\nMediumType:      Ethernet\r\nStatus:          Down\r\nVBoxNetworkName: HostInterfaceNetworking-vboxnet6\r\n\r\nName:            vboxnet7\r\nGUID:            786f6276-656e-4774-8000-0a0027000007\r\nDHCP:            Disabled\r\nIPAddress:       172.16.255.1\r\nNetworkMask:     255.255.255.0\r\nIPV6Address:     \r\nIPV6NetworkMaskPrefixLength: 0\r\nHardwareAddress: 0a:00:27:00:00:07\r\nMediumType:      Ethernet\r\nStatus:          Down\r\nVBoxNetworkName: HostInterfaceNetworking-vboxnet7\r\n```\r\n\r\n```\r\n$ netstat -nr\r\nRouting tables\r\n\r\nInternet:\r\nDestination        Gateway            Flags        Refs      Use   Netif Expire\r\ndefault            10.67.48.1         UGSc           59        1     en0\r\n10.67.48/22        link#4             UCS             1        0     en0\r\n10.67.48.1/32      link#4             UCS             1        0     en0\r\n10.67.48.1         0:1f:9d:81:14:0    UHLWIir        63      106     en0    754\r\n10.67.48.69/32     link#4             UCS             1        0     en0\r\n10.67.51.255       ff:ff:ff:ff:ff:ff  UHLWbI          0       51     en0\r\n127                127.0.0.1          UCS             0        0     lo0\r\n127.0.0.1          127.0.0.1          UH              5    10937     lo0\r\n169.254            link#4             UCS             0        0     en0\r\n192.168.59         link#11            UC              3        0 vboxnet\r\n192.168.59.3       a:0:27:0:0:0       UHLWIi          1        6     lo0\r\n192.168.59.103     8:0:27:39:17:b6    UHLWI           0      130 vboxnet    769\r\n192.168.59.255     ff:ff:ff:ff:ff:ff  UHLWbI          0       12 vboxnet\r\n192.168.99         link#13            UC              2        0 vboxnet\r\n192.168.99.1       a:0:27:0:0:2       UHLWIi          1       18     lo0\r\n192.168.99.255     ff:ff:ff:ff:ff:ff  UHLWbI          0       12 vboxnet\r\n\r\nInternet6:\r\nDestination                             Gateway                         Flags         Netif Expire\r\n::1                                     ::1                             UHL             lo0\r\nfdd0:e482:fa34:53a7::/64                fe80::c5e9:1a18:51ff:d0aa%utun0 Uc            utun0\r\nfdd0:e482:fa34:53a7:c5e9:1a18:51ff:d0aa link#10                         UHL             lo0\r\nfe80::%lo0/64                           fe80::1%lo0                     UcI             lo0\r\nfe80::1%lo0                             link#1                          UHLI            lo0\r\nfe80::%en0/64                           link#4                          UCI             en0\r\nfe80::4ad7:5ff:fec2:e3c9%en0            48:d7:5:c2:e3:c9                UHLI            lo0\r\nfe80::%awdl0/64                         link#8                          UCI           awdl0\r\nfe80::8f2:37ff:fe15:c697%awdl0          a:f2:37:15:c6:97                UHLI            lo0\r\nfe80::%utun0/64                         fe80::c5e9:1a18:51ff:d0aa%utun0 UcI           utun0\r\nfe80::c5e9:1a18:51ff:d0aa%utun0         link#10                         UHLI            lo0\r\nff01::%lo0/32                           ::1                             UmCI            lo0\r\nff01::%en0/32                           link#4                          UmCI            en0\r\nff01::%awdl0/32                         link#8                          UmCI          awdl0\r\nff01::%utun0/32                         fe80::c5e9:1a18:51ff:d0aa%utun0 UmCI          utun0\r\nff02::%lo0/32                           ::1                             UmCI            lo0\r\nff02::%en0/32                           link#4                          UmCI            en0\r\nff02::%awdl0/32                         link#8                          UmCI          awdl0\r\nff02::%utun0/32                         fe80::c5e9:1a18:51ff:d0aa%utun0 UmCI          utun0\r\n```\r\n"}}