VirtualBox Control Service

↓ Configuration    ↓ Installation    ↓ Principles of Operation    ↓ Download      [Описание по-русски]

This program is a win32 service that runs under SYSTEM account and provides automatic start/shutdown for a VirtualBox virtual machine. Installing this service gives you the ability to start a virtual machine on system start and gracefully shut it down on system shutdown. You can use following actions: poweroff, savestate, acpipowerbutton or acpisleepbutton.

Configuration

Configuration is done via .ini file with the same name as the service executable. A default configuration file is included in distribution archive.

Configuration options:

VboxInstallPathSet this to a folder where VirtualBox is installed
VboxUserHomeSet this to a location of your .VirtualBox homedir
VmNameThe name of the virtual machine this service will control
ShutdownCommandThe command used to shutdown a VM: poweroff, savestate, acpipowerbutton, acpisleepbutton
ServiceNameAn optional service display name
LoglevelLog level: 0=Disabled, 1=Enabled, 2=Verbose
PriorityPriority of the VM process: Idle, Below Normal, Normal, Above Normal, High

You should create/modify a configuration file before installing the service. And before that you should already have all your VMs created and configured using VirtualBox GUI or CLI.

Configuration of tray helper application is done via vboxctrltray.ini file. For each VirtualBox machine add a new section with a name of your choice and specify the location of vboxctrl.ini file with ConfigFile option. Refer to sample configuration file for details.

Installation

Place vboxctrl.exe and vboxctrl.ini in a folder of your choice.

To install a service run:

vboxctrl -i

To uninstall a service run:

vboxctrl -u

The name for the service to be installed is taken from the executable filename, while the display name (if given) is taken from a configuration file.

If you need to have several VMs to be controlled by the service make a copy of vboxctrl.exe and vboxctrl.ini with a different name, edit VmName/ShutdownCommand/ServiceName options and run:

vboxctrl_copy -i
or
vboxctrl_copy -u
to install or uninstall a new service.

Place vboxctrltray.exe and vboxctrltray.ini in a folder of your choice. Edit vboxctrltray.ini file to match services you have configured above.

Be sure to update all vboxctrl.exe executables and reinstall services if upgrading from previous version unless stated otherwise.

Principles of Operation and Limitations

Because VirtualBox is meant to be run under user account (with per-user configuration) in order to run it under SYSTEM account it would require you to run VirtualBox GUI and create virtual machines from that same SYSTEM account. Since it’s not very convenient to do so, an easy workaround would be to copy your .VirtualBox folder (%USERPROFILE%\.VirtualBox) to the SYSTEM profile folder (%SYSTEMROOT%\system32\config\systemprofile) after creating and configuring all virtual machines from GUI. Actually, the location of .VirtualBox folder is set by a user environment variable %VBOX_USER_HOME% and by overriding it for VirtualBox process running as a SYSTEM account you won’t even need to copy it. And this is exactly what this service does.

But because of some locking techniques in VirtualBox as soon as you start at least one virtual machine as a system service, any changes you make to configuration (like adding/renaming VMs) in the GUI/CLI (that was run as a user) will be unavailable to the service until all of the VMs have been shut down (powered off or saved state).

If you absolutely need to make changes while one or more VMs is running you would have to use psexec to run VirtualBox GUI or VBoxManage as a SYSTEM account. Moreover, you need to have at least one vboxctrl service running for having VBoxSVC started with %VBOX_USER_HOME% variable set.

For Windows XP/2003 that would simply be:

psexec -sdi "%VBOX_INSTALL_PATH%\VirtualBox.exe"

Windows Vista/2008 and Windows 7 introduced Session 0 Isolation, so the command is slightly different:

psexec -sd -i 0 "%VBOX_INSTALL_PATH%\VirtualBox.exe"
and then you need to click ‘Show me the message’ button in the interactive services detection dialog.

Note for Windows XP/2003 users. If a virtual machine takes too long to shutdown or save state Windows will just terminate it. How long is too long depends on a number of things, so if you see that VM doesn’t shut down cleanly you will have to stop the service manually before shutting down or restarting the system.

License and Credits

VirtualBox Control Service is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

VirtualBox Control Service is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Icons from Silk icon set by Mark James were used in this program.
(http://www.famfamfam.com/lab/icons/silk/)

Changelog

  • 0.4.2
    VirtualBox 4.1 support. Not backward compatible.
  • 0.4.1
    Added an option to select one-time shutdown action from the tray helper menu;
    Added checking for updates.
  • 0.4.0
    VirtualBox 4.0 support. Not backward compatible.
  • 0.3.3
    Fixed yet another bug in communication between tray helper and service.
  • 0.3.2
    Fixed a bug in communication between tray helper and service (resulted in disabled VRDP console menu item);
    Fixed service installation procedure not setting correct permissions in localized version of Windows.
  • 0.3.1
    New feature: open VRDP console from tray helper;
    Fixed tray icon disappearing on explorer crash.
  • 0.3.0
    Added tray helper application to control vboxctrl services.
  • 0.2.1
    Updated to support VirtualBox 3.2.0 (for versions up to 3.1.8 use vboxctrl 0.2.0). Don’t forget to update vboxctrl.ini file to reflect possible VirtualBox installation path change if upgrading from 0.2.0.
  • 0.2.0
    Completly rewritten to use VirtualBox COM interface since during the shutdown we can’t rely on spawning a VBoxManage process. Now there are 2 separate builds for x86 and x64 architectures.
  • 0.1.1
    Fixed incorrect handling of shutdown signal.
  • 0.1
    First public release.

Download

Version 0.4.2 (for VirtualBox 4.1.x):

32-bit: vboxctrl-0.4.2.zip [43.6 KB] (sha1: 87d7254851b320972c23f63ed1301c53e3212179)
64-bit: vboxctrl64-0.4.2.zip [46.0 KB] (sha1: 4305ee1d241cbfe0d00ea3bc560970f662aac989)
source: vboxctrl-0.4.2-src.zip [197.6 KB] (sha1: 000746373121ecfcdf1dfc85207e6d75ea1c4a61)

Version 0.4.1 (for VirtualBox 4.0.x):

32-bit: vboxctrl-0.4.1.zip [43.3 KB] (sha1: 67741ca0daab8d9900c6d314c6a1e25c7d96b9e8)
64-bit: vboxctrl64-0.4.1.zip [45.8 KB] (sha1: b01e371c569cd15969d0fc11b5e191dc48a63337)
source: vboxctrl-0.4.1-src.zip [189.2 KB] (sha1: b3cbbfdb07e8b039460a29095fb923dade4f73fc)

Version 0.3.3 (for VirtualBox 3.2.x):

32-bit: vboxctrl-0.3.3.zip [40.6 KB] (sha1: 68efbc4b17ec8b9c6783fb25c8315225b53546ec)
64-bit: vboxctrl64-0.3.3.zip [43.0 KB] (sha1: f55f281f3ea864aea5a7313928ae401118e54fd5)
source: vboxctrl-0.3.3-src.zip [153.5 KB] (sha1: c0dd797dee86a46b8973db32cff93a8ebe001850)

Version 0.2.0 (for VirtualBox up to 3.1.8):

32-bit: vboxctrl-0.2.0.zip [12.8 KB] (sha1: 04ea7a9c830e870f430639a12ed44c44e22873be)
64-bit: vboxctrl64-0.2.0.zip [14.6 KB] (sha1: 0cc3b8f011895d0218f739b24d161bc9a6e147aa)

104 Comments »

Hans Eberhardt
2010-03-27 22:43:44

It would be nice to provide the source for the VBox users

2010-06-04 15:09:57

Version 0.3.0 is out. Sources available.

 
 
Konrad
2010-04-24 17:38:09

Why does not show VirtualBox control panel, that a virtual machine is running?

This would be very important.

2010-04-28 09:47:14

Because of the same limitation of having to run control panel or vboxmanage as a system account user to modify virtual machine.

 
 
Konrad
2010-04-24 17:49:10

At least there would be need a Windows Tray application, which shows state of the virtual machine, and I can start or stop it.

2010-06-04 15:10:55

Implemented in version 0.3.0 (built for VirtualBox 3.2.0+)

 
 
Webmaster33
2010-04-29 11:18:03

The Vmware Server v1.x has a great advantage over VirtualBox, that it is able to run virtual machines as service.

When I close the VM control panel, the VMs are still running.

Also I can start the VMware Server Console (client), so I can see the state of the VM, also I can interact with the server through the server console.

BTW, I don’t like Vmware 2.x web based control panel.

If VirtualBox would have such features like Vmware 1.x, I would prefer it over Vmware.

Suggestion:

- VirtualBox Server Console (client), so I can see the state of the VM (running as Windows Tray application would be a good idea)

2010-06-04 15:16:46

Implemented in version 0.3.0 (built for VirtualBox 3.2.0+)

 
 
fonts
2010-05-08 16:35:07

thanks your app works great :)

 
Tertullian
2010-05-24 09:39:13

Hello friend- Is there any support for VirtualBox 3.2?

 
Tertullian
2010-05-24 23:47:06

After upgrading to Virtualbox 3.2, when I attempt to start a previously working VM service, I get a MMC popup dialog with title bar “Services” and the message: “Windows could not start the VirtualBox VMname service on Local Computer. Error 1067: The process terminated unexpectedly.”

I hope this information helps everyone. This is a very good tool.

2010-05-25 07:29:12

Update coming soon. Thank you.

 
 
Tertullian
2010-05-25 09:33:26

Great, thank you. I forgot to mention too, that I also corrected the newly updated VirtualBox installation path in the config file- with the same result. Also tried installing new instances of services, after upgrading to 3.2- with the new path. Same result. (The new path being, as I am sure you are aware, in the Oracle directory instead of Sun) Thanks again.

2010-05-25 13:02:45

Updated to version 0.2.1. VirtualBox 3.2.0 now is a requirement. Use 0.2.0 for previous versions.

Tertullian
2010-05-27 11:58:00

Many thanks! But a problem… using version 0.2.1 with VirtualBox 3.2, I have the same problem as I described above. I have log level set to 1 in the config file, and the error I receive in the log is:

“[05/27/10 04:54:27] ERROR creating VirtualBox instance (rc = 0×80004002)”

Is there any more information I can give you? This is x64 I should add- Win7 x64.

2010-05-27 12:37:19

Are you absolutely sure you’re using a new 0.2.1 version with VirtualBox 3.2.0? Just checked on a Win7 x64 myself and it works as expected. Be sure to stop all virtual machines, update all copies of vboxctrl if using more than one and restart vboxctrl service(s). Also make sure you’re using x64 build of vboxctrl.

 
 
 
 
Tertullian
2010-06-01 00:41:53

Actually, I believe I may have somehow not replaced the vboxctrl with the new version for that VM. All works well now- sorry for the confusion, thanks again for your efforts. And I too would appreciate source if you ever decide to release. Many thanks!

2010-06-04 15:17:52

Version 0.3.0 with tray helper application is out. Sources available.

Tertullian
2010-06-09 11:02:23

Thanks for the update! I have noticed something strange after updating to the latest VirtualBox release 3.2.4 r62467 (which was necessary to combat bugs with 3.2.2) I seem to have strange things going on when I stop the service for a VM with the tray helper. Here is a log excerpt:

[06/08/10 14:54:14] Service VirtualBox Ertner (Ertner) installed successfully.

[06/08/10 14:54:32] Starting VM ‘Ertner’

[06/08/10 14:54:32] VM ‘Ertner’ started

[06/09/10 01:28:01] Stopping (savestate) VM ‘Ertner’

[06/09/10 01:28:06] VM ‘Ertner’ stopped (savestate)

But then when I went to start the VM back up in the VirtualBox GUI, Windows had not been shut down properly. Experienced this 2 out of 2 times. Just a heads up for everyone….

Tertullian
2010-06-09 11:07:06

let me correct/clarify- Windows was in the state of having not been shut down properly. So it was as if the savestate setting was ignored, and poweroff was used instead.

 
2010-06-09 12:17:56

Are you saying this happens only when using tray helper to stop a VM (as opposed to doing so from service manager or by ‘net stop Ertner’)? And does saving state from VirtualBox GUI work as expected?

I don’t see any API changes from 3.2.2 to 3.2.4 and it does save state on my test systems (x86/x64) with 3.2.4.

If problem persists, provide your .ini files for both vboxctrl and vboxctrltray, and a debug log of the process (set Loglevel=3).

Tertullian
2010-06-09 21:21:50

I have not yet been able to reproduce the problem, but that is largely because of what I have discovered when taking steps to attempt to reproduce the problem. (Maybe this will help, as it is somewhat related.) What I notice now is that I am unable to start the VM via vboxctrl either with the tray helper or any other means such as Service Manager… IF the VM was not already in savedstate. In other words, vboxctrl will not cold boot a VM (I do not recall ever attempting this with previous versions of vboxctrl or VirtualBox so I am not sure if it is a new problem)

However if I go back into VirtualBox GUI and start up the VM and then close the VM with the savestate option (again, with the VirtualBox GUI), then vboxctrl (and tray helper app) has no problems after that. (until I again attempt to use vboxctrl to manage the VM while not in savedstate)

——- START VM from savedstate using vboxctrl (any method- tray helper, Service Manager, etc.) ———–

[06/09/10 14:00:05] VirtualBox Control Service v0.3.0.79 (x64) started

[06/09/10 14:00:05] Initializing VirtualBox interface

[06/09/10 14:00:05] VirtualBox Interface v3.2.4 initialized

[06/09/10 14:00:05] Using VBOX_USER_HOME: C:\users\UserName\.VirtualBox

[06/09/10 14:00:05] Starting VM ‘Ertner’

[06/09/10 14:00:05] VM ‘Ertner’ started

——- STOP VM (in this case with tray helper) ———–

[06/09/10 14:00:32] Stopping (savestate) VM ‘Ertner’

[06/09/10 14:00:35] VM ‘Ertner’ stopped (savestate)

——- Next I stopped the VM using tray helper, successfully saving state ——-

——- Then using VirtualBox GUI resume state ——-

——- Then shut down the VM properly (in this case Windows x64 guest) ——-

——- Lastly, attempt to START previously shut down VM using any method for vboxctrl ——-

[06/09/10 14:02:00] VirtualBox Control Service v0.3.0.79 (x64) started

[06/09/10 14:02:00] Initializing VirtualBox interface

[06/09/10 14:02:00] VirtualBox Interface v3.2.4 initialized

[06/09/10 14:02:00] Using VBOX_USER_HOME: C:\users\UserName\.VirtualBox

[06/09/10 14:02:00] Starting VM ‘Ertner’

[06/09/10 14:02:00] VM ‘Ertner’ started

[06/09/10 14:02:00] VM ‘Ertner’ was terminated abnormally (0×00000001)

2010-06-09 21:43:18

One more thing. When you attempt to cold boot a VM with a vboxctrl service, do you have VirtualBox GUI running?

Also, “was terminated abnormally (0×00000001)” means vboxctrl crashed. So there’s a good chance there will be something useful in the Event Log. Have a look, please.

Anyway, thanks for the info. Will look into this.

Tertullian
2010-06-09 22:04:26

I just closed VirtualBox GUI before re-attempting, but the results were the same. Probably always had it open the previous attempts.

In the System event log I presently have only 2 VirtualBox / vboxctrl related messages for these failed attempts to start a savedstate VM using vboxctrl:

-The VirtualBox Ertner service entered the stopped state.

-The VirtualBox Ertner service entered the running state.

Both within the same second.

Yesterday I experienced some strange errors, but I have no way to explain to you the state of things at the time because it was a weird combination of VirtualBox bugs and upgrades and multiple revisions of 3.2.4, renaming VMs, and who knows what else. I don’t want to confuse the current issue, and I don’t think the problems were related (in fact I believe they were fixed when I upgraded to the final 3.2.4 revision) but in case they may be of benefit, here they are from the system event log:

-The VirtualBox Ertner service is marked as an interactive service. However, the system is configured to not allow interactive services. This service may not function properly.

-The VirtualBox Ertner service terminated with service-specific error %%-2139095039.

But again, I no longer receive these, I believe after upgrading to the final 3.2.4 revision.

Glad to help- your efforts just about make VirtualBox usable for what I need it for…. if only I could count on not losing an entire VM and snapshot tree when the GUI crashes when adding a comment to a new snapshot.

2010-06-09 22:27:38

ok, a quick look shows me that a most probable problem is actually running both GUI and vboxctrl at the same time. Moreover, it doesn’t really have to be at the same time, because for each process (user actually) that interacts with VirtualBox, VBoxSVC is run to supply the interface for this interaction. And after closing VirtualBox GUI / vboxctrl this service doesn’t shut down immediately (or sometimes never). And that might result in those possible locking problems I was talking about in the Principles of Operation and Limitations section above.

For example, now, after a few experiments I have a machine that I can successfully start/stop/save state with vboxctrl, but VirtualBox GUI shows its state as Aborted even after stopping all vboxctrl services and restarting GUI. After waiting for like 5 minutes maybe, I started GUI once again, and this machine was in a saved state, just like vboxctrl left it. As a last resort, system restart helps to get rid of any VBoxSVC that got stuck.

vboxctrl wasn’t made with an intention to be used along with VirtualBox GUI actually. The main idea is to set up all VMs forget about GUI and just use those vboxctrl services to start and stop machines with the host (say, a virtual router is definitely needs to be run this way). Personally, I don’t even need a tray helper in my scenario. Writing a whole new service-wise VirtualBox GUI isn’t something I was planning to do, just a temporary measure until Sun/Oracle makes one themselves. And I sure hope they do that some day.

As to event log errors, it seems that Interactive Services Detection service prevents vboxctrl service to start. Check if you have it running. If you do, stop it, set start type to Manual and reinstall vboxctrl services. Will add that to the readme, actually.

And again, let me repeat myself: “If you absolutely need to make changes while one or more VMs is running you would have to use psexec to run VirtualBox GUI or VBoxManage as a SYSTEM account. Moreover, you need to have at least one vboxctrl service running for having VBoxSVC started with %VBOX_USER_HOME% variable set”. See Principles of Operation and Limitations section in readme/top of this page.

 
 
 
 
 
 
 
 
Webmaster33
2010-06-07 01:25:06

You are great!

Tray helper application is exactly what I wanted.

Thanks very much!

 
Shaun
2010-06-09 12:25:25

You are a Legend!, keep up the good work ! :D

 
G!
2010-06-11 17:00:43

Vultur,

Love the concept, but I am having trouble getting it to work. When I attempt to start the service I get this error: -2139095039.

Thanks so much for your work.

G!

2010-06-11 17:09:04

Set loglevel to 3 in vboxctrl.ini file. Reinstall the service, try to start it and show me the log file.

G!
2010-06-11 17:30:06

Here is the log file:

[06/11/10 11:19:33] Service VirtualBox IRVM0080 (IRVM0080) uninstalled successfully.

[06/11/10 11:24:42] Service VirtualBox IRVM0080 (IRVM0080) installed successfully.

[06/11/10 11:26:03] VirtualBox Control Service v0.3.0.79 started

[06/11/10 11:26:03] Initializing VirtualBox interface

[06/11/10 11:26:04] VirtualBox Interface v3.2.4 initialized

[06/11/10 11:26:04] Using VBOX_USER_HOME: C:\users\George\.VirtualBox

[06/11/10 11:26:04] ERROR: Could not find registered VM ‘IRVM0080′

Here is my .ini file:

[VBoxCtrl]

VboxInstallPath=C:\Program Files\Oracle\VirtualBox

VboxUserHome=C:\users\George\.VirtualBox

VmName=IRVM0080

ShutdownCommand=acpipowerbutton

ServiceName=VirtualBox IRVM0080

Loglevel=3

Priority=Normal

G!
2010-06-11 17:32:31

Oh yeah, I meant to tell you that I did a reboot between the un-install and re-install. Just in case that matters.

2010-06-11 17:36:42

no, reboot is not needed

 
 
2010-06-11 17:35:08

There you go:

ERROR: Could not find registered VM ‘IRVM0080′

Either the name of the virtual machine is wrong (VmName should be set to name you gave the machine in VirtualBox GUI), or you didn’t close VirtualBox GUI after creating the machine. Read the post/readme: “But because of some locking techniques in VirtualBox as soon as you start at least one virtual machine as a system service, any changes you make to configuration (like adding/renaming VMs) in the GUI/CLI (that was run as a user) will be unavailable to the service until all of the VMs have been shut down (powered off or saved state).”

 
 
 
 
G!
2010-06-11 17:51:53

Doh! I just figured it out. There is no such path as *\users\* in Windows XP. I feel like such a dope!

Thanks for helping! It is really great that you actually help people. Most of the time I don’t even get a reply from developers, much less any actually help.

G!
2010-06-11 17:55:25

Set VboxUserHome= to C:\Documents and Settings\George\.VirtualBox. Works perfectly now.

2010-06-11 18:34:58

Thanks for the feedback. I believe I should have used ‘Documents and Settings’ in the example configuration file as Vista/7 have it linked to ‘Users’ folder. Will change that in the next update.

 
 
 
BAM
2010-07-02 23:52:27

I can’t get the ‘savestate’ feature to work. Everything else works as expected. When I shutdown the service, the Vbox powers off completely. When I startup the VBox again, it does a cold boot. The logs are clean. I shutdown either from service console, command prompt, or tray. Always a cold boot on restart.

I am using the latest version of both your software and VirtualBox (3.2.6). Running Windows 7 x64.

As I said, everything but this piece works great.

Very nice application though. I enjoy the simplicity better than the alternatives out there, and the system tray is really nice. Thanks!

2010-07-03 00:27:49

Please, set Loglevel=3 in the vboxctrl.ini, stop all vboxctrl services and delete the log file, close VirtualBox GUI and wait for 30 seconds (or better yet restart your computer, as I’ve seen VBoxSvc just hang). Then start your virtual machine and wait until it gets up and running and stop vboxctrl service with Service Control Manager. Then show me the output of the log (you can replace your username in log output with something if you want).

BAM
2010-07-13 18:41:48

Figured it out. The Problem was not with your software at all. A failed update of 3.2.6 from 3.2.4 had several orphaned files and processes. A reboot did not fix the issue as the components were still installed and the software itself (VirtualBox) ran just fine with the mix of 3.2.4 and 3.2.6 pieces. Completely removed 3.2.4, rebooted, installed 3.2.6 from scratch, and now everything works as expected.

So, for the record, your product works flawlessly with Windows 7 x64 with VirtualBox 3.2.6

Thanks.

 
 
 
Herb
2010-07-24 23:39:11

Thanks for a great tool. Appreciated!

One question: How can I enable the VRDP Console option?

Thanks again!

Windows 7 Pro x64

VirtualBox 3.2.6

2010-07-25 11:04:14

In the virtual machine settings, Display -> Remote Display tab -> Enable Server

Surely you need a unique port for each virtual machine.

 
 
Herb
2010-07-25 17:17:32

Hi Vu1tur, thanks for a quick response. I do already have RDP enabled on the VM that is running and can access it using standard RDP client on a non-standard port, however, when I access the VM options using the vboxctrl tray helper, the option for VRDP Console is grayed out. Otherwise starting/stopping/restarting the service and VM all work fine. Not sure what to do at this point. Thanks again for your assistance.

2010-07-25 20:30:34

Probably another case of locking issues. Stop all of your virtual machines, exit VirtualBox GUI, wait for 30 seconds and start a virtual machine from the vboxctrl tray helper. When it’s up and running VRDP console menu should be enabled.

mantis2k
2010-08-14 07:09:47

We have the same issue – vrdp is greyed out in the tray helper – this is even after rebooting the host and having just vboxctrl start the guests. We can still use remote desktop client to remote into each guest’s vrdp port though.

2010-08-14 22:42:00

Would you please delete the log file, set LogLevel=3, start the virtual machine from tray helper, wait a bit for it to start and open the tray helper context menu once again. Then show me that log file, vboxctrl.ini config and the versions of the host OS, vboxctrl.exe and vboxctrltray.exe (File version in file properties).

mantis2k
2010-08-14 23:49:25

vboxctrl.exe 0.3.1.88 , vboxctrltray.exe 0.1.1.88 , Windows 7 Home Premium x64

ini

[VBoxCtrl]

VboxInstallPath=G:\Program Files\Oracle\VirtualBox

VboxUserHome=C:\Documents and Settings\staff\.VirtualBox

VmName=pta-vm1

ShutdownCommand=savestate

ServiceName=VirtualBox pta-vm1

Loglevel=3

Priority=Normal

log

[08/14/10 14:42:20] Stopping (savestate) VM ‘pta-vm1′

[08/14/10 14:42:53] VM ‘pta-vm1′ stopped (savestate)

[08/14/10 14:42:53] Closing VirtualBox interface

[08/14/10 14:43:51] VirtualBox Control Service v0.3.1.88 (x64) started

[08/14/10 14:43:51] Initializing VirtualBox interface

[08/14/10 14:43:53] VirtualBox Interface v3.2.6 initialized

[08/14/10 14:43:53] Using VBOX_USER_HOME: C:\Documents and Settings\staff\.VirtualBox

[08/14/10 14:43:53] Starting VM ‘pta-vm1′

[08/14/10 14:43:53] VM ‘pta-vm1′ started

2010-08-15 11:11:55

ok, got that, thank you. Will fix that.

As a temporary measure, use the names of the virtual machines (VmName parameter in vboxctrl.ini) as a section names in vboxctrltray.ini

Your vboxctrltray.ini should look like this:

[pta-vm1]

ConfigFile=path-to\vboxctrl.ini

mantis2k
2010-08-15 19:06:42

Excellent, thanks. We really like the control tray , very handy. One idea for future release – maybe allow multiple VM’s to be configured under one server with one vboxctrl.ini file. But they still could be individually controlled with the control tray…

 
mantis2k
2011-06-21 09:08:44

We just installed vboxctrl on a new machine – vrdp console is not greyed out however nothing happens when we click on it. Does remote desktop have to be disabled on the vm machine (windows 7 pro) for vrdp to work?

2011-06-21 09:16:43

No, but you do have to use a unique port for VRDP.

mantis2k
2011-06-21 18:05:29

We have remote display enabled and set to port 5000. Nothing happens at all wehn we click on vdrp console from the vboxctrl tray icon – should a window popup at least? Thx!

mantis2k
2011-06-21 18:32:40

I am going to try this fix listed here (and also try disabling any firewalls if that doesn’t work):

http://www.urspringer.de/2011/02/26/upgrade-to-virtualbox-4-0-4-ubuntu-host-issues-solved/

 
 
 
 
 
 
 
 
 
 
mantis2k
2010-08-13 22:00:02

Stupid question – but is the tray helper supposed to start automatically with the service or do we need to execute it manually after login? Everything is working great except we don’t have a tray helper icon – win7 home x64 host.

Thanks!

2010-08-14 00:15:50

No, it isn’t. Tray helper should be started manually or autostarted with Windows (‘Autostart on logon’ in the context menu).

 
 
Nardi
2010-08-26 18:58:23

Is there any hope to bring this with VirtualBox version 1.5.6(!) on Windows 2000 Pro(!) system working?

For any help i would be very appreciated.

2010-08-26 19:51:34

Is there any reason why you’re using that old version of VirtualBox?

Nardi
2010-08-27 00:02:53

This is the last version of virtualbox which is supported by Windows 2000. Of course i do not use this OS by choice too, this is what i could get my hands on. Even if i know this Windows version is doomed it is tied with the PC and it has to hang on a “little” bit longer, because of some kind of world crisis. This all is not easy to fix.

2010-08-27 00:21:34

Well, that ain’t gonna be easy, if possible. I will have a look when I get a free ‘minute’.

Nardi
2010-08-27 10:49:50

I can only say thanks in advance and provide with a status report

OS: Windows 2000 SP4 (with all patches available)

VirtualBox version 1.5.6

VboxCtrl Version 0.2.0

ini file:

[VBoxCtrl]

VboxInstallPath=c:\Programme\innotek VirtualBox\

VboxUserHome=c:\Dokumente und Einstellungen\SYSTEM\.VirtualBox\

VmName=Test1

ShutdownCommand=savestate

ServiceName=VBocCtrl_Test1

Loglevel=1

Priority=Normal

VBOX_USER_HOME=c:\Dokumente und Einstellungen\SYSTEM\.VirtualBox\

all files moved from user account at this place (machine(s) work just fine form gui)

log file:

[08/27/10 09:14:47] Service VBocCtrl_Test1 (vboxctrl) installed successfully.

[08/27/10 09:14:56] ERROR creating VirtualBox instance (rc = 0×80004005)

[08/27/10 09:15:19] ERROR creating VirtualBox instance (rc = 0×80004005)

I can register and unregister the service just fine, but as soon i try to start this Service i get a error message ‘Error in Application’ ‘Instruction in 0×00401904″ point to memory 0×00000000′ and a entry in the log

file. Do you know what the error code mean?

I could not resit and had a brief look in the 0.3.1 source code, but have allready trouble to find out which IDE and compiler is used for this project. I have only some very basic knowlege about ‘c’. Maybe you could provide the info how to handle and hwo to compile this project. Hardly i could do the changes myself, but maybe another one can easly add something to this project.

2010-08-27 11:05:04

Don’t even bother trying any version of vboxctrl with VirtualBox 1.5.6. Not going to work.

 
 
 
 
 
 
Larsen
2010-10-15 12:31:05

I got it to work, but the vboxheadless process caused 100% cpu load at the beginning and around 50% after some minutes. The machine is an Intel Xeon 3GHz, 8gb RAM, Windows 2008 Server, 64bit. Same problem with VBoxVmService (http://forums.virtualbox.org/viewtopic.php?f=6&t=4762&p=158260#p158260)

 
esj
2010-10-27 01:19:23

this tool has made it really practical to run multiple machines on a single instance of Windows. The only problem I’m currently having is how to make a backup. I would like to be able to shut down the virtual machines, copy all of them to a callback directory, then turn the machines back on. What’s the best way to do this? Using the virtual box tools or something else?

Thanks

 
geoionescu
2011-03-14 15:41:20

привет,

I’m sucessfully using vboxctrl to start my VM as a service.

I have encountered one (small) problem and I don’t know whether it’s vboxctrl’s fault or VirtualBox’s one:

Everytime the service stops, I’m seeing this in vboxctrl logfile:

[03/15/11 03:06:42] Stopping (acpipowerbutton) VM ‘winxp’

[03/15/11 03:06:42] VM ‘winxp’ was sent a stop signal (acpipowerbutton)

[03/15/11 03:06:47] VM ‘winxp’ was terminated abnormally while stopping (0x000000ff)

The host os is Windows Server 2008 R2 x64

The VirtualBox is v4.0.4

The guest os is Windows XP SP2

Any hints?

2011-03-14 15:55:43

Does this vm power off successfully? You can observe the shutdown process with VRDP console. If it does, you may ignore that log message.

 
 
esj
2011-03-26 05:25:54

everything was running fine until I had a power failure. now, the other three virtual machines startup just fine but the first one fails with this error. Any ideas?

[03/25/11 15:19:51] VirtualBox Control Service v0.3.1.88 (x64) started

[03/25/11 15:19:51] Initializing VirtualBox interface

[03/25/11 15:19:51] VirtualBox Interface v3.2.8 initialized

[03/25/11 15:19:51] Using VBOX_USER_HOME: C:\Users\Remote\.VirtualBox

[03/25/11 15:19:51] Starting VM ‘xp-1′

[03/25/11 15:19:51] VM ‘xp-1′ started

[03/25/11 15:19:52] VM ‘xp-1′ was terminated abnormally (0×00000001)

[03/25/11 15:19:52] Closing VirtualBox interface

2011-03-26 08:21:06

For starters, there’s a newer version of vboxctrl available for you version of VirtualBox.

But anyway, you should try to start this machine from VirtualBox GUI to see the error message, since I don’t believe it has something to do with vboxctrl.

 
 
Peter
2011-04-08 03:31:13

I’m lost. Can’t get it to work on Windows 7 64-bit. I tried both 32 and 64-bit downloads.

Any help would be greatly appreciated.

This is what I get in a log:

[04/07/11 20:28:38] Service VirtualBoxC180 (vboxctrl) installed successfully.

[04/07/11 20:29:00] VirtualBox Control Service v0.4.1.112 started

[04/07/11 20:29:00] Initializing VirtualBox interface

[04/07/11 20:29:01] VirtualBox Interface v4.0.4 initialized

[04/07/11 20:29:01] Using VBOX_USER_HOME: C:\Documents and Settings\Peter\.VirtualBox

[04/07/11 20:29:01] ERROR creating session instance (0×80040154)

[04/07/11 20:29:01] Starting VM ‘core180′

[04/07/11 20:29:01] VM ‘core180′ started

[04/07/11 20:29:01] VM ‘core180′ stopped by itself

[04/07/11 20:29:01] Closing VirtualBox interface

My .ini file is:

[VBoxCtrl]

VboxInstallPath=C:\Program Files\Oracle\VirtualBox

VboxUserHome=C:\Documents and Settings\Peter\.VirtualBox

VmName=core180

ShutdownCommand=savestate

ServiceName=VirtualBoxC180

Loglevel=3

Priority=Normal

2011-04-08 08:48:32

You must use vboxctrl64 build for Windows 7 x64. And the log you provided seems to be from 32-bit.

Peter
2011-04-08 21:55:41

Hi, I tried both…

Here’s output from 64bit version of program:

[04/08/11 14:52:18] Service vboxCore180 (vboxctrl64) installed successfully.

[04/08/11 14:52:42] VirtualBox Control Service v0.4.1.112 (x64) started

[04/08/11 14:52:42] Initializing VirtualBox interface

[04/08/11 14:52:42] VirtualBox Interface v4.0.4 initialized

[04/08/11 14:52:42] Using VBOX_USER_HOME: C:\users\peter\.VirtualBox

[04/08/11 14:52:42] Starting VM ‘core180′

[04/08/11 14:52:42] VM ‘core180′ started

[04/08/11 14:52:43] VM ‘core180′ stopped by itself

[04/08/11 14:52:43] Closing VirtualBox interface

Also the version of VirtualBox I’m using is 4.0.4 r70112.

2011-04-08 22:43:12

Does this vm start with VirtualBox GUI? With log output like that it usually doesn’t. Try to start it with VirtualBox GUI (purge the saved state if any) then stop, exit VirtualBox GUI, wait for at least 10 seconds and try to start the machine from vboxctrltray/service manager.

Peter
2011-04-08 23:04:01

Yes, VM starts clean in the GUI. Still no luck even with vboxctrltray.

Thanks for the help, but for some reason the same config works great on VirtualBox 4.0.2.

Bottom line is, you created a great tool and filled a gap for missing functionality.

2011-04-08 23:58:23

That’s weird. Would you please have a look in the event log for VirtualBox related errors when it didn’t start from vboxctrl? There might be something useful, I hope.

 
 
 
 
 
 
sudhir
2011-05-20 03:12:46

i had been using MS Hyper-V, but my databases (MS-SQL and PostgreSql, running on 2 different VM) are not not very fast (even t hough i have an 8 core, 18 gb memory, 3.6 ghz cpu, with VM on solid state drive) … so i am in the process of switching to Virtual Box to run my VM data servers … i love your program to allow it to run as a service, so even if the power is lost, the services run upon re-starting the host machine …. how do we “open” up the running VM to work on it ? …. i am sure there is a way, i just don’t know how … please advise …. thanks

2011-05-21 10:34:01

you should setup VRDP for your VMs and then use ‘VRDP Console’ menu item from vboxctrl tray helper

sudhir
2011-05-21 14:58:20

i have RDP enabled in the VM … but the VRDP option is grayed out in the system tray … is there a special setting within the VM to allow this to function properly ? …. please advise …. thank you …

2011-05-21 15:08:55

You might be confusing RDP and VRDP here. You need to enable Remote Display in VM settings → Display → Remote Display → Enable Server. And configure a unique port to use for every VM (not 3389, since it might be used for the host). Then, when you start the machine from vboxctrl tray helper you will get VRDP Console menu option available. Also keep in mind locking issues, so the best way is to stop all VMs, wait 10 seconds, run VirtualBox GUI, configure virtual machines, close VirtualBox GUI, wait another 10 seconds and you are good to go.

 
 
 
 
esj
2011-05-20 03:44:32

three ways:

1) shut down from system tray application, restart using virtual box control panel

2) set up remote console port and enable remote console. Restart virtual machine, use remote console tool

3) use remote desktop tool on guest such as go to my PC or cross-link.

There is no advantage to using something like the VNC on the guest itself because if you use a remote console service, you get the same effect

 
Max
2011-05-30 19:03:47

Can you attach/detach a DVD (image or host DVD drive) to a running VM which was started by the VirtualBox Control Service?

2011-05-30 19:23:19

No, you can’t.

 
2011-05-30 19:29:31

Meaning you can’t do that with vboxctrl tray helper. But you can use vboxmanage.exe to acomplish that. Just remember to run it using psexec.

Max
2011-05-30 21:02:41

Thank you. Yes, it works using psexec and vboxmanage, but it is not very convenient. I didn’t find a single line command which does it. Instead I had to write a wrapper script:

set VBOX_USER_HOME=C:\Users\Max\.VirtualBox

“%VBOX_INSTALL_PATH%\vboxmanage” storageattach “name-of-vm” –storagectl IDE-Controller –port 1 –device 0 –type dvddrive –medium %1

which I can then invoke with psexec from an elevanted cmd shell to attach or detach the DVD:

psexec -s -i 0 C:\Users\Max\.VirtualBox\attach-dvd.cmd “filename-of-dvd.iso”

psexec -s -i 0 C:\Users\Max\.VirtualBox\attach-dvd.cmd emptydrive

The easier way is probably to stop the VM using vboxctrl, then attach the DVD through VirtualBox as normal user, and then restart the VM with vboxctrl.

 
 
 
epx
2011-06-08 20:03:23

[06/09/11 02:00:29] VirtualBox Control Service v0.3.3.99 started

[06/09/11 02:00:29] Initializing VirtualBox interface

[06/09/11 02:00:31] VirtualBox Interface v3.2.12 initialized

[06/09/11 02:00:31] Using VBOX_USER_HOME: E:\1111\xfmb\Virtual.Box.v3.2.12R68302\.VirtualBox

[06/09/11 02:00:31] ERROR: Could not find registered VM ‘Windows.XP.Professional’

[06/09/11 02:00:31] Closing VirtualBox interface

2011-06-08 21:05:49

Is there a reason you’re not using VirtuxlBox 4?

Anyway, either you misspelled the vm name in the config, or you didn’t close VirtualBox GUI after creating the vm if you were creating it by the user account. Just reboot the host to be sure.

 
 
2011-07-20 22:40:12

After upgrading to VirtualBox 4.1.0 the service cannot be started up (error code 1067).

Log says:

00:00:05.491 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={53f9cc0c-e0fd-40a5-a404-a7a5272082cd} aComponent={Medium} aText={Medium ‘D:\Virtual Machines\Ubuntu.vdi’ cannot be closed because it is still attached to 1 virtual machines}, preserve=false

When launching VM from GUI everything’s OK.

2011-07-21 20:39:08

Update to vboxctrl 0.4.2, please

2011-07-21 21:01:05

Yes, it’s working! Thanks a lot!

 
 
 
Yuriy
2011-09-02 23:46:32

Without any possible reason every time I try to start virtual machine with tray icon it gives me an “ERROR creating VirtualBox instance (rc = 0×80004002)”. I can start and use machine in the VirtualBox itself without any issues. I run vboxctrl 0.4.2 Any ideas?

2011-09-02 23:52:33

Make sure you are using correct version of vboxctrl. Version 4.2 is for VirtualBox 4.1.x It is not backward compatible.

 
 
SMacedo
2011-09-07 19:24:19

Hi Vu1tur,

I’ld like to thank you for your tool. I know about 6 different ways to auto start VirtualBox on Windows Hosts, only a few as a service, but they are awkward or buggy (VBoxVmService is nice but very very buggy installation process and fails with spaces on paths; only by browsing the code can one understand what’s happening).

And, needless is to say that such tool should obviously be provided by Oracle / Sun / VirtualBox ! It’s actually embarrasing that they have a Virtualization solution that does not start at boot time!! almost a joke…

With VBoxCtrl, it was download and install under 3 minutes. (running debian on VBox 4.1.2 under Windows 7 64 and Windows 2003 Server)

Well done!

You should accept paypal donations ! How can we pay you back?

Thanks

SMacedo

2011-09-07 21:29:50

Hey,

Well, thank you kindly. And yes, Oracle is definitely the one who should be providing this functionality. Although, seeing how different workstation and server versions of other virtualization platforms are, I think there’s more to it then just starting a VM as a service.

As to donations, seeing my work being useful and appreciated is good enough for me. And Paypal does not provide payment receiving in my country anyway :)

 
 
Anthony Field
2011-11-07 04:30:15

Having Issues using this software <:)

I have a vbox called EFTPOS Server XP PRO located at D:\BACKUP – DONT USE – EFTPOS Server XP PRO\BACKUP – DONT USE – EFTPOS Server XP PRO.vbox

I have configured like so:

[VBoxCtrl]

VboxInstallPath=C:\Program Files\Oracle\VirtualBox

VboxUserHome=D:\BACKUP – DONT USE – EFTPOS Server XP PRO\

VmName=BACKUP – DONT USE – EFTPOS Server XP PRO

ShutdownCommand=acpipowerbutton

ServiceName=VirtualBox EFTPOS

Loglevel=1

Priority=Normal

I start the Service using vboxctrl64.exe -i

I then Open the Vboxctrltray.exe ( I can then see a icon near the clock )

I right click, then select the Vbox Machine, then click start. Although It does not work.

I get this error in the vboxctrl64.log.,…

[11/07/11 13:29:22] ERROR creating VirtualBox instance (rc = 0×80004002)

?? Any idea's ??

2011-11-07 07:48:40

First of all, you should set your VboxUserHome option to C:\Documents and Settings\[username]\.VirtualBox

And then make sure you are using 64-bit host OS and a correct version of vboxctrl service.

 
 
Andrea
2012-02-01 13:31:41

Where is the “donate with PayPal” button? You save my day, thank you!

ps. works perfectly on Windows Web Server 2008 R2 SP1

SMacedo
2012-02-01 16:46:13

I’ve tried too! But there is no paypal in Russia(?).

Would this work? http://www.atmcash.com ? Costs $33 to send $25… :)

 
 
Aravind
2012-02-06 21:36:03

Works perfectly. Setting the .ini files to use %VBOX_INSTALL_PATH% & %VBOX_USER_HOME% didn’t work and the system event log didn’t make sense at all. I was almost going to give up.

But then tried to specify actual path in the ini files instead of environment variables and (also after setting the environment variables above did a reboot). It worked like a charm.

2012-02-07 09:31:46

Oh, yes, environment variables are not handled in the config file. Sorry for the confusion. Glad you worked it out.

Aravind
2012-02-16 21:15:20

Didn’t mean to complain. Just thought of documenting it for your subscribers sake.

 
 
 
Kevin
2012-02-16 18:28:45

Works flawlessly on 64-bit Windows 7.

Thanks.

 
cszolee79
2012-03-11 13:17:54

Yay, it wors perfectly under Win 2008R2 Foundation too.

Thank you for the fine work, vu1tur! :)

 
Wanderer
2012-04-10 21:53:07

What about 4.1.8 and major versions of VirtualBox support?

Has tryed fresh and had to downgrade to 4.1.6 as working one with vboxctrl 0.4.2.

4.1.12 OVB has already released and I can’t upgrade hypervisor. It’s sad.

2012-04-10 22:21:28

Both 4.1.8 and 4.1.12 work just fine with vboxctrl 0.4.2.

There are probably some other issues (other than version mismatch) if you can’t get it working. You should provide some debug logging to have a look at.

 
 
Wanderer
2012-04-11 07:53:43

4.1.6 VM service starts fine.

4.1.12 VM log: [04/10/12 23:04:56] VM ‘vm1.1′ was terminated abnormally (0×00000001)

config for vboxctrl:

[VBoxCtrl]

VboxInstallPath=C:\Program Files\Oracle\VirtualBox

VboxUserHome=C:\Users\Wanderer\.VirtualBox

VmName=vm1.1

ShutdownCommand=savestate

ServiceName=VirtualBox vm1

Loglevel=1

Priority=Normal

used versions:

Windows7 64bit sp1

vboxctrl 0.4.2.114

Difference is only in version of oracle virtualbox.

2012-04-11 10:03:43

‘VM was terminated abnormally’ means that the virtual machine itself didn’t start correctly. You should inspect Event Log for errors from VritualBox. Also, you need to make sure you can start the VM from the VirtualBox GUI. The problem might be simple like missing extension pack update.

Wanderer
2012-04-11 15:03:38

It is really problem in the virtual machine. It crashes in GUI. I just tested another one in major versions of OVB and it was working, but VM, wich I start from vboxctrl, really doesn’t work in GUI too. Many thanks for advice.

 
 
 

Name (required)
E-mail (required, never shown publicly)
OpenID
Your Comment (smaller size | larger size)