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.
This method starts VMs AFTER you login to Windows
- 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
- Press Windows Key + R to open a location, and enter
shell:startupAlternative 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.
- Create the bat file as described above.
- Search Windows for
- Choose a name for the task.
Run whether user is logged on or not.
Triggerstab > add a new trigger >
Actiontab > Start a program > browse to your
- 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 Schedulerto trigger your task manually, or restart your computer again after completing any Windows update dialogues.