DEV Community

Francisco Navarro
Francisco Navarro

Posted on

Destroy virtualbox machines from command line

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 }}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)