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)
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
With e. G. the Git Bash you can use the following command to connect to a running container in Windows:
winpty docker exec -it [CONTAINER-ID] sh
You can look up the [CONTAINER-ID] with:
docker ps
But this way you cannot connect to the host VM (MobyLinuxVM).
来源:https://stackoverflow.com/questions/40867501/how-to-connect-to-docker-vm-mobylinux-from-windows-shell