求指导, vagrant 命令必须加虚拟机 ID 怎么破?

2017-07-30 08:10:56 +08:00
 lightryanking

vagrant lavarel 环境终于搭建好了,比如我想关闭虚拟机,直接 vagrant halt 不行,得 vagrant halt [ID]才可以!

$ vagrant halt

A Vagrant environment or target machine is required to run this command. Run vagrant init to create a new Vagrant environment. Or, get an ID of a target machine from vagrant global-status to run this command on. A final option is to change to a directory with a Vagrantfile and to try again.

$ vagrant halt e8a5aea

==> homestead-7: Attempting graceful shutdown of VM...

明明只有一个虚拟机啊,怎样设置才可以不用加 ID,每个命令都要加 ID 太麻烦了!

5447 次点击
所在节点    Vagrant
4 条回复
ifoolish
2017-07-30 09:07:25 +08:00
我看你的命令行提示符为$。vagrant 命令要在 vagrantfile 目录执行
precisi0nux
2017-07-30 09:41:29 +08:00
lightryanking
2017-07-30 14:34:25 +08:00
@ifoolish 你是对的。。。Homestead 没打开,打开就可以了
lightryanking
2017-07-30 14:34:46 +08:00
@precisi0nux 谢谢!这个也可以

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/378950

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX