删除 .vagrant 文件后如何销毁 VM? [英] How do I destroy a VM when I deleted the .vagrant file?
本文介绍了删除 .vagrant 文件后如何销毁 VM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我删除了包含 .vagrant 文件的目录.当我启动一个新的 VM 时,它抱怨端口正在使用中.那么如何在没有 .vagrant 文件的情况下销毁 VM?
I deleted the directory that contained the .vagrant file. When I up a new VM it's complaining about ports being in use. So how do I destroy a VM without having it's .vagrant file?
推荐答案
以下 VirtualBox 命令可能会有所帮助.如果关机不起作用,请尝试 unregistervm.
The following VirtualBox commands might help. If poweroff doesn't work, try unregistervm.
$ VBoxManage list runningvms
$ VBoxManage controlvm <uuid> poweroff
$ VBoxManage unregistervm <uuid>
用于停止所有正在运行的虚拟机的 Shell 脚本:
Shell script to stop all running vms:
VBoxManage list runningvms | awk '{print $2;}' | xargs -I vmid VBoxManage controlvm vmid poweroff
这篇关于删除 .vagrant 文件后如何销毁 VM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文