You are on page 1of 4

############################################################################## # # PART I - SETUP # ############################################################################## Step 1.

Make sure VirtualBox has been installed and your VMs can be started from VirtualBox Manager without any problem. Shutdown the VMs and close VirtualBox M anager. IMPORTANT: If you want to control your VMs with VRDP, enable remote display at d isplay settings and assign a dedicated port for each individual VM (e.g. use: 30 10 for Vm0, 3020 for Vm1, etc.). Do NOT use the standard port 3389! Step 2. Download and unzip the latest release of VBoxVmService to c:\vms. Step 3. Open up VBoxVmService.ini with a texteditor of your choice and modify it to fit your needs. The file contains an example setup with two virtual machines . Key / Value pair Description ----------------------------------------------------------------------------[Settings] ServiceName=VBoxVmService The service name to use for the VBoxVmService. RunAsUser=DomainName\UserName The name of the acco unt under which the service should run. The service process will be logged on as this user. If the account belongs to the built-in domain, you can specify .\Use rName. UserPassword=xxxxxxxx MUST BE GIVEN! SET T HE INI FILE TO BE ONLY READABLE BY YOURSELF AND THE SYSTEM! VBOX_USER_HOME=C:\Users\YOUR_NAME_HERE\.VirtualBox The actual path to y our user's .VirtualBox directory. It is usually located in your users' personal folder. RunWebService=no Whether or not start up VBoxWebSrv.exe, the VirtualBox HTTP web service automatically. Could be "yes " or "no". Leave it to "no" if you don't know what it is. PauseShutdown=5000 A pause parameter to slow down the Windows shutdown process and to prevent VMs from crashing on shut down/reboot. (5000 = 5 seconds) Note Windows has a limit to how long the service controller could wait when system reboots. The time limit is specified in the W aitToKillServiceTimeout value of the following registry key: HKEY_LOCAL_MACHINE\ SYSTEM\CurrentControlSet\Control. Your PauseShutdown value should never exceed t his time limit. [Vm0] VmName=ubuntu The name of the VM t o start (case sensitive!) ShutdownMethod=savestate The shutdown method ("savestate", or "acpipowerbutton"). When "savestate" is used, the machine state is saved and will be resumed when you start VM next time. When "acpipowerbutton " is used, as long as client OS support it, the VM will get a clean shutdown. If your VM takes long time to poweroff, it's recommanded to use savestate, which c ould be done very quickly. AutoStart=yes Whether or not this VM will be started automatically, when VBoxVmService runs. Default to "yes". [Vm1] VmName=winxp As you can see, the

above values almost repeat for every [VmX] section of the file. ShutdownMethod=acpipowerbutton AutoStart=no This VM will not be started automatically.

############################################################################## # # PART II - INSTALLATION # ############################################################################## Step 1. (for WINXP / SERVER2003) Launch CMD (Command Prompt) from your start men u. Step 1. (for VISTA / SERVER2008 / WIN7) Right-click on CMD (Command Prompt) and choose "Run as Administrator" from the context menu. Step 2. Install the service. Within the terminal window type: cd C:\vms VmServiceControl.exe -i Step 3. Reboot your system. If everything goes on right, you could now connect to your VMs with VRDP clients (or ssh clients, if you've configured ssh server inside your VM). If not, refer to TROUBLESHOOTING section below for how to debug. ############################################################################## # # PART III - UNINSTALL # ############################################################################## Step 1. (for WINXP / SERVER2003) Launch CMD (Command Prompt) from your start men u. Step 1. (for VISTA / SERVER2008 / WIN7) Right-click on CMD (Command Prompt) and choose "Run as Administrator" from the context menu. Step 2. Stop the VBoxVmService service. Within the terminal window type: cd C:\vms VmServiceControl.exe -k [ENTER] [ENTER] [ENTER] [ENTER]

Note: you could also stop the service from Computer Management Console in Contro l Panel. Step 3. Uninstall the service. Continue in the terminal window type: VmServiceControl.exe -u [ENTER]

Step 4. Delete the installation directory (in this example "c:\vms"). Step 5. You are done uninstalling VBoxVmService from your system. ############################################################################## # # PART IV - TROUBLESHOOTING # ############################################################################## If the service does not bring your VMs up as desired, try this: Carefully re-check the settings you made in "VBoxVmService.ini". Reduce the number of VMs in your ini file to one (= only have the section [Setti ngs] and the section [Vm0] in your ini-file) in your ini-file, for debugging. Switch to a command prompt, cd to the VBoxVmService directory and type: VmServiceControl.exe -su 0 [ENTER]

to bring up the VM you set up in the section [Vm0] of the "VBoxVmService.ini" fi le. If you have successfully started a VM, you should end up with a "VBoxHeadless.ex e" process, running as the impersonated user (check in task manager). The command: VmServiceControl.exe -sd 0 [ENTER]

can be used to check the output, generated by the steps of a shutdown process ta rgeting [Vm0]. Afterwards, there should be no running "VBoxHeadless.exe"-process . Additionally, you should see a "VBoxSVC.exe"-process terminating shortly after a successful shutdown of "VBoxHeadless.exe". And the command: VmServiceControl.exe -st 0 [ENTER]

can be used to check the statue of the VM targeting [Vm0]. Read the log-file! If you see error like "Could not find a registered machine named...", check if t he environment variable VBOX_USER_HOME has been setup correctly. If you made a mistake on VBOX_USER_HOME, however, fixing it at VBoxVmService.ini is not enough. Because the value was get written into environment variable duri ng installation. You need to open Control Panel -> System -> Advanced system set tings -> Advanced -> Environment Variables, and fix it there. Please also make s ure VBOX_USER_HOME appears only at system variables, not user variables. After installation and everytime when you changed VBOX_USER_HOME later, a system reboot is required to get VBoxVmService work correctly. So give it a try if you haven't. If you are still in trouble, you are welcome to create a support ticket at https ://sourceforge.net/tracker/?group_id=219058&atid=1045322. We might be on Virtual

Box's official forums now and then, so feel free to contact us there, too. The VBoxVmService Development Team Mattz, FB2000 and Runar

You might also like