Docker Community Forums

Share and learn in the Docker community.

Problem when I create a docker-machine on Debian 8

docker

(Weysan) #1

Hi everyone,

I have a problem when I’m creating a docker-machine on my Debian 8 server.

When I’m running :

docker-machine -D create --driver virtualbox test

I have that error :

STDOUT: Waiting for VM "test" to power on...
VM "test" has been successfully started.

STDERR:
Starting VM...
Getting to WaitForSSH function...
Testing TCP connection to: localhost:60640
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/test/id_rsa -p 60640 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:60640
Using SSH client type: external
About to run SSH command:
exit 0

When I’m trying to list my docker machine I have that :

$ docker-machine ls
error getting URL for host test: exit status 255
error getting URL for host test: exit status 255
error determining if host is active for host test: exit status 255
NAME   ACTIVE   DRIVER       STATE     URL   SWARM
test            virtualbox   Running

I’m running :

$ VBoxManage -v
5.0.6r103037

$ docker -v
Docker version 1.8.2, build 0a8c2e3

$ docker-machine -v
docker-machine version 0.4.1 (e2c88d6)

(Ralph Kincade) #2

this is interesting , is there any other errors , it seem that it did build
the “test” docker host that you wanted it to

can you ssh into the “test” docker host?


(Weysan) #3

No, I can’t :

$ docker-machine -D ssh test
executing: /usr/bin/VBoxManage showvminfo test --machinereadable
STDOUT: name="test"
groups="/"
ostype="Linux 2.6 / 3.x / 4.x (64-bit)"
UUID="4aeaf126-35b0-41dc-9cda-798bf0d36add"
CfgFile="/root/.docker/machine/machines/test/test/test.vbox"
SnapFldr="/root/.docker/machine/machines/test/test/Snapshots"
LogFldr="/root/.docker/machine/machines/test/test/Logs"
hardwareuuid="4aeaf126-35b0-41dc-9cda-798bf0d36add"
memory=1024
pagefusion="off"
vram=8
cpuexecutioncap=100
hpet="on"
chipset="piix3"
firmware="BIOS"
cpus=1
pae="on"
longmode="on"
cpuid-portability-level=0
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"
paravirtprovider="default"
VMState="running"
VMStateChangeTime="2015-10-09T07:21:52.012000000"
monitorcount=1
accelerate3d="off"
accelerate2dvideo="off"
teleporterenabled="off"
teleporterport=0
teleporteraddress=""
teleporterpassword=""
tracing-enabled="off"
tracing-allow-vm-access="off"
tracing-config=""
autostart-enabled="off"
autostart-delay=0
defaultfrontend=""
storagecontrollername0="SATA"
storagecontrollertype0="IntelAhci"
storagecontrollerinstance0="0"
storagecontrollermaxportcount0="30"
storagecontrollerportcount0="30"
storagecontrollerbootable0="on"
"SATA-0-0"="/root/.docker/machine/machines/test/boot2docker.iso"
"SATA-ImageUUID-0-0"="251dc335-0131-49dd-8e4b-383f4b4c2593"
"SATA-tempeject"="off"
"SATA-IsEjected"="off"
"SATA-1-0"="/root/.docker/machine/machines/test/disk.vmdk"
"SATA-ImageUUID-1-0"="db9ac07c-4502-443f-ad90-4dfd071dbac1"
"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="08002793454A"
cableconnected1="on"
nic1="nat"
nictype1="82540EM"
nicspeed1="0"
mtu="0"
sockSnd="64"
sockRcv="64"
tcpWndSnd="64"
tcpWndRcv="64"
Forwarding(0)="ssh,tcp,127.0.0.1,39711,,22"
hostonlyadapter2="vboxnet0"
macaddress2="080027ED2409"
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"
SessionName="headless"
VideoMode="720,400,0"@0,0 1
vrde="off"
usb="off"
ehci="off"
xhci="off"
VRDEActiveConnection="off"
VRDEClients=0
vcpenabled="off"
vcpscreens=0
vcpfile="/root/.docker/machine/machines/test/test/test.webm"
vcpwidth=1024
vcpheight=768
vcprate=512
vcpfps=25
GuestMemoryBalloon=0
GuestOSType="Linux26_64"
GuestAdditionsRunLevel=0

STDERR:
Using SSH client type: external
&{/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/tes                                                                                                                                t/id_rsa -p 22 docker@localhost] []  <nil> <nil> <nil> [] <nil> <nil> <nil> <nil                                                                                                                                > false [] [] [] [] <nil>}
exit status 255

(Ranjandas) #4

Hi,

Are you sure you have SSH client installed in your machine?

Regards


(Weysan) #5

Hi ranjandas,

an SSH client is installed on my machine :

$ ssh -V
OpenSSH_6.7p1 Debian-5, OpenSSL 1.0.1k 8 Jan 2015

Regards


(Weysan) #6

Maybe this can help :

$ docker-machine inspect test
{
    "ConfigVersion": 1,
    "Driver": {
        "IPAddress": "",
        "SSHUser": "docker",
        "SSHPort": 0,
        "MachineName": "test",
        "CaCertPath": "/root/.docker/machine/certs/ca.pem",
        "PrivateKeyPath": "/root/.docker/machine/certs/ca-key.pem",
        "SwarmMaster": false,
        "SwarmHost": "tcp://0.0.0.0:3376",
        "SwarmDiscovery": "",
        "CPU": 1,
        "Memory": 1024,
        "DiskSize": 20000,
        "Boot2DockerURL": "",
        "Boot2DockerImportVM": "",
        "HostOnlyCIDR": "192.168.99.1/24"
    },
    "DriverName": "virtualbox",
    "HostOptions": {
        "Driver": "",
        "Memory": 0,
        "Disk": 0,
        "EngineOptions": {
            "ArbitraryFlags": [],
            "Dns": null,
            "GraphDir": "",
            "Env": [],
            "Ipv6": false,
            "InsecureRegistry": [],
            "Labels": [],
            "LogLevel": "",
            "StorageDriver": "",
            "SelinuxEnabled": false,
            "TlsCaCert": "",
            "TlsCert": "",
            "TlsKey": "",
            "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,
            "TlsCaCert": "",
            "TlsCert": "",
            "TlsKey": "",
            "TlsVerify": false,
            "ArbitraryFlags": []
        },
        "AuthOptions": {
            "StorePath": "",
            "CaCertPath": "/root/.docker/machine/certs/ca.pem",
            "CaCertRemotePath": "",
            "ServerCertPath": "/root/.docker/machine/machines/test/server.pem",
            "ServerKeyPath": "/root/.docker/machine/machines/test/server-key.pem",
            "ClientKeyPath": "/root/.docker/machine/certs/key.pem",
            "ServerCertRemotePath": "",
            "ServerKeyRemotePath": "",
            "PrivateKeyPath": "/root/.docker/machine/certs/ca-key.pem",
            "ClientCertPath": "/root/.docker/machine/certs/cert.pem"
        }
    },
    "StorePath": "/root/.docker/machine/machines/test"
}

(Weysan) #7

Okay Guys,
I found something…

the config.json have a wrong SSHPort and My SSH client tried to connect and return an error.

My solution :

vi /root/.docker/machine/machines/test/config.json

And add the SSH port for example :

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/test/id_rsa -p 60640 docker@localhost

I have to put in the config.json :

"SSHPort":60640

But I have the same error every time I create a docker-machine. I have to do the same thing. After that, I can connect to my machine with :

docker-machine ssh test