Vagrant服务启动出现 listing for any “ruby“ or “vagrant“ processes and kill them. Then try again. 的解决办法

问题概述

环境:

vagrant_2.2.19_x86_64

VirtualBox-6.1.48-159471-Win

博主在使用 Oracle VM VirtualBox +  + vagrant 实现本地虚拟机的管理,这个都是开源的,还是比较好用,

但是在使用时,遇到了一个计算机进程问题,

通过 “ vagrant up ”,“ vagrant reload ”指令重启vagrant虚拟机时,出现“ If you believe this message is in error, please check the process listing for any "ruby" or "vagrant" processes and kill them. Then
try again.

具体错误信息如下:

Bringing machine 'default' up with 'virtualbox' provider...
An action 'up' was attempted on the machine 'default',
but another process is already executing an action on the machine.
Vagrant locks each machine for access by only one process at a time.
Please wait until the other Vagrant process finishes modifying this
machine, then try again.

If you believe this message is in error, please check the process
listing for any "ruby" or "vagrant" processes and kill them. Then
try again.

如下图:

解决办法

根据错误信息可得知:

正在使用“virtualbox”提供程序启动计算机“default”。。。
试图在计算机“default”上执行操作“up”,
但是另一个进程已经在该计算机上执行动作。
Vagrant每次只锁定一个进程访问每台机器。
请等待其他Vagrant进程完成对此计算机的修改,然后重试。

如果您认为此消息有误,请检查进程
列出任何 “ ruby ” 或 “ vagrant ”进程并kill它们。然后再试一次。

所以,在windows中找出ruby和vagrant的进程关闭掉即可,

第一步:关闭ruby进程

这里博主通过Windows管理工具“ wmic ”来实现,

首先,查看ruby的所有进程,

输入指令:“ process where name="ruby.exe" list full ”

如果存在ruby的进程

如下图:

关闭ruby进程,

输入指令:“ process where name="ruby.exe" call terminate ”,

进程关闭后,会提示指令执行成功,如下图:

第二部,关闭vagrant进程

同上面操作一致,

查看vagrant进程,

输入指令: “ process where name="vagrant.exe" list full ”

关闭vagrant进程,

输入指令:“ process where name="vagrant.exe" call terminate ”

第三步,再次up或reload vagrant服务,

输入指令:“ vagrant reload ”,

即可成功的重启vagrant服务了,

如下图:

ps:什么是wmic ?

WMIC是扩展WMI(Windows Management Instrumentation,Windows管理规范),提供了从命令行接口和批命令脚本执行系统管理的支持。在WMIC出现之前,如果要管理WMI系统,必须使用一些专门的WMI应用,比如SMS,或者使用WMI的脚本编程API,或者使用象CIM Studio之类的工具。如果不熟悉C++之类的 编程语言或VBScript之类的 脚本语言,或者不掌握WMI 名称空间的基本知识,要使用WMI管理系统是很困难的。WMIC改变了这种情况,为WMI 名称空间提供了一个强大的、友好的命令行接口。


好了,关于 Vagrant服务启动出现 listing for any "ruby" or "vagrant" processes and kill them. Then try again. 的解决办法  就写到这儿了,如果还有什么疑问或遇到什么问题欢迎扫码提问,也可以给我留言哦,我会一一详细的解答的。 
歇后语:“ 共同学习,共同进步 ”,也希望大家多多关注CSND的IT社区。


作       者:华    仔
联系作者:who.seek.me@java98k.vip
来        源:CSDN (Chinese Software Developer Network)
原        文:https://blog.csdn.net/Hello_World_QWP/article/details/135244378
版权声明:本文为博主原创文章,请在转载时务必注明博文出处!
  • 23
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值