title: Can VirtualBox VBoxManage add/remove shared folders on the fly?
body: <p>When I am trying to add/remove shared folder to my VirtualBox I am getting this error:</p>
  
  <pre><code>~$ VBoxManage sharedfolder add dev --name srv --hostpath  "/my/local/path"
  
  VBoxManage: error: The machine 'dev' is already locked for a session (or being unlocked)
  VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee nsISupports
  VBoxManage: error: Context: "LockMachine(a-&gt;session, LockType_Write)" at line 1012 of file VBoxManageMisc.cpp
  </code></pre>
  
  <p>It works when I stop the machine, manipulate shares and then start the machine again. It also works from the VirtualBox UI but I would like to script these operations.</p>
  
  <p>Running VirtualBox 5.0.12 on Mac OS Yosemite. The box was provisioned with <code>docker-machine</code>.</p>