Auto-start VBox guest

Discussions related to using VirtualBox on Windows hosts.
Post Reply
dmd
Posts: 3
Joined: 2. Nov 2009, 21:31
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP

Auto-start VBox guest

Post 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
MarkCranness
Volunteer
Posts: 875
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP

Re: Auto-start VBox guest

Post by MarkCranness »

See section 9.1 of the manual: Set the VBOX_USER_HOME environment variable.
Bachson
Posts: 2
Joined: 7. Nov 2009, 14:20
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: xp

Re: Auto-start VBox guest

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Auto-start VBox guest

Post by Sasquatch »

Please check the sticky here. There are already topics that describe how to run a VM as a service.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Bachson
Posts: 2
Joined: 7. Nov 2009, 14:20
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: xp

Re: Auto-start VBox guest

Post 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?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Auto-start VBox guest

Post by Sasquatch »

See the phpBB FAQ for stickies and other kinds of topics.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply