Is it possible to autostart a VMware virtual machine in background as a Windows service, and shut it down elegantly when Windows shuts down?

The host is Windows 7. I would like my virtual machine to start with Windows in the background, without the need to login to Windows and manually start it. I also hope the virtual machine can be shut down elegantly upon Windows shuts down.

Is there existing script/app that does this?


If you're using VMware Workstation, you could make the VM a "Shared VM" and can configure it to automatically start (in the library, right-click on "Shared VMs" and choose "Manage AutoStart VMs"). By default, Shared VMs are subjected to a hard power-off when the host is shut down. You can change this by editing %PROGRAMDATA%\VMware\hostd\vmAutoStart.xml and changing the stopAction value to GuestShutdown (or to Suspend if you'd rather suspend the VM). You will need to restart the VMware Workstation Server service after making changes to this file (and you should shut down any running shared VMs before restarting the service).

Update: In Workstation Pro 14, the context menu item is now "Manage VM Power Actions" and now supports configuring a VM to automatically suspend when the host shuts down.


You can also use the vmrun command.

You can use a script to start a VM, for example:

vmrun -T ws start "F:\VMWare-VMs\S1.vmx"

and you add the script at Windows startup.

More info about vmrun


I'm using VMware Workstation 15.5.2 and I start my background-VMs with this command:

vmrun start "C:\VMs\D10AMP\D10AMP.vmx" nogui

The VM starts in background and no VMware window opens.