VirtualBox Control Service
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 is done via .ini file with the same name as the service executable. A default configuration file is included in distribution archive.
|VboxInstallPath||Set this to a folder where VirtualBox is installed|
|VboxUserHome||Set this to a location of your .VirtualBox homedir|
|VmName||The name of the virtual machine this service will control|
|ShutdownCommand||The command used to shutdown a VM: poweroff, savestate, acpipowerbutton, acpisleepbutton|
|ServiceName||An optional service display name|
|Loglevel||Log level: 0=Disabled, 1=Enabled, 2=Verbose, 3=Debug|
|Priority||Priority 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.
Place vboxctrl.exe and vboxctrl.ini in a folder of your choice.
To install a service run:
To uninstall a service run:
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 -uto 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.
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.
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.
- 0.5.1VirtualBox 5.1 support. Not backward compatible.
- 0.5.0VirtualBox 5.0 support. Not backward compatible.
- 0.4.7VirtualBox 4.3 support. Not backward compatible.
- 0.4.6Fixed a bunch of bugs introduced with implementing event based UI updates.
- 0.4.5Fixed VBOX_USER_HOME not being correctly set in some cases.
A bit faster tray helper UI by using event based updates.
- 0.4.4Configurable update check at startup. See vboxctrltray.ini.
- 0.4.3VirtualBox 4.2 support. Not backward compatible.
- 0.4.2VirtualBox 4.1 support. Not backward compatible.
- 0.4.1Added an option to select one-time shutdown action from the tray helper menu;
Added checking for updates.
- 0.4.0VirtualBox 4.0 support. Not backward compatible.
- 0.3.3Fixed yet another bug in communication between tray helper and service.
- 0.3.2Fixed 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.1New feature: open VRDP console from tray helper;
Fixed tray icon disappearing on explorer crash.
- 0.3.0Added tray helper application to control vboxctrl services.
- 0.2.1Updated 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.0Completly 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.1Fixed incorrect handling of shutdown signal.
- 0.1First public release.
Version 0.5.1 (for VirtualBox 5.1.x):
32-bit: vboxctrl-0.5.1.zip [73.4 KB] (sha1: 18a47449f81fe1bdb00db2f4c7d86ec5aab31fe1)
64-bit: vboxctrl64-0.5.1.zip [75.9 KB] (sha1: 90668d16250536a86cb7db0d307151caf47e713f)
source: vboxctrl-0.5.1-src.zip [257.1 KB] (sha1: 027a19193570dbe0cb8600a4f69f02f47feff086)
Version 0.5.0 (for VirtualBox 5.0.x):
32-bit: vboxctrl-0.5.0.zip [72.7 KB] (sha1: bf01e8afa59ef8f0c1238fec3ae15744e1bfd42c)
64-bit: vboxctrl64-0.5.0.zip [75.2 KB] (sha1: 3d2d68feba7eff60a33b2a885e5b57fed7d764f4)
source: vboxctrl-0.5.0-src.zip [199.3 KB] (sha1: e67cb20f58b4f3fb63ba6480b5f750b0b812c616)
Version 0.4.7 (for VirtualBox 4.3.x):
32-bit: vboxctrl-0.4.7.zip [72.7 KB] (sha1: 8deb3caf754b5a5fadfd2e04d327fd10ac51020e)
64-bit: vboxctrl64-0.4.7.zip [75.2 KB] (sha1: 9fa88ced4b8f19278c345373226d6b892b37adde)
source: vboxctrl-0.4.7-src.zip [199.3 KB] (sha1: 0211f8bca3489192aef2116aa724251f24ee8472)
Version 0.4.6 (for VirtualBox 4.2.x):
32-bit: vboxctrl-0.4.6.zip [72.7 KB] (sha1: 369444b19b27cca0347e8d1a2220624144f15803)
64-bit: vboxctrl64-0.4.6.zip [75.2 KB] (sha1: 6b310fa072b99c37c0d0889e498ccca3e45a8183)
source: vboxctrl-0.4.6-src.zip [199.3 KB] (sha1: ce4d26a23b5cb81b06bddede5ede4fa455b05d33)
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):