Page 1 of 1

Auto-start VBox guest

Posted: 2. Nov 2009, 21:45
by dmd
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

Re: Auto-start VBox guest

Posted: 3. Nov 2009, 00:49
by MarkCranness
See section 9.1 of the manual: Set the VBOX_USER_HOME environment variable.

Re: Auto-start VBox guest

Posted: 7. Nov 2009, 14:30
by Bachson
I'm struggling with this command VBOX_USER_HOME and very new to virtual box.
I'm getting the same error when I try to create a batch to automatically start my virtual box with xp running under windows 7.
So Window 7 is the host, xp is the guest, in seamless mode. When i start everything manually it works perfect.
I've been reading the chapter in the documentation but I do not get it running.
So where do I need get this variable set? As a service? in the registry? in a batch?
And what is th right syntax as my virtual xp is in C:/Users/Server/.virtualbox/machines/xpsp3?

What I want is when my windows 7 boots that the xp in virtual box is started as well.

thanks you for helping.

Re: Auto-start VBox guest

Posted: 7. Nov 2009, 15:00
by Sasquatch
Please check the sticky here. There are already topics that describe how to run a VM as a service.

Re: Auto-start VBox guest

Posted: 9. Nov 2009, 01:01
by Bachson
I now that there is but it is completely unclear to me how to do it. That why I asked this question.
and what is a sticky?

Re: Auto-start VBox guest

Posted: 9. Nov 2009, 23:21
by Sasquatch
See the phpBB FAQ for stickies and other kinds of topics.