分类
未分类

How to SSH into the Docker VM (MobyLinuxVM) on Windows

On Windows, Docker runs in a VM called MobyLinuxVM, but you cannot login to that VM via Hyper-V Manager. We aren’t technically going to SSH into the VM, we’ll create a container that has full root access and then access the file system from there.

  1. Get container with access to Docker Daemon
  2. Run container with full root access
  3. Switch to host file system

Open a Command prompt and execute the following:

docker run –privileged -it -v /var/run/docker.sock:/var/run/docker.sock jongallant/ubuntu-docker-client
docker run –net=host –ipc=host –uts=host –pid=host -it –security-opt=seccomp=unconfined –privileged –rm -v /:/host alpine /bin/sh
chroot /host

view rawssh-info-docker-vm-windows.sh hosted with ❤ by GitHub

You can then execute whatever commands you need to execute.

This code was found on the Docker forums here, thanks to Manuel Patrone for posting it.

摘自:https://blog.jongallant.com/2017/11/ssh-into-docker-vm-windows/

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注