def destroy
      # Do a full cleanup on the machine, then delete all the media attached
      media = interface.unregister(:full)

      if !media.empty?
        if Platform.windows?
          # The MSCOM interface in CRuby to delete media is broken,
          # so we do this ghettoness. Also, in JRuby, passing an array
          # to objects is broken. So once again, we do this.
          path = interface.settings_file_path

          # A simple sanity check to make sure we don't attempt to delete
          # the root or something
          if path.length > 10
            Pathname.new(path).parent.rmtree
          end
        else
          interface.delete(media)

          # TODO: This sleep is silly. The progress object returned by the media
          # delete always fails to "wait" for some reason, so I do this. I hope
          # to solve this issue soon.
          sleep 1
        end
      end
    end
def destroy
      # Do a full cleanup on the machine, then delete all the media attached
      media = interface.unregister(:full)

      if !media.empty?
        if Platform.windows?
          # The MSCOM interface in CRuby to delete media is broken,
          # so we do this ghettoness. Also, in JRuby, passing an array
          # to objects is broken. So once again, we do this.
          path = interface.settings_file_path

          # A simple sanity check to make sure we don't attempt to delete
          # the root or something
          if path.length > 10
            Pathname.new(path).parent.rmtree
          end
        else
          interface.delete(media)

          # TODO: This sleep is silly. The progress object returned by the media
          # delete always fails to "wait" for some reason, so I do this. I hope
          # to solve this issue soon.
          sleep 1
        end
      end
    end
Destroys the virtual machine. This method also removes all attached
 media (required by VirtualBox to destroy a VM). By default,
 this **will not** destroy attached hard drives, but will if given
 the `destroy_image` option.

 @overload destroy(opts = {})
   Passes options to the destroy method.
   @option opts [Boolean] :destroy_medium (false) If true, will
     also unregister attached media. If set to `:delete`, it will
     not only unregister attached media, but will also physically
     remove their respective data.