How do you configure Virtualbox VM to autostart after Windows-10 reboot?
Solution 1
The truly most-consistent option is to use Task Scheduler.
Implementing the solution
This requires a couple of pretty easy steps, but I will explain them in detail to ensure anyone from with any technical background can set this up:
- Identify your virtual machine name
- Create a task in Task Scheduler
1. Identify your virtual machine name
Navigate to C:\Users\YourUserNameHere\VirtualBox VMs
The folder name above generally reflects the virtual machine name. You can confirm this by checking VirtualBox Manager itself:
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:
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...
:
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):
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...
:
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
:
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:
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
:
Copy everything except the executable and the quotation marks from Program/script:
into Start in (optional):
:
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
My Conditions
tab is generally set to the following:
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:
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:
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):
Testing My Actual Use Case
On another machine, I set up my Linux Server as a virtual machine with it's own raw solid-state hard drive. I wanted that Server to boot back up if the machine got restarted (crash, windows update, etc) automatically, without the user having to log in. I set that one up exactly as I described above and restarted that machine. I know it worked successfully because I was able to access my Samba share (laymens: a folder with stuff in it that I share over my network to my other computers) from another computer WITHOUT having first logged into the machine that runs the Server VM. This 100% confirms that it does start on system boot and not after the user logs in.
Solution 2
The start up directory does still exist, albeit in a well hidden place...
Access it via opening the "Run" box (Win+R) and entering
shell:startup
Minimise this for now.
Open VirtualBox and right click on the VM you want to autostart, click the option to create a shortcut on the desktop and close VirtualBox.
Simply cut the shortcut from the desktop and paste it into the previously opened folder and it should be perfectly fine.
Solution 3
You can actually start a VM headlessly without resorting to a third-party VBoxVmService now. Just create a shortcut to <VirtualBoxDirectory\VBoxManage.exe> startvm "vmname" --type headless
and put that in your startup folder.
From the VirtualBox manual.
Solution 4
Try VBoxVmService
Make sure to read the Howto.txt and edit VBoxVmService.ini
Solution 5
While having a Service is nice, you can do it with a scheduled task. Take system boot as the trigger, check the option to run the task without a logged-on user and set the action to <VirtualBoxDirectory\VBoxManage.exe> startvm "vmname" --type headless
. Make sure to remove the check from the incomprehensibly default-on option "kill the task if running for more than 3 days". Srsly, MS, what were you thinking, that no Windows computer would ever last that long without reboot?
There is a caveat: if a VM is started on boot that way, you will see it in the VirtualBox Manager as "powered off", so there's no button to show the display of the VM. There's only the "start" button and you will probably screw things up when you try to double-start it.
You can define a remote display port so that you can access the console of the VM thru RDC (mstsc.exe), without the VirtualBox Manager, but you still have to remember to not believe the "powered off" information. I don't know if that works better with a real service.
Related videos on Youtube

Trevor Boyd Smith
Updated on September 18, 2022Comments
-
Trevor Boyd Smith 3 months
In 2013 I tracked down how to autostart/shutdown a Virtualbox VM when the host is Linux. The process was officially documented and required a few steps.
Right now I am interested in, how do you configure Virtualbox VM to autostart after Windows-10 reboot?
Is there an officially documented process? If not, what are some person's tested solutions?
My naive attempt was going to be something like:
done: Setup windows to auto-login upon reboot
TODO: Create batch script with:
sleep 120 && vboxmanage startvm my_vm_name
TODO: Put the batch script into my user's startup directory. (I didn't see any "startup" directory in windows 10 though...)
-
Trevor Boyd Smith almost 7 yearsi wasn't sure about using the startup menu... because it is very windows-9x-ish (maybe it's older). In linux I used sysvinit/systemd but I'm just not familiar with Windows (maybe task-scheduler or some such).
-
Philippe Gachoud about 4 yearsCould be useful if you add a link to
The process was officially documented
on linux ;-) -
Trevor Boyd Smith about 4 years@PhilippeGachoud as per your request, i edited the question and added a link to the documentation
-
Philippe Gachoud about 4 yearsThx! I found this more adequate because less sensible to changes of packages managment configuration as seems to be the case, whats your experience with that? medium.com/@bharatman/…
-
Trevor Boyd Smith over 6 yearsThank you so much! this looks very promising. On Windows, the lack of Virtualbox integration with system start/shutdown was always a big negative when you wanted to compare windows-virtualbox vs linux-virtualbox (even tho the linux virtualbox integration is only sysvinit... and is IMO not very robust (shutdown of VMs does not wait for the VM to shutdown before system issues SIGKILL and then does system shutdown)).
-
Janardhan Burle almost 6 yearsshell:startup is on login, not on system boot, correct? How to do this on system boot?
-
AKi almost 6 yearsYou need to run it as a service
-
HorusKol over 5 yearsDoesn't this still have the disadvantage of requiring login instead of just running on boot?
-
Trevor Boyd Smith over 5 yearsI tried this about a year ago. This solution requires that you update virtualbox in lockstep with the wrapper code that does the windows service. And so you have to be careful. Also a windows update i think broke this functionality for me. And so i ended up uninstalling this vbox-service code.
-
rustyx over 5 yearsOf course. A service is still a necessity if you want to run anything without having to log in.
-
Trevor Boyd Smith almost 5 yearsre "having a Service is nice". unfortunately the VirtualBox service gets broken everytime there is a minor virtualbox update. so i ended up uninstalling the service and right now my VM does not start at boot anymore.
-
Trevor Boyd Smith almost 5 yearsre "[the VM shows up as] powered off [in VirtualBox Manager]" i believe this is caused by the way you are starting the VM. i suspect you are starting the VM as the root user. if you were to try and start the VM with a "runas" your user... your VirtualBox manager might work.
-
Trevor Boyd Smith almost 5 yearsnow that i think of it... the VirtualBox service... ALSO shows up as "powered off" when you start it via the service.
-
Bruno Finger over 4 yearsUse a Scheduled Task for that instead of shortcut in the startup folder.
-
Mikhail T. over 4 yearsThis looks very promising, but I can't get it to work... I created the job, with two commands -- to start my too "main" VMs. I see it in scheduler. I can click on it a pick "Run" -- the state changes from "Ready" to "Running", but the VMs do not start. Nor do they start upon boot... There must be something else to it...
-
user2066657 over 4 yearsI looked at this project. The sheer volume of spelling mistakes makes me worry about similar issues in the code. Mineshaft+canary.
-
Trevor Boyd Smith about 4 years@user2066657 well you can read my comments and see that I tried it and it worked for a little bit then got broken. your concerns about spelling mistakes indicating the quality of code is probably well founded. i still would not go back to it today.
-
drakorg about 4 yearsNot necessarily. You can always configure autologon, Open a cmd and type control userpasswords2. You'll find your way through the rest.
-
fgrieu almost 4 yearsIT WORKS, tested on Windows 10 + Virtualbox 6.0.2. Recipe: Windows-key, type SCHED and launch task scheduler, Create Basic Task, Trigger: When the computer starts, Action: Start a program, Program (browse to VBoxManage.exe), arguments: startvm "vmname" --type headless, tick "Open the properties dialog for this task.. and finish, tick Run whether user is logged on or not, perhaps remove Conditions/Start only if the computer is on AC power, and Settings/Stop the task if it runs longer than.. (though really that one does not matter here since the launch is fast).
-
Trevor Boyd Smith over 3 yearsthat looks amazing. i'll have to try it out when i have time. thanks.
-
FloPinguin almost 3 yearsWorks perfectly. Great late answer!
-
lauxjpn almost 3 yearsBTW, the
Kill the task if running for more than 3 days
option can be kept checked, because this only applies to the script/command you are running here to start the VMs. When your script has finished executing, the task will stop anyway and the VMs will keep running. This option is only for cases, where for some reason the script deadlocks. I actually always use this option in conjunction with a retry policy, but use a much smaller time period (like 30 minutes or so). -
Wale Bayo over 2 yearsThe link is broken. I wonder if this is the same project: github.com/onlyfang/VBoxVmService
-
DeeJayh over 1 yearYou can simply change the
Begin the task:
toAt logon
instead ofAt Startup
andRun only when user is logged on
instead ofRun whether the user is logged on or not
, if you desire it to occur ONLY AFTER the user logs into the system. -
DeeJayh over 1 yearWhile this does work after the user logs in, it will not work BEFORE the user logs in (on reboot, as the question asked). For a proper solution, see this answer: superuser.com/a/1645276/524595
-
Trevor Boyd Smith over 1 yearoh my goodness. your answer is truly amazing. great writing. great screenshots. and even testing it with screenshots to show testing. above and beyond. i left it unsolved for years. but you sir get the green checkmark.
-
DeeJayh over 1 year@HorusKol that is correct. Bruno Finger has the right idea. The proper solution is available here: superuser.com/a/1645276/524595
-
DeeJayh over 1 yearNot only do these require you to update the wrapper, meaning you cannot update to the latest and greatest VirtualBox until the wrapper is updated for it first (or lose functionality), but it usually only boots these after the user is logged in. For a full solution to get a VM running at boot instead of after user logon, see here: superuser.com/a/1645276/524595
-
DeeJayh over 1 yearI have a full solution available here: superuser.com/a/1645276/524595 It does not have the caveat that OP stated above either.
-
DeeJayh over 1 year@TrevorBoydSmith thank you very much. This too has plagued me for some time. Now that I looked into it again and saw that they implemented the
startvm "name" --type headless
I knew it was finally attainable... I have posted it on other similar windows-vm-on-boot type questions as well so that hopefully many can enjoy this feature. -
DavidPostill over 1 yearPlease do not post the same answer to multiple questions. If the same information really answers both questions, then one question (usually the newer one) should be closed as a duplicate of the other. You can indicate this by voting to close it as a duplicate or, if you don't have enough reputation for that, raise a flag to indicate that it's a duplicate. Otherwise tailor your answer to this question and don't just paste the same answer in multiple places.
-
Nagev 10 monthsTask scheduler was not used in this example.
-
Andy Gee 10 monthsMy word, I have no idea why I thought that! Deleted.