Autostart VMware Guest on login to Windows

  • strict warning: Non-static method view::load() should not be called statically in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/views.module on line 906.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/views_handler_argument.inc on line 744.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/views_handler_filter.inc on line 607.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /hermes/walnaweb12a/b57/moo.greydragoncom/nodsw/sites/all/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 159.
Leeland's picture

After a couple days of open VMware, click box, click start, click next box, click start, click next box, click start, ...., ahhhhh!!! Today I got fed up with my "get to code" process.

With 7+ VMs I need to kick off to run development and CI testing on my laptop I needed automation. (Up till now this wasn't such a problem. But, now I have a tomcat production mirror, a CI build host (Jenkins doing C++ and Java builds), a production db mirror, a "client test box", my development desktop box, and I just added a few more boxes to run the data collection systems feeding my "test production" service using semi-random data.)

Hey I actually bought a real full blown VMware Workstation Pro license, auto-start should be just a configuration setting right? ... poke ... poke ... huh ... poke ... Google ... nope ... nope ... Dang it there has to be a way.

From a smidgen in one email thread, a smudge from another, a smattering from yet another, and a drop of blood....oops that was an odd thread to have Google pop up for my search...

The solution is actually not too bad. Essentially had to figure out the command line way to run VMs with VMware. There are two choices:

One way is "vmware.exe -x c:\vm\server1\server1.vmx" which works, but it pops up a vmware window for every call. So 7+ servers equals 7+ windows AND to top that off when I close the window I have to click on the "run in background" button WAY AWAY from where I clicked to close the window.

The other way is to use vmrun.exe which as of VMware WS v6 comes with a "nogui" option. Ah ha, all that is needed is a single batch file that is so simple it is ridiculous. Save that file as "C:\bin\startAllVMs.bat" (any location desired will work) shown below. Then create a link to that and drop the link into the start folder of the Explorer menu. Problem solved.

OH and the other problem of shutting them all down was solved by a judicious use of sudo, ssh, and a script called shutdownAllVMs.sh copied to all hosts in my ~/bin directory.

Here is my no frills C:\bin\startAllVMs.bat:

REM it ain't pretty but it works

REM start the main desktop minus the nogui option (the rest will attach)
"C:\Program Files\VMware\VMware Workstation\vmrun.exe" -T ws start "C:\VM\ubuntu32dt_01\ubuntu32dt_01.vmx"

"C:\Program Files\VMware\VMware Workstation\vmrun.exe" -T ws start "C:\VM\tomcat-vm02\tomcat_ubuntu32srv_02.vmx" nogui
"C:\Program Files\VMware\VMware Workstation\vmrun.exe" -T ws start "C:\VM\db-repo-vm03\db_ubuntu32srv_03.vmx" nogui
"C:\Program Files\VMware\VMware Workstation\vmrun.exe" -T ws start "C:\VM\ci-vm04\ci_ubuntu32srv_04.vmx" nogui
"C:\Program Files\VMware\VMware Workstation\vmrun.exe" -T ws start "C:\VM\basetest9\basetest_ubuntu32svr_v9.vmx" nogui
"C:\Program Files\VMware\VMware Workstation\vmrun.exe" -T ws start "C:\VM\vmcnv10\vmcnv_ubuntu32svr_v10.vmx" nogui
"C:\Program Files\VMware\VMware Workstation\vmrun.exe" -T ws start "C:\VM\vmlats10\vmlats_ubuntu32svr_v10.vmx" nogui
"C:\Program Files\VMware\VMware Workstation\vmrun.exe" -T ws start "C:\VM\vmdds10\vmdds_ubuntu32svr_v10.vmx" nogui

exit

Thread Slivers eBook at Amazon