如何访问由Docker的HyperKit创建的VM? [英] How to access the VM created by docker's HyperKit?
问题描述
适用于Mac的Docker 使用由
Docker for Mac uses a Linux VM created by HyperKit for storing and running containers on Mac.
使用Docker Toolbox,我可以打开VirtualBox并访问docker-machine VM.但是使用Docker for Mac,如何访问HyperKit创建的VM?
With Docker Toolbox, I can just open VirtualBox and access the docker-machine VM. But with Docker for Mac, how do I access the VM created by HyperKit?
推荐答案
更新2019-01-31 ,感谢ru10的更新,现在有了更好的方法:
Update 2019-01-31, thanks to ru10's update, now there is a better way:
screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
原始答案:
过了一会儿,我发现了以下方法来获取由HyperKit创建的VM的外壳:
After a while, I found following way to get a shell of the VM that was created by HyperKit:
从终端运行:
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
您将看到一个空白屏幕,然后键入Enter,您将得到一个登录提示.以,您将获得该shell:root
身份登录并按Enter,您将获得一个shell(无密码)
You will see an empty screen, then type enter, you will get a login prompt. Login as , you will gett the shell:root
and hit enter, you will get a shell (no password)
要退出会话,请键入Ctrl-A k
(然后单击y
确认).
To exit the session, type Ctrl-A k
(then y
to confirm).
这有点棘手,但目前看来可以使用(2016年9月)(2017年9月).
It is a little bit hacky, but it seems to work for now (Sep 2016) (Sep 2017).
这篇关于如何访问由Docker的HyperKit创建的VM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!