Run VirtualBox as a Windows Service with AlwaysUp

How to Run a VirtualBox Virtual Machine as a Windows Service with AlwaysUp

Ensure that your VirtualBox VM starts immediately when your PC boots and is available 24/7. No login necessary!

VirtualBox is an free, open-source virtualization platform that can host Windows, Linux, Solaris and other operating systems.


To run your VirtualBox VM with AlwaysUp:

  1. Download and install AlwaysUp, if necessary.

  2. Download and install VirtualBox, if necessary. Be sure to install the VirtualBox extension pack if you intend to use VirtualBox's Remote Display feature to connect to your VM.

    Please make a note of the VirtualBox installation directory (by default, C:\Program Files\Oracle\VirtualBox) as this will be used in subsequent steps.

  3. Next, if necessary, configure your VirtualBox VM for remote access via RDP. Start VirtualBox, highlight your VM in the list and choose Machine > Settings. Select Display on the left and move over to the Remote Display tab. Check the Enable Server box and enter a port number in the Server Port field. We recommend using a number between 7000 and 8000 and we have used 7070 in our setup.

    VirtualBox Remote Display Settings

  4. Start AlwaysUp.

  5. Select Application > Add to open the Add Application window:

    Add Application

  6. On the General tab:

    • In the Application field, enter the full path to the VBoxHeadless.exe application, which allows you to start a VM without a graphical interface. If you installed VirtualBox in the default location, this is:

      C:\Program Files\Oracle\VirtualBox\VBoxHeadless.exe

    • In the Arguments field, enter:

      -startvm <VIRTUAL-MACHINE_NAME>
      where <VIRTUAL-MACHINE_NAME> is the name of the VirtualBox VM you would like to start automatically. We have specified Win8DevPreview.

      Note: VirtualBox user Jesse Connor prefers to start his VM using its unique identifier (UUID). He specifies arguments -s <UUID> instead, where <UUID> is the identifier for his VM found by running command Vboxmanage.exe list vms.

    • In the Name field, enter the name that you will call the application in AlwaysUp. We have used Win8DevPreview VM but you can specify virtually anything you like.

    VirtualBox Windows Service: General Tab

  7. Click over to the Logon tab:

    • Enter the user name and password of the account in which you installed and run VirtualBox. Your VM will run in this account so that it can find its settings.

    VirtualBox Windows Service: Logon Tab

  8. Click over to the Startup tab and check the Ensure that the Windows Networking components have started box. This informs AlwaysUp that VirtualBox needs the TCP/IP networking stack to operate.

    VirtualBox Windows Service: Startup Tab

  9. Move to the Extras tab and:

    • Check the Use this special command to stop the application box. Specify the full path to the VBoxManage.exe application along with a few arguments:

      "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm <VIRTUAL-MACHINE-NAME> savestate
      where <VIRTUAL-MACHINE-NAME> is the name of your VM (again, Win8DevPreview in our situation). See the VBoxManage.exe command line arguments for stopping a VM if you wish to stop without saving state, etc.

      Note: VirtualBox user Jesse Connor prefers use the ACPI shutdown instead of the recommended savestate because his Linux boxes don't seem to recover smoothly from saved states. He specifies C:\Program Files\Oracle\VirtualBox\Vboxmanage.exe controlvm <UUID> acpipowerbutton instead, where <UUID> is the identifier for his VM found by running command Vboxmanage.exe list vms.

    • Check the Wait for up to: box and enter 30 in the accompanying field. This informs AlwaysUp to wait for up to 30 seconds for VirtualBox to exit properly before forcibly closing it.

    VirtualBox Windows Service: Extras Tab

  10. Click the Save >> button. In a couple of seconds, an application called Win8DevPreview VM will show up in the AlwaysUp window. It is not yet running though.

    VirtualBox Windows Service: Created

  11. To start the VirtualBox VM, choose Application > Start "Win8DevPreview VM" (your application name will be different!). After starting, we connected via RDP ( at localhost:7070) to confirm that the VM is running properly.

    VirtualBox Windows Service: Running

    Note @ 2/21/2016: Even though your VM is running, the VirtualBox Manager window may still show the VM as "Powered Off". We saw this strange behavior when testing VirtualBox Version 5.0.14 r105127. Thankfully the incorrect staus didn't seem to have any effect on our running VM and we were able to connect to it without a problem.

  12. That's it! Next time your computer boots, your VirtualBox VM will start up immediately, before anyone logs on. We encourage you to edit your application in AlwaysUp and check out the many other settings that may be appropriate for your environment.



VirtualBox not working properly as a Windows Service?

  • Visit the AlwaysUp Troubleshooter - our online tool that can help you resolve the most common problems encountered when running an application as a windows service.
  • From AlwaysUp, select Application > Report Activity > Today... to bring up a HTML report detailing the interaction between AlwaysUp and your application. The AlwaysUp Event Log Messages page explains the more obscure messages.
  • Review the AlwaysUp FAQ for answers to commonly asked questions and troubleshooting tips.
  • Contact us and we will be happy to help!

Download & Try it Free!

Download AlwaysUp and Run as a Service Today! Version 9.7 New!

4.6 MB Installer
  • Unrestricted 30-day trial for new users; upgrade for existing users
  • Windows 10/8.1/8/7/XP & Windows Server 2012 R2/2008/2003
  • How to Install | EULA
Our customers include...


Compatible with Windows 10 (32 & 64-bit)

Windows Server 2012 Certified (32 & 64-bit)

Windows 8 Compatible (32 & 64-bit)

Compatible with Windows 7 (32 & 64-bit)

Works with Windows Server 2008 R2 (32 & 64-bit)



Over 68,000 installations, and counting!
 
AlwaysUp is number 1! Run as a Service with AlwaysUp

Rock-solid for the past 10+ years!