Automate Your VirtualBox VMs With Autostart

This guide will walk you through setting up a system service to automatically launch your desired VirtualBox VMs, saving you precious time and effort.

Configure Autostart Properties

  • Create a file named autostart.properties in the folder C:\Users\Admin\.VirtualBox.
  • Inside the file, define the following:
1
2
3
4
5
default_policy = deny
Admin = {
    allow = true
    startup_delay = 10
}
  • default_policy = deny: This sets the default policy to deny all autostarts.
  • Admin = { allow = true; startup_delay = 10 }: This allows the user “Admin” to start VMs with a 10-second delay.

Set System Variable

  • Create a new system variable named VBOXAUTOSTART_CONFIG and set its value to C:\Users\Admin\.VirtualBox\autostart.properties.

Install the VirtualBox Autostart Service

  • Navigate to the VirtualBox installation directory: cd "C:\Program Files\Oracle\VirtualBox"
  • Run the following commands:
1
2
.\VBoxAutostartSvc.exe install --user=Admin
.\VBoxManage.exe modifyvm "virtual-pc" --autostart-enabled on
  • Replace "virtual-pc" with the actual name of your VM you want to autostart.

Check and Start the Service

  • Use the sc command to check the service status: sc query VBoxAutostartSvcadmin-pcadmin
  • Start the service: sc start VirtualBox Autostart Service VBoxAutostartSvcadmin-pcadmin

Congratulations! Your VirtualBox VM is now set to autostart when your system boots.

0%