Auto-start VBox guest
Posted: 2. Nov 2009, 21:45
I have a program that runs as a service under Windows that executes the contents of a batch file at boot without a login. I've been using it for over a decade and it works well. I'm trying to configure it to start a VBox guest, but it hasn't worked saying that it can't find a guest by that name. I have executed the line from the batch file in a logged-in command prompt and it starts the guest, so I'm sure it isn't a syntax problem. My suspicion is that because it was running under the System account, it had no profile to derive the VirtualBox.XML file from which to start; so I tried configuring the service to run impersonated as myself, but it didn't work that way either. I then tried to copy the virtualbox.xml file to the System profile (under C:\WINDOWS\system32\config\systemprofile\.VirtualBox) and reconfigured the service to run under the System account, but that didn't work either. I'm out of ideas, if anyone has suggestions on how to do it this way (what does VBox need to start a guest this way?) I'd appreciate the input.
The batch file looks like this:
cd "\program files\sun\virtualbox"
vboxmanage list vms {for debugging the log}
vboxmanage startvm "WinXPSP2VM" --type headless
The output is:
VirtualBox Command Line Management Interface Version 3.0.8
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
ERROR: Could not find a registered machine named 'WinXPSP2VM'
Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown
Context: "FindMachine(Bstr(VMName), machine.asOutParam())" at line 512 of file VBoxManage.cpp
The batch file looks like this:
cd "\program files\sun\virtualbox"
vboxmanage list vms {for debugging the log}
vboxmanage startvm "WinXPSP2VM" --type headless
The output is:
VirtualBox Command Line Management Interface Version 3.0.8
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
ERROR: Could not find a registered machine named 'WinXPSP2VM'
Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown
Context: "FindMachine(Bstr(VMName), machine.asOutParam())" at line 512 of file VBoxManage.cpp