DEV Community

loading...

Destroy virtualbox machines from command line

Francisco Navarro
・1 min read

Here how I destroy virtualbox machines from command line (stop and unregister them)

# name: Check if the machine is running
VBoxManage list runningvms

# Stop the machine
vboxmanage controlvm {{ machine_name }} poweroff soft && sleep 7

# Check if the machine exists
VBoxManage list vms

# Destroy selected machine.
vboxmanage unregistervm --delete {{ machine_name }}

Discussion (0)