Configure Virtualbox VM to autostart after Windows reboot?

his requires a couple of pretty easy steps, but I will explain them in detail to ensure anyone from any technical background can set this up:

  1. Identify your virtual machine name
  2. Create a task in Task Scheduler

1. Identify your virtual machine name

Navigate to C:\Users\YourUserNameHere\VirtualBox VMs

VirtualBox VMs Folder

The folder name above generally reflects the virtual machine name. You can confirm this by checking VirtualBox Manager itself:

VirtualBox GUI

The machine name is WindowsXPSP3.

2. Create a task in Task Scheduler

First click the start button and type “task scheduler” without the quotes. Then open the Task Scheduler:

Task Scheduler Search

Inside the task scheduler, we’re going to see a structure tree on the left side. Right-click on Task Scheduler Library. Left-click on New Folder...:

Task Scheduler New Folder

Name the folder something memorable, like User Custom and hit OK (if you already have an existing folder that you would prefer to use, that’s fine as well, skip to the next paragraph instead):

Name New Folder

Click your newly created folder, in my case User Custom, to highlight it. Right-click in the empty list to the right and Left-click on Create New Task...:

Create New Task

Now comes the tricky stuff. Follow my instructions verbatim. If you feel like downvoting because it didn’t work, or say “this didn’t work for me” in the comments, I’m betting you skipped a step here. Come back and try it again.

The Name and Description can be whatever you like, it is merely aesthetic and will not affect functionality. I’m going to name mine after my virtual machine and put a brief description. What IS important is that you choose Run whether user is logged on or not and Run with highest privileges:

Create Task: General

Switch to the Triggers tab at the top and Left-click New.... Switch the Begin the task: combination box to At Startup and then Left-click OK:

New Trigger

Switch to the Actions tab at the top and Left-click New.... Click browse (do not try to type this manually, you will cause yourself headaches) and navigate to C:\Program Files\Oracle\VirtualBox. Highlight VBoxManage.exe and Left-click Open:

Browse to VBoxManage

Copy everything except the executable and the quotation marks from Program/script: into Start in (optional)::

Copy Directory Path

Finally, put the following line into Add arguments (optional): and hit OK:

startvm "YourVirtualMachineNameFromStep1" --type headless

in my case, I will use:

startvm "WindowsXPSP3" --type headless

Enter Arguments

My Conditions tab is generally set to the following:

Conditions Tab

Make sure your Settings tab looks like the following, but absolutely ensure you have set the items marked in yellow to match mine. This will make sure that if some pre-requisite wasn’t ready yet that it will retry a few times to start the virtual machine and that the virtual machine won’t be terminated after 3 days. I would leave everything else as default unless you know what you are doing. If you don’t do what I show you here, and it ends up not working, it’s your problem:

Settings Tab

Finally, hit OK at the bottom of the Create Task window. You are done!

Testing the solution

Testing My Fake Scenario Above (and how you can test yours)

When I restart my computer, I can log in and open the VirtualBox Manager and see that my VM is running:

Running VM

I can also open Task Scheduler back up, and verify that it ran successfully, or see what the error was if it did not (most errors will be directory errors from people trying to manually enter where I told them not to):

Task Scheduler Success

RELATED POST

Outlook keeps displaying error: Contact the server for information

What version of Outlook are you using? See What version of Outlook do I have? (microsoft.com). What were you trying…

Raising the forest functional level to Windows Server 2016

Just like the Active Directory DFL, the FFL also determines the availability of new Active Directory functionality. Where the DFL…

Create Bulk Users in Active Directory

In this tutorial, we’ll go through the process of creating Active Directory users’ accounts in bulk using two methods: the…

Installing PKCS12 (.pfx) Certificate  Manage Engine Helpdesk

Installing PKCS12 (.pfx) Certificate   A PKCS12 (.pfx) certificate stores the RSA keys and the SSL certificate in a single encrypted file. Follow…