I want/need to start my VM instances from the command line, or as part of the host boot sequence. Also, as part of a script manually launched on the host at will.

The obvious command for such case would be vmrun start with the nogui option, but this fails consistently in my 3 hosts running VMware Workstation 7.1.4 under CentOS 5.6 (64 bit):

[root@japeto ~/vmware/juno]$ vmrun start juno.vmx nogui

Error: The virtual machine needs to be powered on

If I open the vmware GUI and use the point+click method everything works fine. In fact, once a VM instance has been started this way, then the vmrun start ... nogui works at it should for other VM instances residing in the same host.

But this doesn't help for a headless operation where I can only access the host via ssh.

Any hints ? Thanks.

link|improve this question
I'm not sure, but I think you need a complete path-from-root for the .vmx file you're starting. – sysadmin1138 Aug 19 '11 at 18:21
feedback

2 Answers

Have you verified that the modules are loading correctly?

the vmrun command doesn't always auto-load the modules successfully.

load them manually (/etc/init.d/vmware start) and try vmrun again.

link|improve this answer
feedback

I got this solution from another forum - and it seems to solve the issue:

su - -c "vmrun start /export/vmware/juno/juno.vmx nogui"

(See also http://tinyurl.com/3zkbs8j)

link|improve this answer
Later, the error had turned into Error: The operation was canceled. It looks like vmrun needs to have a session opened. If launched manually after the system is up, vmrun works as it is expected to work. – David Ramirez Sep 7 '11 at 14:20
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.