How do I destroy a VM when I deleted the .vagrant file?

前端 未结 4 1395
忘掉有多难
忘掉有多难 2021-01-29 23:14

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 f

4条回答
  •  长情又很酷
    2021-01-30 00:13

    The following VirtualBox commands might help. If poweroff doesn't work, try unregistervm.

    $ VBoxManage list runningvms
    $ VBoxManage controlvm  poweroff
    $ VBoxManage unregistervm 
    

    Source: https://support.cloud.engineyard.com/entries/21449637-I-deleted-Vagrantfile-vagrant-and-or-the-app-directory-before-halting-the-VM-Now-ey-local-up-errors-

    Shell script to stop all running vms:

    VBoxManage list runningvms | awk '{print $2;}' | xargs -I vmid VBoxManage controlvm vmid poweroff
    

提交回复
热议问题