How to connect to docker VM (MobyLinux) from a Windows shell?

Is the host login to the VM shell removed, similar to how we can easily log into running bash containers?

docker exec -it bash

I accidentally broke one important container file so that it could not start. Unfortunately, this container stores data internally. The result was that whenever I tried to start it, it could not start. The only solutions I saw concerned navigation for placing docker-docker files. However, I am running docker VM on windows, and I cannot access the files inside the VM (MobyLinuxVM).

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

+12
source share
2 answers

Hack your way in

run the container with full root access to MobyLinuxVM and the seccomp profile (so you can mount the file)

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

+18
source

With email G. In Git Bash, you can use the following command to connect to a running container on Windows:

 winpty docker exec -it [CONTAINER-ID] sh 

You can find [CONTAINER-ID] with:

 docker ps 

But in this way, you cannot connect the VM host (MobyLinuxVM).

0
source

Source: https://habr.com/ru/post/1260525/


All Articles