       throw new Error "Invalid name: '#{name}'"
     new IEVM n for n in @names when n.match "IE#{name}"
 
-  # Construct a `VBoxManage` command with arguments.
+  # Construct a `VBoxManage` command with arguments. Adds single quotes to all
+  # arguments for shell safety.
   @vbm: (cmd, args=[]) ->
     args = ("'#{a}'" for a in args).join ' '
     "VBoxManage #{cmd} #{args}"

  # Promise a boolean indicating whether the archive exists on disk.
  archived: ->
    deferred = Q.defer()
    fs.exists path.join(@constructor.home, @archive()), (archived) ->
      deferred.resolve archived
    deferred.promise

  # Promise a boolean indicating whether the archive exists on disk.
  ovaed: ->
    deferred = Q.defer()
    fs.exists path.join(@constructor.home, @ova()), (ovaed) ->
      deferred.resolve ovaed
    deferred.promise

  _waitForStatus: (statuses, deferred, delay=1000) ->

    @os = pieces.pop()
    throw new Error "Invalid OS: '#{@os}'" unless @os in @constructor.oses

  # ### Validation Helpers

  # Throw an exception if the virtual machine is missing (not installed).
  ensureMissing: ->
    @missing().then (missing) -> missing or throw new Error "not missing"

  # Throw an exception if the virtual machine is *not* missing (is installed).
  ensureNotMissing: ->
    @missing().then (missing) -> !missing or throw new Error "missing"

  # Throw an exception if the virtual machine is running.
  ensureRunning: ->
    @running().then (running) -> running or throw new Error "not running"

  # Throw an exception if the virtual machine is *not* running (saved/off).
  ensureNotRunning: ->
    @running().then (running) -> !running or throw new Error "running"

