Machine: Unable to run docker-machine due to SSH error

Created on 4 Jan 2016  路  34Comments  路  Source: docker/machine

Running any cmd against docker machine is failing due to an issue finding SSH keys on the machine (or so the error msg says). Regenerate certs does not fix the problem. Please see the logs attached below.

OS: OS X Yosemite
VBox: VirtualBox 5.0.6 r103037
Docker Machine: 0.5.2

Basic msg

> docker-machine env default

Error checking TLS connection: Error getting driver URL: Something went wrong running an SSH command!
command : ip addr show dev eth1
err     : exit status 255
output  : Warning: Identity file machines/default/id_rsa not accessible: No such file or directory.

Msg with debug flag

Docker Machine Version: 0.5.2 ( 0456b9f )
Found binary path at /usr/local/bin/docker-machine-driver-virtualbox
Launching plugin server for driver virtualbox
Plugin server listening at address 127.0.0.1:54331
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
(default) Calling .GetState
(default) DBG | COMMAND: /usr/local/bin/VBoxManage showvminfo default --machinereadable
(default) DBG | STDOUT:
(default) DBG | {
(default) DBG | name="default"
(default) DBG | groups="/"
(default) DBG | ostype="Linux 2.6 / 3.x / 4.x (64-bit)"
(default) DBG | UUID="e76379a0-2e02-45ee-b4c7-9b5a2bfc7b56"
(default) DBG | CfgFile="/Users/stefancruz/.docker/machine/machines/default/default/default.vbox"
(default) DBG | SnapFldr="/Users/stefancruz/.docker/machine/machines/default/default/Snapshots"
(default) DBG | LogFldr="/Users/stefancruz/.docker/machine/machines/default/default/Logs"
(default) DBG | hardwareuuid="e76379a0-2e02-45ee-b4c7-9b5a2bfc7b56"
(default) DBG | memory=4096
(default) DBG | pagefusion="off"
(default) DBG | vram=8
(default) DBG | cpuexecutioncap=100
(default) DBG | hpet="on"
(default) DBG | chipset="piix3"
(default) DBG | firmware="BIOS"
(default) DBG | cpus=1
(default) DBG | pae="on"
(default) DBG | longmode="on"
(default) DBG | cpuid-portability-level=0
(default) DBG | bootmenu="disabled"
(default) DBG | boot1="dvd"
(default) DBG | boot2="dvd"
(default) DBG | boot3="disk"
(default) DBG | boot4="none"
(default) DBG | acpi="on"
(default) DBG | ioapic="on"
(default) DBG | biossystemtimeoffset=0
(default) DBG | rtcuseutc="on"
(default) DBG | hwvirtex="on"
(default) DBG | nestedpaging="on"
(default) DBG | largepages="on"
(default) Calling .GetURL
(default) DBG | vtxvpid="on"
(default) DBG | vtxux="on"
(default) DBG | paravirtprovider="default"
(default) DBG | VMState="running"
(default) DBG | VMStateChangeTime="2016-01-04T20:22:40.262000000"
(default) DBG | monitorcount=1
(default) DBG | accelerate3d="off"
(default) DBG | accelerate2dvideo="off"
(default) DBG | teleporterenabled="off"
(default) DBG | teleporterport=0
(default) DBG | teleporteraddress=""
(default) DBG | teleporterpassword=""
(default) DBG | tracing-enabled="off"
(default) DBG | tracing-allow-vm-access="off"
(default) DBG | tracing-config=""
(default) DBG | autostart-enabled="off"
(default) DBG | autostart-delay=0
(default) DBG | defaultfrontend=""
(default) DBG | storagecontrollername0="SATA"
(default) DBG | storagecontrollertype0="IntelAhci"
(default) DBG | storagecontrollerinstance0="0"
(default) DBG | storagecontrollermaxportcount0="30"
(default) DBG | storagecontrollerportcount0="30"
(default) DBG | storagecontrollerbootable0="on"
(default) DBG | "SATA-0-0"="/Users/stefancruz/.docker/machine/machines/default/boot2docker.iso"
(default) DBG | "SATA-ImageUUID-0-0"="3cd5a181-259f-4aa7-b844-dc6ab4c567a3"
(default) DBG | "SATA-tempeject"="off"
(default) DBG | "SATA-IsEjected"="off"
(default) DBG | "SATA-1-0"="/Users/stefancruz/.docker/machine/machines/default/disk.vmdk"
(default) DBG | "SATA-ImageUUID-1-0"="9e31f271-a17a-4dc1-b2d1-3afe780b1474"
(default) DBG | "SATA-2-0"="none"
(default) DBG | "SATA-3-0"="none"
(default) DBG | "SATA-4-0"="none"
(default) DBG | "SATA-5-0"="none"
(default) DBG | "SATA-6-0"="none"
(default) DBG | "SATA-7-0"="none"
(default) DBG | "SATA-8-0"="none"
(default) DBG | "SATA-9-0"="none"
(default) DBG | "SATA-10-0"="none"
(default) DBG | "SATA-11-0"="none"
(default) DBG | "SATA-12-0"="none"
(default) DBG | "SATA-13-0"="none"
(default) DBG | "SATA-14-0"="none"
(default) DBG | "SATA-15-0"="none"
(default) DBG | "SATA-16-0"="none"
(default) DBG | "SATA-17-0"="none"
(default) DBG | "SATA-18-0"="none"
(default) DBG | "SATA-19-0"="none"
(default) DBG | "SATA-20-0"="none"
(default) DBG | "SATA-21-0"="none"
(default) DBG | "SATA-22-0"="none"
(default) DBG | "SATA-23-0"="none"
(default) DBG | "SATA-24-0"="none"
(default) DBG | "SATA-25-0"="none"
(default) DBG | "SATA-26-0"="none"
(default) DBG | "SATA-27-0"="none"
(default) DBG | "SATA-28-0"="none"
(default) DBG | "SATA-29-0"="none"
(default) DBG | natnet1="nat"
(default) DBG | macaddress1="080027BB37F9"
(default) DBG | cableconnected1="on"
(default) DBG | nic1="nat"
(default) DBG | nictype1="82540EM"
(default) DBG | nicspeed1="0"
(default) DBG | mtu="0"
(default) DBG | sockSnd="64"
(default) DBG | sockRcv="64"
(default) DBG | tcpWndSnd="64"
(default) DBG | tcpWndRcv="64"
(default) DBG | Forwarding(0)="ssh,tcp,127.0.0.1,64622,,22"
(default) DBG | hostonlyadapter2="vboxnet1"
(default) DBG | macaddress2="0800274BF595"
(default) DBG | cableconnected2="on"
(default) DBG | nic2="hostonly"
(default) DBG | nictype2="82540EM"
(default) DBG | nicspeed2="0"
(default) DBG | nic3="none"
(default) DBG | nic4="none"
(default) DBG | nic5="none"
(default) DBG | nic6="none"
(default) DBG | nic7="none"
(default) DBG | nic8="none"
(default) DBG | hidpointing="ps2mouse"
(default) DBG | hidkeyboard="ps2kbd"
(default) DBG | uart1="off"
(default) DBG | uart2="off"
(default) DBG | lpt1="off"
(default) DBG | lpt2="off"
(default) DBG | audio="none"
(default) DBG | clipboard="disabled"
(default) DBG | draganddrop="disabled"
(default) DBG | SessionName="headless"
(default) DBG | VideoMode="720,400,0"@0,0 1
(default) DBG | vrde="off"
(default) DBG | usb="off"
(default) DBG | ehci="off"
(default) DBG | xhci="off"
(default) DBG | SharedFolderNameMachineMapping1="Users"
(default) DBG | SharedFolderPathMachineMapping1="/Users"
(default) DBG | VRDEActiveConnection="off"
(default) DBG | VRDEClients=0
(default) DBG | vcpenabled="off"
(default) DBG | vcpscreens=0
(default) DBG | vcpfile="/Users/stefancruz/.docker/machine/machines/default/default/default.webm"
(default) DBG | vcpwidth=1024
(default) DBG | vcpheight=768
(default) DBG | vcprate=512
(default) DBG | vcpfps=25
(default) DBG | GuestMemoryBalloon=0
(default) DBG | GuestOSType="Linux26_64"
(default) DBG | GuestAdditionsRunLevel=2
(default) DBG | GuestAdditionsVersion="5.0.10 r104061"
(default) DBG | GuestAdditionsFacility_VirtualBox Base Driver=50,1451938979637
(default) DBG | GuestAdditionsFacility_VirtualBox System Service=50,1451938987285
(default) DBG | GuestAdditionsFacility_Seamless Mode=0,1451938979637
(default) DBG | GuestAdditionsFacility_Graphics Mode=0,1451938979637
(default) DBG | }
(default) DBG | STDERR:
(default) DBG | {
(default) DBG | }
(default) DBG | COMMAND: /usr/local/bin/VBoxManage showvminfo default --machinereadable
(default) DBG | STDOUT:
(default) DBG | {
(default) DBG | name="default"
(default) DBG | groups="/"
(default) DBG | ostype="Linux 2.6 / 3.x / 4.x (64-bit)"
(default) DBG | UUID="e76379a0-2e02-45ee-b4c7-9b5a2bfc7b56"
(default) DBG | CfgFile="/Users/stefancruz/.docker/machine/machines/default/default/default.vbox"
(default) DBG | SnapFldr="/Users/stefancruz/.docker/machine/machines/default/default/Snapshots"
(default) DBG | LogFldr="/Users/stefancruz/.docker/machine/machines/default/default/Logs"
(default) DBG | hardwareuuid="e76379a0-2e02-45ee-b4c7-9b5a2bfc7b56"
(default) DBG | memory=4096
(default) DBG | pagefusion="off"
(default) DBG | vram=8
(default) DBG | cpuexecutioncap=100
(default) DBG | hpet="on"
(default) DBG | chipset="piix3"
(default) DBG | firmware="BIOS"
(default) DBG | cpus=1
(default) DBG | pae="on"
(default) DBG | longmode="on"
(default) DBG | cpuid-portability-level=0
(default) DBG | bootmenu="disabled"
(default) DBG | boot1="dvd"
(default) DBG | boot2="dvd"
(default) DBG | boot3="disk"
(default) DBG | boot4="none"
(default) DBG | acpi="on"
(default) DBG | ioapic="on"
(default) DBG | biossystemtimeoffset=0
(default) DBG | rtcuseutc="on"
(default) DBG | hwvirtex="on"
(default) DBG | nestedpaging="on"
(default) DBG | largepages="on"
(default) DBG | vtxvpid="on"
(default) DBG | vtxux="on"
(default) DBG | paravirtprovider="default"
(default) DBG | VMState="running"
(default) DBG | VMStateChangeTime="2016-01-04T20:22:40.262000000"
(default) DBG | monitorcount=1
(default) DBG | accelerate3d="off"
(default) DBG | accelerate2dvideo="off"
(default) DBG | teleporterenabled="off"
(default) DBG | teleporterport=0
(default) DBG | teleporteraddress=""
(default) DBG | teleporterpassword=""
(default) DBG | tracing-enabled="off"
(default) DBG | tracing-allow-vm-access="off"
(default) DBG | tracing-config=""
(default) DBG | autostart-enabled="off"
(default) DBG | autostart-delay=0
(default) DBG | defaultfrontend=""
(default) DBG | storagecontrollername0="SATA"
(default) DBG | storagecontrollertype0="IntelAhci"
(default) DBG | storagecontrollerinstance0="0"
(default) DBG | storagecontrollermaxportcount0="30"
(default) DBG | storagecontrollerportcount0="30"
(default) DBG | storagecontrollerbootable0="on"
(default) DBG | "SATA-0-0"="/Users/stefancruz/.docker/machine/machines/default/boot2docker.iso"
(default) DBG | "SATA-ImageUUID-0-0"="3cd5a181-259f-4aa7-b844-dc6ab4c567a3"
(default) DBG | "SATA-tempeject"="off"
(default) DBG | "SATA-IsEjected"="off"
(default) DBG | "SATA-1-0"="/Users/stefancruz/.docker/machine/machines/default/disk.vmdk"
(default) DBG | "SATA-ImageUUID-1-0"="9e31f271-a17a-4dc1-b2d1-3afe780b1474"
(default) DBG | "SATA-2-0"="none"
(default) DBG | "SATA-3-0"="none"
(default) DBG | "SATA-4-0"="none"
(default) DBG | "SATA-5-0"="none"
(default) DBG | "SATA-6-0"="none"
(default) DBG | "SATA-7-0"="none"
(default) DBG | "SATA-8-0"="none"
(default) DBG | "SATA-9-0"="none"
(default) DBG | "SATA-10-0"="none"
(default) DBG | "SATA-11-0"="none"
(default) DBG | "SATA-12-0"="none"
(default) DBG | "SATA-13-0"="none"
(default) DBG | "SATA-14-0"="none"
(default) DBG | "SATA-15-0"="none"
(default) DBG | "SATA-16-0"="none"
(default) DBG | "SATA-17-0"="none"
(default) DBG | "SATA-18-0"="none"
(default) DBG | "SATA-19-0"="none"
(default) DBG | "SATA-20-0"="none"
(default) DBG | "SATA-21-0"="none"
(default) DBG | "SATA-22-0"="none"
(default) DBG | "SATA-23-0"="none"
(default) DBG | "SATA-24-0"="none"
(default) DBG | "SATA-25-0"="none"
(default) DBG | "SATA-26-0"="none"
(default) DBG | "SATA-27-0"="none"
(default) DBG | "SATA-28-0"="none"
(default) DBG | "SATA-29-0"="none"
(default) DBG | natnet1="nat"
(default) DBG | macaddress1="080027BB37F9"
(default) DBG | cableconnected1="on"
(default) DBG | nic1="nat"
(default) DBG | nictype1="82540EM"
(default) DBG | nicspeed1="0"
(default) DBG | mtu="0"
(default) DBG | sockSnd="64"
(default) DBG | sockRcv="64"
(default) DBG | tcpWndSnd="64"
(default) DBG | tcpWndRcv="64"
(default) DBG | Forwarding(0)="ssh,tcp,127.0.0.1,64622,,22"
(default) DBG | hostonlyadapter2="vboxnet1"
(default) DBG | macaddress2="0800274BF595"
(default) DBG | cableconnected2="on"
(default) DBG | nic2="hostonly"
(default) DBG | nictype2="82540EM"
(default) DBG | nicspeed2="0"
(default) DBG | nic3="none"
(default) DBG | nic4="none"
(default) DBG | nic5="none"
(default) DBG | nic6="none"
(default) DBG | nic7="none"
(default) DBG | nic8="none"
(default) DBG | hidpointing="ps2mouse"
(default) DBG | hidkeyboard="ps2kbd"
(default) DBG | uart1="off"
(default) DBG | uart2="off"
(default) DBG | lpt1="off"
(default) DBG | lpt2="off"
(default) DBG | audio="none"
(default) DBG | clipboard="disabled"
(default) DBG | draganddrop="disabled"
(default) DBG | SessionName="headless"
(default) DBG | VideoMode="720,400,0"@0,0 1
(default) DBG | vrde="off"
(default) DBG | usb="off"
(default) DBG | ehci="off"
(default) DBG | xhci="off"
(default) DBG | SharedFolderNameMachineMapping1="Users"
(default) DBG | SharedFolderPathMachineMapping1="/Users"
(default) DBG | VRDEActiveConnection="off"
(default) DBG | VRDEClients=0
(default) DBG | vcpenabled="off"
(default) DBG | vcpscreens=0
(default) DBG | vcpfile="/Users/stefancruz/.docker/machine/machines/default/default/default.webm"
(default) DBG | vcpwidth=1024
(default) DBG | vcpheight=768
(default) DBG | vcprate=512
(default) DBG | vcpfps=25
(default) DBG | GuestMemoryBalloon=0
(default) DBG | GuestOSType="Linux26_64"
(default) DBG | GuestAdditionsRunLevel=2
(default) DBG | GuestAdditionsVersion="5.0.10 r104061"
(default) DBG | GuestAdditionsFacility_VirtualBox Base Driver=50,1451938979637
(default) DBG | GuestAdditionsFacility_VirtualBox System Service=50,1451938987285
(default) DBG | GuestAdditionsFacility_Seamless Mode=0,1451938979637
(default) DBG | GuestAdditionsFacility_Graphics Mode=0,1451938979637
(default) DBG | }
(default) DBG | STDERR:
(default) DBG | {
(default) DBG | }
(default) DBG | Using SSH client type: external
(default) DBG | About to run SSH command:
(default) DBG | ip addr show dev eth1
(default) DBG | SSH cmd err, output: exit status 255: Warning: Identity file machines/default/id_rsa not accessible: No such file or directory.
(default) DBG |
Error checking TLS connection: Error getting driver URL: Something went wrong running an SSH command!
command : ip addr show dev eth1
err     : exit status 255
output  : Warning: Identity file machines/default/id_rsa not accessible: No such file or directory.

Most helpful comment

I had the same issue with my Docker-Toolbox on Windows 7. I'm using docker in combination with VirtualBox.

Docker version

Client:
 Version:       18.03.0-ce
 API version:   1.35 (downgraded from 1.37)
 Go version:    go1.9.4
 Git commit:    0520e24302
 Built: Fri Mar 23 08:31:36 2018
 OS/Arch:       windows/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      17.12.1-ce
  API version:  1.35 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   7390fc6
  Built:        Tue Feb 27 22:20:43 2018
  OS/Arch:      linux/amd64
  Experimental: false

Error cause

It was a missing port forwarding rule in VirtualBox which I removed accidentally

Fix

This steps fixed this issue for me:

  1. In VirtualBox manager go to your docker machine "default"
  2. Go to network settings / network adapter / advanced / port forwarding
  3. Add new port forwarding rule for SSH connection
  4. (host_port:guest_port) -> 49591 : 22
  5. You will get the right host_port if you run this command docker-machine ssh default -v

All 34 comments

Your config file seems like it's gone sideways. My recommendation would be to upgrade to Machine 0.5.5, destroy and re-create the machine. If that doesn't work please re-open. Thanks!

i have same issues, is there any solution that i don't have to delete the machine because i use it in production.

@particle4dev What's the (sanitized output -- make sure not no API keys are present) of docker-machine inspect mcn?

OK, there seems to be something that went sideways in a migration. That bit above where it says "StorePath": "" in the Driver object, if you edit the config.json and change it to "StorePath": "/home/dir/.docker/machine" (naturally, change /home/dir to your actual home directory), does it start working?

Works like a charm. Thank you so much :). It seems like when i open kitematic app, it overwrite config files.

You're welcome @particle4dev ! KM shouldn't re-write config files (especially for non-default machines) but it could potentially be a bug.

Hi @nathanleclaire , I am having a similar issue. Should I destroy and re-create the machine?

Error getting IP address: Something went wrong running an SSH command!
command : ip addr show dev eth1
err : exit status 255
output :
docker is configured to use the default machine with IP
For help getting started, check out the docs at https://docs.docker.com

Here is the output for
$ docker-machine inspect default
{
"ConfigVersion": 3,
"Driver": {
"VBoxManager": {},
"IPAddress": "192.168.99.100",
"MachineName": "default",
"SSHUser": "docker",
"SSHPort": 62645,
"SSHKeyPath": "/Users/Christian/.docker/machine/machines/default/id_rsa",
"StorePath": "/Users/Christian/.docker/machine",
"SwarmMaster": false,
"SwarmHost": "tcp://0.0.0.0:3376",
"SwarmDiscovery": "",
"CPU": 1,
"Memory": 2048,
"DiskSize": 204800,
"Boot2DockerURL": "",
"Boot2DockerImportVM": "",
"HostDNSResolver": false,
"HostOnlyCIDR": "192.168.99.1/24",
"HostOnlyNicType": "82540EM",
"HostOnlyPromiscMode": "deny",
"NoShare": false,
"DNSProxy": false,
"NoVTXCheck": false
},
"DriverName": "virtualbox",
"HostOptions": {
"Driver": "",
"Memory": 0,
"Disk": 0,
"EngineOptions": {
"ArbitraryFlags": [],
"Dns": null,
"GraphDir": "",
"Env": [],
"Ipv6": false,
"InsecureRegistry": [],
"Labels": [],
"LogLevel": "",
"StorageDriver": "",
"SelinuxEnabled": false,
"TlsVerify": true,
"RegistryMirror": [],
"InstallURL": "https://get.docker.com"
},
"SwarmOptions": {
"IsSwarm": false,
"Address": "",
"Discovery": "",
"Master": false,
"Host": "tcp://0.0.0.0:3376",
"Image": "swarm:latest",
"Strategy": "spread",
"Heartbeat": 0,
"Overcommit": 0,
"ArbitraryFlags": [],
"Env": null
},
"AuthOptions": {
"CertDir": "/Users/Christian/.docker/machine/certs",
"CaCertPath": "/Users/Christian/.docker/machine/certs/ca.pem",
"CaPrivateKeyPath": "/Users/Christian/.docker/machine/certs/ca-key.pem",
"CaCertRemotePath": "",
"ServerCertPath": "/Users/Christian/.docker/machine/machines/default/server.pem",
"ServerKeyPath": "/Users/Christian/.docker/machine/machines/default/server-key.pem",
"ClientKeyPath": "/Users/Christian/.docker/machine/certs/key.pem",
"ServerCertRemotePath": "",
"ServerKeyRemotePath": "",
"ClientCertPath": "/Users/Christian/.docker/machine/certs/cert.pem",
"ServerCertSANs": [],
"StorePath": "/Users/Christian/.docker/machine/machines/default"
}
},
"Name": "default"
}

I am having a similar issue. Should I destroy and re-create the machine?

If you can, that is the simplest solution.

It worked!! awesome thanks @nathanleclaire

:+1:

this happened to me twice today with docker-machine version 0.6.0, build e27fb87.
i didn't investigate the 1st incidence (just created a new machine), but 2nd time was too much.
something had overwritten the config.json without

        "SSHKeyPath": "/Users/me/.docker/machine/machines/mymac/id_rsa",
        "StorePath": "/Users/me/.docker/machine",

i added those back to the config and everything seems to be running fine again.

so, to me this sounds like a bug.

same here. pretty annoying.
docker-machine version 0.6.0, build e27fb87

The problem persists, even after updating Docker Machine. I'm thinking maybe we should reopen this one.

I had the problem too today. As it turned out that I had two different docker-machine versions in place (one was called by a bash script which had an old docker-machine version in the path) and the old one always was overwriting the confif file whenever docker-machine ip [NAME] was used.

@nathanleclaire - Sounds like this is definitely a bug, any plan to reopen this issue?

@gregory Can you provide an end-to-end dupe? Does the issue happen with newly created machines as well?

It's pretty easy to reproduce:

  • Using docker machine 0.6.0: docker-machine create -d virtualbox test
  • Using docker machine 0.4.2: docker-machine ls
  • Using docker machine 0.6.0: docker-machine ls
  • Output:
NAME      ACTIVE   DRIVER       STATE     URL   SWARM   DOCKER    ERRORS
test   -        virtualbox   Running                 Unknown   Something went wrong running an SSH command!
command : ip addr show dev eth1
err     : exit status 255
output  : Warning: Identity file machines/test/id_rsa not accessible: No such file or directory.

Thanks @recht -- Unfortunately 0.4.2 isn't forwards compatible and running docker-machine 0.4.2 commands after creating with 0.6.0 is destructive to the configuration file format. The recommendation is to always use the latest version of Docker Machine.

https://github.com/docker/machine/blob/master/libmachine/host/migrate.go#L65 was introduced to prevent using older Machine versions it but 0.4.2 did not contain this fix.

This happened to me right after changing the configuration of my VM's networking from NAT to Bridged. I don't see a SSHKeyPath variable (mentioned above by @t0v).

$ docker-machine inspect default
{
    "ConfigVersion": 3,
    "Driver": {
        "VBoxManager": {},
        "IPAddress": "",
        "SSHUser": "docker",
        "SSHPort": 65275,
        "MachineName": "default",
        "SwarmMaster": false,
        "SwarmHost": "tcp://0.0.0.0:3376",
        "SwarmDiscovery": "",
        "StorePath": "/Users/john/.docker/machine",
        "CPU": 1,
        "Memory": 1024,
        "DiskSize": 20000,
        "Boot2DockerURL": "",
        "Boot2DockerImportVM": "",
        "HostOnlyCIDR": "192.168.99.1/24",
        "HostOnlyNicType": "82540EM",
        "HostOnlyPromiscMode": "deny",
        "NoShare": false
    },
    "DriverName": "virtualbox",
    "HostOptions": {
        "Driver": "",
        "Memory": 0,
        "Disk": 0,
        "EngineOptions": {
            "ArbitraryFlags": [],
            "Dns": null,
            "GraphDir": "",
            "Env": [],
            "Ipv6": false,
            "InsecureRegistry": [],
            "Labels": [],
            "LogLevel": "",
            "StorageDriver": "",
            "SelinuxEnabled": false,
            "TlsVerify": true,
            "RegistryMirror": [],
            "InstallURL": "https://get.docker.com"
        },
        "SwarmOptions": {
            "IsSwarm": false,
            "Address": "",
            "Discovery": "",
            "Master": false,
            "Host": "tcp://0.0.0.0:3376",
            "Image": "swarm:latest",
            "Strategy": "spread",
            "Heartbeat": 0,
            "Overcommit": 0,
            "ArbitraryFlags": []
        },
        "AuthOptions": {
            "CertDir": "/Users/john/.docker/machine/certs",
            "CaCertPath": "/Users/john/.docker/machine/certs/ca.pem",
            "CaPrivateKeyPath": "/Users/john/.docker/machine/certs/ca-key.pem",
            "CaCertRemotePath": "",
            "ServerCertPath": "/Users/john/.docker/machine/machines/default/server.pem",
            "ServerKeyPath": "/Users/john/.docker/machine/machines/default/server-key.pem",
            "ClientKeyPath": "/Users/john/.docker/machine/certs/key.pem",
            "ServerCertRemotePath": "",
            "ServerKeyRemotePath": "",
            "ClientCertPath": "/Users/john/.docker/machine/certs/cert.pem",
            "StorePath": "/Users/john/.docker/machine/machines/default"
        }
    },
    "Name": "default",
    "RawDriver": "eyJWQm94TWFuYWdlciI6e30sIklQQWRkcmVzcyI6IiIsIlNTSFVzZXIiOiJkb2NrZXIiLCJTU0hQb3J0Ijo2NTI3NSwiTWFjaGluZU5hbWUiOiJkZWZhdWx0IiwiU3dhcm1NYXN0ZXIiOmZhbHNlLCJTd2FybUhvc3QiOiJ0Y3A6Ly8wLjAuMC4wOjMzNzYiLCJTd2FybURpc2NvdmVyeSI6IiIsIlN0b3JlUGF0aCI6Ii9Vc2Vycy9qb2huLy5kb2NrZXIvbWFjaGluZSIsIkNQVSI6MSwiTWVtb3J5IjoxMDI0LCJEaXNrU2l6ZSI6MjAwMDAsIkJvb3QyRG9ja2VyVVJMIjoiIiwiQm9vdDJEb2NrZXJJbXBvcnRWTSI6IiIsIkhvc3RPbmx5Q0lEUiI6IjE5Mi4xNjguOTkuMS8yNCIsIkhvc3RPbmx5TmljVHlwZSI6IjgyNTQwRU0iLCJIb3N0T25seVByb21pc2NNb2RlIjoiZGVueSIsIk5vU2hhcmUiOmZhbHNlfQ=="
}

The weird thing is, I can still docker-machine start default and it'll bring it up, however, it won't connect. And I've had to hard-code the environment settings.

Should I change the networking back to NAT?

EDIT:

$ docker-machine --version
docker-machine version 0.5.0 (04cfa58)

WOW! Just WOW! So this is why I am having problems with my Docker Machines. Thanks.

Had same problem, but turns out editing ~/.docker/machine/machines/default/config.json while machine is running wasn't working. I stopped everything, made sure everything was right and now my config it being loaded.

My SSHKeyPath was empty too, Now I'm getting a worst output

bash --login '/Applications/Docker/Docker Quickstart Terminal.app/Contents/Resources/Scripts/start.sh'
Machine default already exists in VirtualBox.
Starting machine default...
Starting "default"...
(default) Check network to re-create if needed...
Checking if hardware virtualization is enabled failed: open machines/default/default/Logs/VBox.log: no such file or directory
Setting environment variables for machine default...


                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/


Error getting IP address: Something went wrong running an SSH command!
command : ip addr show dev eth1
err     : exit status 255
output  :
docker is configured to use the default machine with IP
For help getting started, check out the docs at https://docs.docker.com

Error checking TLS connection: Something went wrong running an SSH command!
command : ip addr show dev eth1
err     : exit status 255
output  :

Still getting this error, but at least,

docker-machine ssh default -v

works

docker-machine ssh default -v
OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /Users/gableroux/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 61570.
debug1: fd 3 clearing O_NONBLOCK
debug1: Connection established.
debug1: identity file /Users/gableroux/.docker/machine/machines/default/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/gableroux/.docker/machine/machines/default/id_rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.4
debug1: match: OpenSSH_6.4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 127.0.0.1:61570 as 'docker'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] none
debug1: kex: client->server aes128-ctr [email protected] none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:RQd9H//qlGggTJ/aWW7MGWpX4rkL7x0AGqbqyC67aVk
debug1: checking without port identifier
Warning: Permanently added '[127.0.0.1]:61570' (ECDSA) to the list of known hosts.
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/gableroux/.docker/machine/machines/default/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to 127.0.0.1 ([127.0.0.1]:61570).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = fr_CA.UTF-8
debug1: Sending env LC_CTYPE = fr_CA.UTF-8
                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/
 _                 _   ____     _            _
| |__   ___   ___ | |_|___ \ __| | ___   ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__|   <  __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.9.1, build master : cef800b - Fri Nov 20 19:33:59 UTC 2015
Docker version 1.9.1, build a34a1d5
docker@default:~$ ip addr show dev eth1
4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:d4:a4:c0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.99.100/24 brd 192.168.99.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fed4:a4c0/64 scope link
       valid_lft forever preferred_lft forever

I don't know what's causing this exit status 255.

docker-machine inspect default
{
    "ConfigVersion": 3,
    "Driver": {
        "IPAddress": "192.168.99.100",
        "MachineName": "default",
        "SSHUser": "docker",
        "SSHPort": 61570,
        "SSHKeyPath": "/Users/gableroux/.docker/machine/machines/default/id_rsa",
        "StorePath": "",
        "SwarmMaster": false,
        "SwarmHost": "tcp://0.0.0.0:3376",
        "SwarmDiscovery": "",
        "VBoxManager": {},
        "CPU": 1,
        "Memory": 1024,
        "DiskSize": 20000,
        "Boot2DockerURL": "",
        "Boot2DockerImportVM": "",
        "HostDNSResolver": false,
        "HostOnlyCIDR": "192.168.99.1/24",
        "HostOnlyNicType": "82540EM",
        "HostOnlyPromiscMode": "deny",
        "NoShare": false,
        "DNSProxy": false,
        "NoVTXCheck": false
    },
    "DriverName": "virtualbox",
    "HostOptions": {
        "Driver": "",
        "Memory": 0,
        "Disk": 0,
        "EngineOptions": {
            "ArbitraryFlags": [],
            "Dns": null,
            "GraphDir": "",
            "Env": [],
            "Ipv6": false,
            "InsecureRegistry": [],
            "Labels": [],
            "LogLevel": "",
            "StorageDriver": "",
            "SelinuxEnabled": false,
            "TlsVerify": true,
            "RegistryMirror": [],
            "InstallURL": "https://get.docker.com"
        },
        "SwarmOptions": {
            "IsSwarm": false,
            "Address": "",
            "Discovery": "",
            "Master": false,
            "Host": "tcp://0.0.0.0:3376",
            "Image": "swarm:latest",
            "Strategy": "spread",
            "Heartbeat": 0,
            "Overcommit": 0,
            "ArbitraryFlags": [],
            "Env": null
        },
        "AuthOptions": {
            "CertDir": "/Users/gableroux/.docker/machine/certs",
            "CaCertPath": "/Users/gableroux/.docker/machine/certs/ca.pem",
            "CaPrivateKeyPath": "/Users/gableroux/.docker/machine/certs/ca-key.pem",
            "CaCertRemotePath": "",
            "ServerCertPath": "/Users/gableroux/.docker/machine/machines/default/server.pem",
            "ServerKeyPath": "/Users/gableroux/.docker/machine/machines/default/server-key.pem",
            "ClientKeyPath": "/Users/gableroux/.docker/machine/certs/key.pem",
            "ServerCertRemotePath": "",
            "ServerKeyRemotePath": "",
            "ClientCertPath": "/Users/gableroux/.docker/machine/certs/cert.pem",
            "ServerCertSANs": null,
            "StorePath": "/Users/gableroux/.docker/machine/machines/default"
        }
    },
    "Name": "default"
}

@GabLeRoux If possible, I'd highly suggest removing the machine and starting over from scratch (make sure to use the latest version of Docker Machine). docker-machine rm -f default && docker-machine create -d virtualbox default

Deleting this vm isn't a solution for me as I've worked on a wordpress container and I still need to figure out how to handle data inside this vm, I don't want to lose this data. At least, I got it working even tough it's complaining with the error I mentioned above. I used Kitematic app and I think kitematic updated the config and broke things.

I am now able to see wordpress but It seems to redirect me to 192.168.99.101 so maybe the machine ip changed for some reason once. I'll try to change my machine ip and see what happens. At least, I'm able to access data now so it should be alright :)

Edit: happened again using Kitematic :(
Looks like kitematic likes to break
~/.docker/machine/machines/default/config.json
It changed to a one liner json after running kitematic. I reverted to the working one, still complaining, but it works.

Getting these same errors when trying to run docker-machine --debug create --driver virtualbox default:

  • Error getting ssh command 'exit 0' : Something went wrong running an SSH command!
  • ERROR getting IP: No IP address found 4: eth1: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
  • Error creating machine: Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.100:2376": dial tcp 192.168.99.100:2376: i/o timeout

More Error Details: https://gist.github.com/richnsoos/8046721ec4f68951d20e

Before running the command, I:

  • added my ssh.exe folder to environment PATH variable
  • removed all VMs from VirtualBox
  • removed all Host Only Networks from the Network settings for VIrtualBox
  • removed all docker machines with docker-machine rm default

To those who might be able to help, here's my setup:

  • windows 7
  • VM VirtualBox 5.0.14
  • docker-machine version 0.6.0, build e27fb87
  • ~\.docker\machine\machines\default\config.json file does include these entries:

"SSHKeyPath": "C:\\Users\\sth787\\.docker\\machine\\machines\\default\\id_rsa", "StorePath": "C:\\Users\\sth787\\.docker\\machine",

These error are repeatable. If I delete the docker-machine and start fresh with same steps, I get the same errors. Thank you in advance!

3/7/16 Update: after re-running the same steps at work, docker was successfully up and running. I guess running these steps at home, through the VPN is what was causing problems. Thank you

This is still an issue with v0.6.0 - even if I try running docker-machine rm -f default && docker-machine create -d virtualbox default ssh tries to connect to 127.0.0.1 and exits with 255.

@jurjevic Did you try 0.7.0?

I got the similar issue.

It is funny that the reason was just a file named ssh.bat in the current directory.
I removed it and everything works now for me!

I have the same error

then I modified config.json : add SSHKeyPath ,SSHPort, It works now.

docker-machine: 0.5.0
VirtualBox: 5.0.28

$ docker-machine create -d virtualbox default
Running pre-create checks...
Creating machine...
(default) Copying D:\Program Files\VirtualBox\cache\boot2docker.iso to D:\Progra
m Files\VirtualBox\machinesdefault\boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
Error creating machine: Error in driver during machine creation: Unable to start
the VM: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe startvm default --typ
e headless failed:
VBoxManage.exe: error: Failed to open/create the internal network 'HostInterface
Networking-VirtualBox Host-Only Ethernet Adapter #2' (VERR_INTNET_FLT_IF_NOT_FOU
ND).
VBoxManage.exe: error: Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_
FOUND)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap,
interface IConsole

Details: 00:00:00.774486 Power up failed (vrc=VERR_INTNET_FLT_IF_NOT_FOUND, rc=E
_FAIL (0X80004005))

I got the same error as below today

Error getting IP address: Something went wrong running an SSH command! command : ip addr show dev eth1 err : exit status 255 output : docker is configured to use the default machine with IP For help getting started, check out the docs at https://docs.docker.com

then i tried docker machine stop and start and it works for me keeping my images intact.

$ docker-machine stop
$ docker-machine start

I had the same issue with my Docker-Toolbox on Windows 7. I'm using docker in combination with VirtualBox.

Docker version

Client:
 Version:       18.03.0-ce
 API version:   1.35 (downgraded from 1.37)
 Go version:    go1.9.4
 Git commit:    0520e24302
 Built: Fri Mar 23 08:31:36 2018
 OS/Arch:       windows/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      17.12.1-ce
  API version:  1.35 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   7390fc6
  Built:        Tue Feb 27 22:20:43 2018
  OS/Arch:      linux/amd64
  Experimental: false

Error cause

It was a missing port forwarding rule in VirtualBox which I removed accidentally

Fix

This steps fixed this issue for me:

  1. In VirtualBox manager go to your docker machine "default"
  2. Go to network settings / network adapter / advanced / port forwarding
  3. Add new port forwarding rule for SSH connection
  4. (host_port:guest_port) -> 49591 : 22
  5. You will get the right host_port if you run this command docker-machine ssh default -v
  1. In VirtualBox manager go to your docker machine "default"
  2. Go to network settings / network adapter / advanced / port forwarding
  3. Add new port forwarding rule for SSH connection
  4. (host_port:guest_port) -> 49591 : 22
  5. You will get the right host_port if you run this command docker-machine ssh default -v

This solved it for me but the -v command showed port 22 so I mapped 22 to 22 in the port forwarding settings.

I'm running Ubuntu 16.04 via virtualbox on a Windows 10 machine. I installed docker and docker-machine using the instructions on the docker get-started site.

$ docker-machine create --virtualbox-no-vtx-check --driver virtualbox myvm1
spawns the exit status 255 despite trying several of the above things.

$ docker-machine ssh myvm1 -v
OpenSSH_7.2p2 Ubuntu-4ubuntu2.6, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /dev/null
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 22.
debug1: fd 3 clearing O_NONBLOCK
debug1: Connection established.
debug1: identity file /home/jeff/.docker/machine/machines/myvm1/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/jeff/.docker/machine/machines/myvm1/id_rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.6
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.6 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 127.0.0.1:22 as 'docker'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: compression: none
debug1: kex: client->server cipher: [email protected] MAC: compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:sq3FVJOcH+JDkeDYJV5cIpv+AGPlfa02q7rJ4pIaCOk
Warning: Permanently added '127.0.0.1' (ECDSA) to the list of known hosts.
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/jeff/.docker/machine/machines/myvm1/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
Permission denied (publickey,password).
exit status 255

OK, there seems to be something that went sideways in a migration. That bit above where it says "StorePath": "" in the Driver object, if you edit the config.json and change it to "StorePath": "/home/dir/.docker/machine" (naturally, change /home/dir to your actual home directory), does it start working?

can you please say how to do it

Was this page helpful?
0 / 5 - 0 ratings