Virtualbox-logo.png

VirtualBox is a powerful desktop virtualization software for software developers/testers and enterprise IT professionals that runs multiple operating systems simultaneously on a single PC. So why run a VirtualBox virtual machine (VM) as a Windows service under FireDaemon Pro?

  1. Normally, VirtualBox VMs can only be started manually after a user has logged in. FireDaemon Pro allows you to start one or more virtual machines in the background prior to logging in at system boot or reboot.
  2. Allows multiple VMs to be suspended or stopped when the host machine is shutdown or rebooted
  3. Allows individual VMs virtual machines to be bound to specific processors or cores
  4. Use FireDaemon Pro as a centralised VirtualBox VM launcher.

VirtualBox VM Configuration Under FireDaemon Pro

Before commencing configuration please read our general notes in regard to service setup.


Step 1: Prepare Your Machine

Make sure your machine is ready to run VirtualBox:

  • Check your BIOS to ensure VT-x or AMD-V is enabled
  • Check your BIOS and enable hyperthreading if your processor supports it. This will give you two architectural states per processor core.
  • Make sure the Hyper-V role has been uninstalled via Windows Features in the Control Panel. VirtualBox will not be able to run with it enabled as Hyper-V reserves the necessary hardware features required by VirtualBox

Step 2: Download and Install VirtualBox

Download and install VirtualBox plus the VirtualBox Extension Pack into the directory of your choice (e.g. C:\Program Files\Oracle\VirtualBox). Install as a local or domain administrator.


Step 3: Install Your VM

Start the VirtualboxManager and create a new virtual machine using the Create Virtual Machine wizard deciding minimally the VMs name, operating system type, memory size, hard disk size and networking type. Attach your guest operating system ISO to the VM, then install the guest OS, apply required patches and finally install the Virtual Box Guest Additions inside the VM.


IMPORTANT: after you have completed the setup of the virtual machine ensure it is shutdown and powered off prior to moving on to the next step.


virtualbox-setup-1.png


Step 4: Download and Install FireDaemon Pro

Download and install FireDaemon Pro. Install as a local or domain administrator.


Step 5: Set FireDaemon Pro Service Program Properties

Start FireDaemon Pro by double clicking the desktop icon and then click on the "Create a new service definition" button in the toolbar or type Ctrl+N. Enter the information in the fields as you see below.



The Executable is the path to the VirtualBox.exe file. For the purposes of this HOWTO, that path is C:\Program Files\Oracle\VirtualBox\VirtualBox.exe.


The Working Directory is the directory containing the VirtualBox.exe file. For the purposes of this HOWTO, that path is C:\Program Files\Oracle\VirtualBox


The Parameters field determines which VM you wish to start. The -startvm option powers on the virtual machine called "CentOS 7". Ensure the VM's name is enclosed in double quotes. Change the VM name to whatever you called your VM.

If you wish to start your VM in headless mode, change the Executable to C:\Program Files\Oracle\VirtualBox\VBoxHeadless.exe. Also read up on VRDP when running in headless mode.


The Startup Mode should ideally be Automatic (Delayed Start). When you machine boots / reboots, the VirtualBox service will be started much later in the boot cycle.


At this point it's important to note that a VirtualBox VM run under FireDaemon Pro control cannot be controlled by the VirtualBox Manager. If you need to control the VM via the VirtualBox Manager, shut down your FireDaemon Pro service.


Step 6: Set FireDaemon Pro Service Settings Properties

Ensure you have Interact with Desktop check. You must run your VM as a local or domain administrator. The user account must have a password. Enter the password in the Password and Confirm Password fields.


Step 7: Set FireDaemon Pro Service Lifecycle Properties

Ensure you have Graceful Shutdown checked in the Lifecycle tab.


Step 8: Set FireDaemon Pro Service Pre / Post-Service Properties

On the Pre / Post-Service tab you now need to run two Post-Service programs. These programs will take care of shutting down the VM when the service is stopped. The first pauses the VM. The second saves the state of the VM.


To run Post-Service programs click on the Append button and enter both as follows adjusting the name of the VM. This Post-Service pauses the VM. Please ensure you set Run Program to Before Event.



This Post-Service saves the state of the VM. Again, please ensure you set Run Program to Before Event.




Step 9: Install the FireDaemon Pro Service

Now click OK. Your service should install and your VM should start on Session 0 under FireDaemon Pro control. Should it not start, check the Windows Event Log and VirtualBox VM text logs for errors. The text logs are typically found in the VM's directory (e.g. C:\Users\jbourne\VirtualBox VMs\CentOS 7\Logs).


You will need to switch to Session 0 to see your virtual machine running. Click on the Session 0 button in the FireDaemon Pro toolbar or download and install the FireDaemon Session 0 Viewer.


Performance Tuning VMs

Here are some tips for performance tuning VirtualBox VMs when run under FireDaemon Pro control. Your mileage may vary.


As the Host Level (i.e. your PC)

  • Buy more RAM!
  • Make sure you defragment the guest OS and the file system on which the guest OS resides from time to time
  • Install your guest OS on an NTFS partition with a big cluster size (ie. > 4096). This will make loading the guest OS much faster.
  • Set DisablePagingExecutive in the registry to 1. This stops the NT kernel and drivers from being swapped to disk. Find our more info here.
  • Set LargeSystemCache in the registry to 1. This will also keep more "touched" memory pages in RAM. Find our more here.

At the Guest OS Level

  • Make sure your virtual disk is set to use write caching in the guest OS (<DriveLetter> -> Properties -> Hardware -> <PhysicalDrive> -> Properties -> Policies -> Optimize for performance)
  • Disable all visual effects in the guest OS (eg. fade effect) (<Desktop> -> Properties -> Appearance -> Effects -> uncheck all)
  • Run the guest OS in full screen mode

VirtualBox Itself

  • Only use one virtual processor (on multi-CPU, multi-core machines) and force each guest OS onto one CPU or core via FireDaemon Pro's CPU Affinity setting. This will keep your machine responsive.
  • Disconnect the CD-ROM for the guest OS when not in use (VM -> Settings -> Storage -> Controller: IDE)

Questions? Issues?

Please contact us. We will help you out.