How to access the docker VM (MobyLinux) filesystem from windows shell?

Łukasz Podolak picture Łukasz Podolak · Nov 29, 2016 · Viewed 13.1k times · Source

Is there away to log into host VM's shell, similarly to how can we easily enter into running containers bash?

docker exec -it bash

I accidentally broke one container's crucial file, so that it couldn't start. Unfortunately, that container stored it's data inside. The result was that whenever I tried to run it, it couldn't start. The only solutions I saw were about navigating to host docker daemon's files. However, I'm running docker VM on windows, and I cannot access the files inside VM (MobyLinuxVM).

I'm using Docker for Windows, version 1.12.3-beta30.1 (8711)

Answer

KCD picture KCD · Mar 31, 2017

Hack your way in

run a container with full root access to MobyLinuxVM and no seccomp profile (so you can mount stuff)

docker run --net=host --ipc=host --uts=host --pid=host -it --security-opt=seccomp=unconfined --privileged --rm -v /:/host alpine /bin/sh

https://forums.docker.com/t/how-can-i-ssh-into-the-betas-mobylinuxvm/10991/6