For those of us who prefer the additional power that VMware Workstation offers over VMware Server, it is frustrating that there is no option to automatically start the VM(s) at boot time.

This simple batch script can be created and saved to the Startup directory to accomplish the task. Please note that your PC must be setup for your ID to auto-login if you want the VM to start automatically after a power outage, for example.
This has been tested using VMware Workstation 6.5 and 7.0 on Windows Vista 32-bit and Windows 7 64-bit (as shown). In this example VMware Workstation is installed to “C:\Program Files (x86)”, the VM is located in C:\Virtual_Machines, and the vmx file is what you need to look for.

Just open up Notepad or your favorite text editor, copy and paste the text below, modify it to fit your environment, and save it. You can then either drag and drop it into your Startup folder (Start -> All Programs -> Startup) or create a shortcut and copy that over.

@echo off

"C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe" -T ws start "C:\VMs\RHEL5\RHEL5.vmx"

The taskkill command can be used to automatically close the GUI window that opens. Add this line to the bottom of your batch file if you don’t want to close the GUI manually every time you reboot:

taskkill /IM vmware.exe

Update based on comments:

  • The name of the batch file does not matter. You can call it anything but be sure that the extension is .bat
  • Make sure that the command is on one line. (The article originally rendered the vmrun.exe command so that it appeared to be on two lines…I fixed it on 6/29/2011)
GD Star Rating
loading...

Filed under: Tech Support

Like this post? Subscribe to my RSS feed and get loads more!