VirtualBox as a service

Discussions related to using VirtualBox on Windows hosts.

Me Too

Postby wesmon » 12. Oct 2007, 02:46

I'm am having a similar issue running it from the scheduler at startup. I tried running the vbmanage exe in the scheduler. I also tried just running a batch file. Both fail. I'm running the job from the same privileged account the created the virtual machines.

If I go to the scheduler and click Run Now, it launches properly.

Running vb1.5, XP host, XP guest.

Any ideas?

thanks
Wes
wesmon
 
Posts: 2
Joined: 12. Oct 2007, 02:25

Postby pg94au » 14. Oct 2007, 04:30

If this is going to be suggested as an enhancement, the fix is to actually make it run as a service, not to get it to work somehow as a scheduled task. (Though I realize some people may be interested in this as a temporary solution.)

A model similar to what VMWare Server does would be ideal, where a Windows service is responsible for starting all VMs that are marked as 'start on reboot'.

I'm very impressed by VirtualBox so far, but the inability to run it as a service is an unfortunate omission.
pg94au
 
Posts: 4
Joined: 20. Jun 2007, 04:28

VirtualBox as a service

Postby tk » 14. Oct 2007, 11:52

I'm trying to set up a virtual NAS that allows me to access an ext3 HD via samba running on debian 4 from my WindowsXP host. This works very fine (raw disk access, host interface, etc.) and I also can startup and shutdown the machine using the commands
    VBoxManage.exe startvm VirtualNAS -type vrdp
    VBoxManage.exe controlvm VirtualNAS acpipowerbutton
from a dos box and also from a batch file. So far so good.

When I put the batch file in a scheduled task at startup (also the non-admin users in my family should be able to access their data when I'm not at home to startup the machine) then I reproducably get

    VirtualBox VRDP Headless Interface 1.5.0
    (C) 2005-2007 innotek GmbH
    All rights reserved

    Invalid machine name!
    (rc = 0x80070057)


I.e. everything works as described in the (excellent! only a hint of how to find the correct number to put behind PhysicalDrive is missing) documentation. Only the startup of the machine at system startup does not know my machine (yet?).

So, any suggestions from the experts?

http://www.virtualbox.org/discussion/1/670 is somewhat related.
There sombody seems to have gotten it to work, but does not exactly seem to know how.

Scheduling the shutdown command is a different topic on windos XP HOME, but google search for HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\System\Scripts seems to provide some useful hints.
tk
 
Posts: 1
Joined: 14. Oct 2007, 11:21

Postby roelvdh » 8. Jan 2008, 22:38

dlambeth wrote:Here are my steps:

I type in:
>VBoxVRDP.exe -startvm W3K_DC1

Command promt shows:
VirtualBox VRDP Headless Interface 1.5.0
(C) 2005-2007 innotek GmbH
All rights reserved

Listening on port 3389
Error: failed to start machine. Error message: Failed to launch VRDP server (VERR_NOT_SUPPORTED)


Please use quotes around W3K_DC1. It seems the VB-machine has started (the RDP-server is listening at least). Although the error message suggests something else I would try adding quotes first.
Roel
roelvdh
 
Posts: 5
Joined: 8. Jan 2008, 22:21

Postby nullspam » 7. Aug 2008, 22:33

Mugwump00 wrote:Do you have an idea on how to get all your running VMs to close to a Saved state when you shutdown/reboot?

I've tried various ways, including yours, but I've no success in getting VB to close down elegantly other than to write a "vboxmanage controlvm" script and use this whenever I want to reboot my server.


There is a way. Use the Group Policy Object Editor (run 'mmc' to 'add' that editor, goto Computer Configuration/Windows Settings/Scripts/Shutdown, copy & add your script) to let windows execute automatically your (vboxmanage controlvm <vm-name> savestate) script at shutdown.

See: http://www.microsoft.com/technet/script ... sion2.mspx for more details.
nullspam
 
Posts: 1
Joined: 7. Aug 2008, 22:14

Postby galaxymike » 17. Feb 2009, 07:28

Hello,
I wish to tell you as I started VirtualBox as service under Windows Vista.

1) run `cmd` and write:
sc create VirtualServer binPath= "%SystemRoot%\System32\srvany.exe" start= auto DisplayName= "Virtual Server"
2) run `regedit` and goto '[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VirtualServer]'
2.1) add section 'Parameters'
2.2) add key 'Application' equal 'C:\Program Files\Sun xVM VirtualBox\VBoxHeadless.exe' to section 'Parameters'
2.3) add key 'AppParameters' equal 'startvm <vmname> -vrdp=off' to section 'Parameters'
2.4) add key 'AppDirectory' equal 'C:\Program Files\Sun xVM VirtualBox\' to section 'Parameters'
3) run `mmc` and goto 'Computer Configuration/Windows Settings/Scripts/Shutdown' and add script with line:
vboxmanage controlvm <vmname> savestate
4) copy '.VirtualBox' from 'C:\Users\<username>\' to 'C:\Windows\System32\config\systemprofile\'

Enjoy!

P.S.: Obtain copy of srvany.exe from the appropriate Windows Resource Kit.
galaxymike
 
Posts: 1
Joined: 17. Feb 2009, 06:48

Re: VirtualBox as a service

Postby jdl » 25. Mar 2009, 20:19

galaxymike wrote:Hello,

I wish to tell you as I started VirtualBox as service under Windows Vista.


1) run `cmd` and write:

sc create VirtualServer binPath= "%SystemRoot%\System32\srvany.exe" start= auto DisplayName= "Virtual Server"

2) run `regedit` and goto '[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VirtualServer]'

2.1) add section 'Parameters'

2.2) add key 'Application' equal 'C:\Program Files\Sun xVM VirtualBox\VBoxHeadless.exe' to section 'Parameters'

2.3) add key 'AppParameters' equal 'startvm <vmname> -vrdp=off' to section 'Parameters'

2.4) add key 'AppDirectory' equal 'C:\Program Files\Sun xVM VirtualBox\' to section 'Parameters'

3) run `mmc` and goto 'Computer Configuration/Windows Settings/Scripts/Shutdown' and add script with line:

vboxmanage controlvm <vmname> savestate

4) copy '.VirtualBox' from 'C:\Users\<username>\' to 'C:\Windows\System32\config\systemprofile\'


Enjoy!

P.S.: Obtain copy of srvany.exe from the appropriate Windows Resource Kit.


srvany.exe, from what I have read, does not work under Windows Server 2008 64-bit. We desperately need a way to run these applications as services!!! Has anyone had any success either with this method or other methods? Anyone know if and when VirtualBox will support the ability to run its machines as individual services?

Thanks!!!!!!!!!
jdl
 
Posts: 10
Joined: 15. Dec 2008, 22:09

Previous

Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: No registered users and 12 guests