How to Automatically Start a Virtual Machine (VM) with Windows startup

Learn how to add a virtual machine to your Windows 10 startup, which is useful for starting your critical services and applications hosted in VMWare Workstation platform.

Shell:Startup method

This method starts VMs AFTER you login to Windows

  1. Add the following code to a new bat file auto-start-vm.bat, and replace VMX file path with the one from the desired VM:
"C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe" start "C:\Users\elastic\Documents\Virtual Machines\Docker\Docker.vmx"

For VMs that don’t need to appear on the screen (Run in the background), just add nogui as follows:

"C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe" start "C:\Users\elastic\Documents\Virtual Machines\Docker\Docker.vmx" nogui
  1. Press Windows Key + R to open a location, and enter shell:startup.
  2. Copy auto-start-vm.bat to shell:startup Alternative method to placing bat file in shell:startup is to run the bat file using Windows Task Scheduler. This method you edit task properties and allow the command to run regardless if you log in to Windows or not for DNS servers/AD Farms to work immediately on computer startup.

Task scheduler method

With this method you can start VMs BEFORE you login to Windows. This is a popular option for DNS & Active Directory servers to work immediately on computer startup.

  1. Create the bat file as described above.
  2. Search Windows for Task Scheduler.
  3. In Task Scheduler click Create Task.
  4. Choose a name for the task.
  5. Choose Run whether user is logged on or not.
  6. Under Triggers tab > add a new trigger > At startup.
  7. Under Action tab > Start a program > browse to your auto-start-vm.bat.
  8. Save task.

The task will now run every time you restart your computer and before user logs in.

Window update may break the task during major updates.

When this happen you may open Task Scheduler to trigger your task manually, or restart your computer again after completing any Windows update dialogues.


Video Guide