VirtualBox as Service (Java code with Apache's Procrun)

Discussions related to using VirtualBox on Windows hosts.
Post Reply
egoz
Posts: 3
Joined: 3. Nov 2009, 18:40
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian

VirtualBox as Service (Java code with Apache's Procrun)

Post by egoz »

I post this in the srvany topic before, then I thought I should create a new topic. I read about Apache Daemon's Procrun here :http://blog.platinumsolutions.com/node/234. And the result is awesome, I can use

Code: Select all

net stop <service_name>
to stop my VM and run without restart with VirtualBox.exe

I attached my program, and you need Java to use it It needs refactoring and documentation (License I guess) though.

To use it you must set JAVA_HOME environment variable, then edit the config/vboxprocrun.properties. Here is mine:

Code: Select all

startupCommand= C:\\Program Files\\Sun\\VirtualBox\\VBoxHeadless.exe -startvm Debian
shutdownCommand= C:\\Program Files\\Sun\\VirtualBox\\VBoxManage.exe controlvm Debian savestate
vBoxDir= C:\\Program Files\\Sun\\VirtualBox\\
dateFormat=[dd-MM-yyyy HH:mm:ss] 
Then, in the VBoxProcrun directory type:

Code: Select all

vboxprocrun.bat install [service_name]
Service_name isn't mandatory, and Voila! It's done. To start and stop, you could use service manager or "net start" and "net stop".

and to remove the service, you could type:

Code: Select all

vboxprocrun.bat remove [vmname]
Sorry for my bad English, and feed backs are appreciated.
Attachments
VBoxProcrun.zip
(66.04 KiB) Downloaded 113 times
Post Reply