title: VirtualBox Python SDK, closeMachineSession -> XPCOM component has no attribute 'close'
body: <p>I am trying to run a VirtualBox machine using the python sdk.</p>
  
  <p>I ran the following commands (based on the <a href="http://download.virtualbox.org/virtualbox/SDKRef.pdf" rel="nofollow">documentation</a> page 32):</p>
  
  <pre><code>from vboxapi import VirtualBoxManager
  manager = VirtualBoxManager(None, None)
  vbox = manager.vbox
  name = "myVM"
  mach = vbox.findMachine(name)
  session = manager.mgr.getSessionObject(vbox)
  progress = mach.launchVMProcess(session, "gui", "")
  
  progress.waitForCompletion(-1) #successfully fires up myVM w/ GUI
  
  manager.closeMachineSession(session) #error, see below
  </code></pre>
  
  <p>The error I get is:</p>
  
  <blockquote>
    <p>raise AttributeError, "XPCOM component '%s' has no attribute '%s'" % (self._object_name_, attr)
    AttributeError: XPCOM component '@virtualbox.org/Session;1' has no attribute 'close'</p>
  </blockquote>
  
  <p>I am trying to shutdown and close the VM from python.</p>
  
  <p>Question:<br>
  How can I resolve this error and shut down the VM using python?</p>