Skip to content

Instantly share code, notes, and snippets.

@obazoud
Last active December 12, 2015 04:28
Show Gist options
  • Select an option

  • Save obazoud/4714614 to your computer and use it in GitHub Desktop.

Select an option

Save obazoud/4714614 to your computer and use it in GitHub Desktop.

Revisions

  1. obazoud revised this gist Feb 5, 2013. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion vm-clean.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,9 @@
    #!/bin/bash

    for vm in `VBoxManage list runningvms | awk '{ print $1 }' | sed "s/\"//g"`; do
    VBoxManage controlvm "$vm" poweroff
    done

    for vm in `VBoxManage list vms | awk '{ print $1 }' | sed "s/\"//g"`; do
    VBoxManage unregistervm --delete $vm
    VBoxManage unregistervm --delete "$vm"
    done
  2. obazoud created this gist Feb 5, 2013.
    5 changes: 5 additions & 0 deletions vm-clean.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    #!/bin/bash

    for vm in `VBoxManage list vms | awk '{ print $1 }' | sed "s/\"//g"`; do
    VBoxManage unregistervm --delete $vm
    done