-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Source code was no longer included in setup package * Dropped xp/2k3 campatible mode. It's just too old to support.
- Loading branch information
Showing
15 changed files
with
265 additions
and
687 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
*.exe | ||
Output | ||
build | ||
build_x64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# CMake version | ||
cmake_minimum_required(VERSION 3.4) | ||
|
||
# define project | ||
project (VBoxVmService) | ||
|
||
file(GLOB util_SRC "src/util.*") | ||
add_library(util ${util_SRC}) | ||
|
||
# VBoxVmService | ||
file(GLOB VBoxVmService_SRC "src/VBoxVmService.*" "src/VBoxVmPipeManager.*" "src/VirtualBox*.*") | ||
add_executable(VBoxVmService ${VBoxVmService_SRC}) | ||
|
||
# VmServiceControl | ||
file(GLOB VmServiceControl_SRC "src/VmServiceControl.*") | ||
add_executable(VmServiceControl ${VmServiceControl_SRC}) | ||
|
||
# VmServiceTray | ||
file(GLOB VmServiceTray_SRC "src/VmServiceTray.*") | ||
add_executable(VmServiceTray ${VmServiceTray_SRC}) | ||
foreach (BUILD_TYPE DEBUG RELEASE) | ||
set_target_properties(VmServiceTray PROPERTIES LINK_FLAGS_${BUILD_TYPE} "/SUBSYSTEM:WINDOWS,6.01") | ||
endforeach() | ||
|
||
foreach (EXE VBoxVmService VmServiceControl VmServiceTray) | ||
target_link_libraries(${EXE} util) | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
## Change log | ||
|
||
### 2018-10-28 Move code to GitHub | ||
|
||
Hope this will make it easier for other people to contribute to this project, by sending pull requests. | ||
|
||
### 2017-10-19 Release 5.2 "Jujube" | ||
* Updated COM API to make it work with VirtualBox 5.2. Note this is not compatible with old versions of VirtualBox. If you need to use VirtualBox 5.1.X, please stay with 5.1 "Plum". | ||
|
||
### 2016-07-14 Release 5.1 "Plum" | ||
* Updated COM API to make it work with VirtualBox 5.1. Note this is not compatible with old versions of VirtualBox. If you need to use VirtualBox 5.0.X, please stay with 5.0 "Litchi". | ||
* Enable xp/2k3 campatible mode. | ||
|
||
### 2015-07-11 Release 5.0 "Litchi" | ||
* Updated COM API to make it work with VirtualBox 5.0. Note this is not compatible with old versions of VirtualBox. If you need to use VirtualBox 4.3.X, please stay with 4.1 "Ginger". | ||
* Changed VBOX_INSTALL_PATH to VBOX_MSI_INSTALL_PATH. | ||
* During installation, will try to guess out correct VBOX_USER_HOME when HOME environment variable is set. | ||
* Project is now built with Visual Studio 2013 Express. | ||
|
||
### 2013-10-16 Release 4.1 "Ginger" | ||
|
||
* Updated COM API to make it work with VirtualBox 4.3. Note this is not compatible with old versions of VirtualBox. If you need to use VirtualBox 4.2.X, please stay with 4.0 "Bayberry". | ||
|
||
### 2013-06-23 Release 4.0 "Bayberry" | ||
|
||
* Updated doc about trouble shooting steps. | ||
* Return detailed description instead of error code. | ||
* Added a GUI installer created with InnoSetup. | ||
* Exe files are no longer saved in git repository. | ||
* The long wanted system tray icon feature was finally implemented. The newly added VmServiceTray.exe works as the GUI counterpart to VmServiceControl.exe, it shows all configured VMs and their states, allows single VMs to be started/stopped. It can also be used to start/stop VBoxVmService directly (with UAC elevation on Vista and later). | ||
* Moved folders up to one level. | ||
* Added a new command "VmServiceControl -l" to list all VMs' states. | ||
* Removed ServiceName option from config file for simplify purpose. There is no need to change this anyway. | ||
* Project is now built with Visual Studio 2012 Express. | ||
|
||
### 2012-09-15 Release 3.1 "Coconut" | ||
|
||
* Updated COM API to make it work with VirtualBox 4.2. Note this is not compatible with old versions of VirtualBox. If you need to use VirtualBox 4.1.X, please stay with 3.0 "Sweet Potato". | ||
* Service now runs (again) as LocalSystem account by default. | ||
* Allow additional parameters to be set for VBoxWebSrv.exe. | ||
* Service is no longer set to DelayedAutostart. It's now Autostart and depends on Workstation and COM+. | ||
* Fixed a bug in sending pipe commands: need to write an additional null byte at end of message; | ||
* Removed pipelcat to simplify pipe comminucation; | ||
* Fixed compile warnings. | ||
|
||
### 2011-11-29 Release 3.0 "Sweet Potato" | ||
|
||
* Force reloading INI file when VBoxVMService commands are executed; | ||
* Always try to stop all configured VMs when service is stopped. | ||
* Patch from Scholar Team and Harold Roussel: allow VBoxWebSrv.exe to run when VBoxVmService starts, giving access to the currently running virtual machines via phpVirtualBox. | ||
* Calling VirtualBox COM API directly instead of using VBoxManage.exe. | ||
* Service now runs as normal user, with username and password configed in VBoxVmService.ini. | ||
|
||
### 2011-07-21 Release 2.3 "Watermelon" | ||
|
||
* Always require a reboot after installation; | ||
* Reuse VRDP settings from VirtualBox Manager, and don't call modifyvm to change port anymore; | ||
* Added an AutoStart option to control if a VM will be started automatically when VBoxVmService runs; | ||
* Show full command line including path during log; | ||
* Fixed a bug that meaningless chars are printed to log; | ||
* Set service to delayed auto-start if possible. | ||
|
||
### 2011-01-13 Release 2.2 "Fireworks" | ||
|
||
* Update to make VBoxVmService work with VirtualBox 4.0. Note this is incompatible with old versions of VBox, so stay with "Reindeer" if you are still running VBox 3.X.X. | ||
|
||
### 2010-12-24 Release 2.1 "Reindeer" | ||
|
||
* PauseShutdown now became global setting. When service is stopped, it doesn't make sence to wait VM0 to shutdown, then VM1, then VM2, ..., etc. Now all the VMs will start shutting down at once, and all are expected to finish within time specified as PauseShutdown. | ||
* Added too way communication between the service and control program. Show service output after control command get executed. | ||
* Added new commands to show current VM status and check service environment. | ||
* Better input sanitizing. | ||
|
||
### 2010-09-04 Release 2.0 "Red Dragon" | ||
Changes since version rel20100817-win7 | ||
|
||
* Removed all the batch files and call VBoxManage.exe directly at VBoxVmService. | ||
* Added VmServiceControl.exe to do all the controlling job and VBoxVmService.exe now become a pure service program. | ||
* Reworked some of the documentation. | ||
* Dropped some parameters from the ini-file, please review Howto.txt for a list of currently valid options | ||
|
||
### Changes since version rel20091210-win7 | ||
|
||
* VBOX_USER_HOME will now be set up during the installation process. | ||
* Minor improvements on the overall code. | ||
* Simplified the overall installation procedure. | ||
* Reworked some of the documentation. | ||
|
||
|
||
### Changes since version rel20091103-win7 | ||
|
||
* Support for the VBOX_USER_HOME environment variable has been added. | ||
* Hardlinking was dropped from install procedure. | ||
* Documentation was reworked. | ||
|
||
|
||
### Changes since version rel20081010 | ||
|
||
* Windows 7 support has been added. Thanks to user FB2000 for his patches and his extensive research regarding that topic! | ||
|
||
|
||
### Changes since version rel20081009 | ||
|
||
* There have been errors while putting together the package. This Release was recalled! | ||
|
||
|
||
### Changes since version rel20080728 | ||
|
||
* Improved the event-logging to VBoxVmService.log. It will now capture the response messages from the VirtualBox components. | ||
* A PARAMETER NAME WITHIN THE FILE VBoxVmService.ini HAS BEEN CHANGED: PLEASE RENAME THE PARAMETER FROM "PathToVBoxVRDP" TO "PathToVBoxHeadless" IF YOU ARE UPGRADING FROM AN EARLIER VERSION AND ARE PLANNING TO USE YOUR OLD INI-FILE! | ||
|
||
|
||
### Changes since version rel20080422 | ||
|
||
* Added a BRUTEFORCE option to the startup-calls. This will kill any possibly remaining run- or lockfiles for a VM before startup. | ||
* The files startup and shutdown now save all their outputs to the logfile. | ||
|
||
|
||
### Changes since version rel20080308 | ||
|
||
* A german documentation has been created and the documenation has seen an overall update. | ||
* A new option has been added to the .INI-File, enabling the individual configuration of | ||
* the VRDP-ports of virtual machines for remote administration purposes. | ||
|
||
|
||
### Changes since version rel20080223 | ||
|
||
* For the helper application "bat2exe.exe" (by Fatih Kodak) was getting false positives on several antivirus systems, it has been substituted by "bcompile.exe", which should work without further problems. The sourcecode of "bcompile.exe" can be found underneath the "src\c#\"-subdirectory. For it had to be a quick solution, there is a small issue with undeleted temp-files piling up in the temp-folder. This will be taken care of in the next upcoming release. | ||
|
||
* I added a "StartupMethod" flag to the .INI-file to support as well VRDP and SDL (the VM- controller of the OSE (Open Source Edition)). Thanks to 'Technologov' at the VirtualBox Forums for triggering that! Yet, SDL support is still sort of buggy and needs some more time and review... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# VBoxVmService | ||
|
||
### 1. What is VBoxVmService? | ||
|
||
VBoxVmService is a Windows Service, that enables the host-system to run or shutdown VirtualBox Virtual Machines (VMs) without a user being logged on to the host-system running Windows (Win7/Win8/Win10/2012/2016, both x86 and x64 supported). | ||
|
||
### 2. So why did you create it? | ||
|
||
First off: I think, VirtualBox is a great piece of software. But it lacks one feature that I really wanted: A method to operate my VMs controlled by a service and not having to log on to the host-system to be able to start or shutdown the software. | ||
|
||
Looking for a solution, I went to the VirtualBox forums - just to find that many other users where looking for a way to do the exact same thing. | ||
|
||
There are some methods out there to automate the start of virtual machines at the event of a user logon (like placing a registry entry to call a startup batch file in | ||
|
||
"[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]" | ||
|
||
, or simply to create a link to start a VM in your startup-folder. | ||
|
||
(More on this topic can be found here: http://www.bleepingcomputer.com/tutorials/tutorial44.html) | ||
|
||
But since this was not exactly what I had in mind, I started to google - hoping to find some easy solution to my problem. But I was out of luck. What I did find, was an interesting article, written by Xiangyang Liu and issues on codeproject.com. | ||
|
||
He described a method of running regular programs as NT Services. And alongside all the useful infos, the article (found here: http://www.codeproject.com/KB/system/xyntservice.aspx ) featured a built and ready to use version of the wrapper-service described, plus a complete set of sourcecodes. So, Bingo then? Well, ... not yet. :-( | ||
|
||
I found the problem to be, that VirtualBox is not just one executable program, but consists of a host-service ("VBoxSVC.exe") and a set of tools and subservers to control and interact with the actual Virtual Machines. To make this a quick one: It just didn't work. | ||
|
||
In the end, I found myself spending some three or four nights reading about the concepts of windows' authorization methods on MSDN and taking a quick dive into general C++ programming, to understand Xiangyang Liu's code. | ||
|
||
Finally I got some basic understanding of what Xiangyang's code was doing and I managed to patch it, adding a method to safely shutdown running VMs when the master process is called to terminate. | ||
|
||
To get around such set-backs as pathvalues or VM-names containing blanks, or finding a way how to obtain the needed administrative rights to run VirtualBox, I added some great tools I found on the Internet, while looking for other things. *gg* | ||
|
||
And guess what? It finally worked! So here it is! :-) | ||
|
||
|
||
### 3. How does it work? | ||
|
||
Basically, VBoxVmService is just a wrapper-service that calls VirtualBox COM API interfaces. | ||
|
||
When windows starts up, the wrapper-service will start running. It will check for the settings in VBoxVmService.ini file, and call up the Virtual Machines as specified. Both the wrapper-service and Virtual Machines are run with the account specified in the VBoxVmService.ini file. | ||
|
||
If RunWebService=yes is specified in VBoxVmService.ini file, the wrapper-service will also try to start VirtualBox web service automatically. This might be useful for people who use the web service a lot, like users of phpVirtualBox. | ||
|
||
When windows shuts down, the wrapper-service will try to stop all the VMs configuered in VBoxVmService.ini. | ||
|
||
VmServiceControl.exe is the CLI (command line interface) client that sends control commands to VBoxVmService and display returned results. | ||
|
||
VmServiceTray.exe is another client like VmServiceControl.exe, but comes with GUI interface and stays in system tray. | ||
|
||
If you are interested in further details, feel free to browse the supplied source codes! | ||
|
||
|
||
### 4. What are the plans for the future? | ||
|
||
Actually, there are no plans for future releases of this software, other than keeping it updated so that it can always work with latest version of VirtualBox. | ||
|
||
|
||
### 5. Which versions of Windows are supported? | ||
|
||
It hasn't been fully tested on systems other than Windows 7, Windows 8 and Windows 10, but it is supposed to work on server systems like Win2012, Win2016, ... etc, both 32bit and 64bit versions. | ||
|
||
|
||
### 6. Will VBoxVmService run on Mac OS-X or Linux? | ||
|
||
No. VBoxVmService is specially designed to suit the Windows operating system. And it doesn't need to run on Mac OS-X or Linux because these platforms supply adequate features to accomplish the same effect. | ||
|
||
|
||
### 7. Credits | ||
|
||
The VBoxVmService was based on sourcecode originally written by Xiangyang Liu and published on codeproject.com ( http://www.codeproject.com/KB/system/xyntservice.aspx ). | ||
|
||
The puzzlework on "how the %$&!? this thing works", (poorly) patching together the C++ code of VBoxVmService and the helper tool "sleep.exe", messing with some c# for "bcompile.exe" plus all the batch-scripting was done by Mathias Herrmann (mherrmann at assetive dot com). | ||
|
||
Only Fang (aka FB2000) joined the project in August 2010, and had become main contributor since then. He re-designed the service, added VmServiceControl.exe to do all the controlling job and changed VBoxVmService.exe to become a pure service program. | ||
|
||
Runar joined the project in December 2010, bringing lots of creative improvements like two way communication between the service and control program, new commands to show current VM status and check service environment, etc. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@echo off | ||
@echo setup build environment | ||
if defined VS120COMNTOOLS call "%VS120COMNTOOLS%vsvars32.bat" | ||
|
||
if not exist build mkdir build | ||
cd build | ||
cmake .. | ||
msbuild VBoxVmService.sln /p:Configuration=Release;Platform=Win32 /m | ||
cd .. | ||
|
||
if not exist build_x64 mkdir build_x64 | ||
cd build_x64 | ||
cmake .. -G "Visual Studio 12 2013 Win64" | ||
msbuild VBoxVmService.sln /p:Configuration=Release;Platform=x64 /m | ||
cd .. | ||
|
||
"C:\Program Files (x86)\Inno Setup 5\ISCC.exe" setup.iss |
Oops, something went wrong.