Featured image of post How to Automatically Start a Virtual Machine (VM) with Windows startup

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.

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:
1
"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:

1
"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.

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 any 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.

Task Scheduler Method

Video Guide

Licensed under CC BY-NC-SA 4.0
Last updated on Sep 08, 2024
Built with Hugo
Theme Stack designed by Jimmy