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

转自 https://blog.jongallant.com/2017/11/ssh-into-docker-vm-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 juvenile / 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

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.

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值