How to ssh into docker-machine VirtualBox instance?

Roy Truelove picture Roy Truelove · May 19, 2015 · Viewed 72.3k times · Source

docker-machine version 0.2.0 docker version 1.6.2

I'm using docker-machine to create a machine using VirtualBox. Everything works fine but I'd like to ssh into the machine itself and I find no instructions on how to do this. I can connect to the ssh port:

ssh $(docker-machine ip dev)

But I've no idea what username / password / identity file to use.

Answer

Adrian Mouat picture Adrian Mouat · May 19, 2015

You can log into docker-machine hosts by just running

docker-machine ssh default

(Using the "default" host here)

The identity files should be stored under ~/.docker/machine/machines. If you want to log into a container (as opposed to the host), use docker exec as suggested by user2915097.