Virtual Box – 通过 CLI 删除 VM
     发布在:Others      浏览:2      评论:0 条评论

使用终端命令行工具创建 Virtual Box 的时候,出现了如下的错误:

Bringing machine 'mhi' up with 'virtualbox' provider...
==> mhi: Cloning VM...
==> mhi: Matching MAC address for NAT networking...
==> mhi: Checking if box 'geerlingguy/ubuntu1604' version '1.2.6' is up to date...
A VirtualBox machine with the name 'local.mhi.com' already exists.
Please use another name or delete the machine with the existing
name, and try again.

这是因为已经存在名为 mhi 的 VM 了,无法再创建

需要将原来的 VM 删除

> vboxmanage list vms
"vm_name" {0000000-0000000-00000-0000}

# 若 VM 处于运行状态,先关机
> vboxmanage controlvm 0000000-0000000-00000-0000 powerof

# 删除 VM
> vboxmanage unregistervm 0000000-0000000-00000-0000 --delete
    Responses