where <VIRTUAL-MACHINE_NAME> is the name of the VirtualBox VM you would like to start automatically.
We have specified "Windows Server 2022" in this tutorial.
Note: Instead of starting your VM by name, can launch it using the VM's unique identifier (UUID).
To do so, specify parameter -s <UUID> (instead of -startvm),
where <UUID> is the identifier for your VM.
You can list your VM's UUIDs by running
Vboxmanage.exe list vms
from the VirtualBox installation folder.
In the Start the application field, select Automatically, but shortly after the computer boots.
This setting — which delays VM startup by about 2 minutes — should ensure that critical system services
(like networking and domain authentication) are ready and waiting when your virtual machine is launched in the background.
In the Name field, enter the name that you will call this application in AlwaysUp.
We have specified "Windows Server 2022 VM" but you can enter virtually anything you like.
Click over to the Logon tab.
Enter the user name and password of the account in which you installed and run VirtualBox.
AlwaysUp must run your VM must in this account so that it can find its settings:
Move 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.
And finally, on the Extras tab, let's ensure that your VM shuts down smoothly when its stopped.
Check the Use this special command to stop the application box.
Enter the full path to the VBoxManage.exe application along with a few arguments:
Note: VirtualBox user Jesse Connor prefers to use ACPI shutdown instead of savestate because his Linux boxes
don't seem to recover smoothly from saved states.
For the stop command, he specifies:
Check the Wait for up to box and enter 30 in the accompanying field.
This tells AlwaysUp to wait for up to 30 seconds for VirtualBox to exit properly before forcibly closing it.
Click the Save button. In a couple of seconds, your new application will show up in the AlwaysUp window.
It's not yet running though:
To start your VirtualBox VM, choose Application > Start "Windows Server 2022 VM" (your application name will be different though).
In a few seconds, the entry's state will transition to "Running" and your VM will be chugging away in the background
(in the isolated Session 0):
At this point, please connect to your VM and ensure that it works as expected.
For example, if you set up the Remote Display feature,
now would be a good time to open an RDP session to your VM.
That's it! Next time your computer boots, your VirtualBox virtual machine will start up immediately, before anyone logs on.
We encourage you to edit your VirtualBox entry in AlwaysUp and explore the many other settings that may be appropriate for your environment.
For example, send an email if VirtualBox stops unexpectedly, boost the priority of the VM process, and much more!
VirtualBox not working properly as a Windows Service?
Please ensure that the VirtualBox commands work as expected on your system.
For example, does this command start your virtual machine?
If not, you should adjust your AlwaysUp settings to use alternate commands that work for you.
Please get in touch if you need help doing that.
Visit the AlwaysUp Troubleshooter — our online tool
that can help you resolve the most common problems encountered when running VirtualBox as a windows service.
From AlwaysUp, select Application > Report Activity > Today... to bring up a HTML report detailing the
interaction between AlwaysUp and VirtualBox.
The AlwaysUp Event Log Messages page explains the more obscure messages.
Consult the AlwaysUp FAQ for answers to commonly
asked questions and troubleshooting tips.