VMware Communities
sprotsman
Contributor
Contributor
Jump to solution

vmrun command failed

I'm trying to start a virtual machine from the command line that is on my Linux workstation (SLED 10 SP1 x86_64). I've added "msg.autoAnswer = TRUE" to the .vmx file. Unfortunately, when I attempt to start the virtual machine I get the following:

deimos:~/vmware/PGPUniversal-2.6.3> vmrun start PGPUniversal-2.6.3.vmx

Error: Command failed: Cannot connect to the virtual machine

I've search through the forum but didn't find an answer. According to this page, http://www.vmware.com/support/ws55/doc/ws_learning_cli_vmrun.html, I'm not doing anything out of the ordinary.

deimos:~/vmware/PGPUniversal-2.6.3> vmware -v

VMware Workstation 6.0.0 build-45731

Ideas?

Tags (3)
Reply
0 Kudos
1 Solution

Accepted Solutions
johnwheaton2
Enthusiast
Enthusiast
Jump to solution

I should have picked up on this. I run VMs with no gui on my Linux box...

Try "vmrun start nogui..." That should work. It tells workstation to run the vm without starting the gui. I ssh into my linux box and run this just fine.

View solution in original post

Reply
0 Kudos
9 Replies
johnwheaton2
Enthusiast
Enthusiast
Jump to solution

I've found I had to specify the full path to the vmx file. Give that a try and see if it helps.

Reply
0 Kudos
sprotsman
Contributor
Contributor
Jump to solution

John, thanks for the input. Sadly, I still got the same error:

deimos:~> vmrun start /home/shawn.protsman/vmware/PGPUniversal-2.6.3/PGPUniversal-2.6.3.vmx

Error: Command failed: Cannot connect to the virtual machine

Reply
0 Kudos
admin
Immortal
Immortal
Jump to solution

Is the Workstation UI started before you do this? If not, does it appear when you run this command?

Could you strace vmrun when you run this command and post the result?

Reply
0 Kudos
sprotsman
Contributor
Contributor
Jump to solution

Here is an interesting thing I noticed today, now that I'm back in the office. If I run the command from the physical machine (my Linux system), VMWare Workstation will start up and then start the virtual machine successfully. It works as expected. But when I ssh from another machine into my Linux workstation, run the same command, I get the "Error: Command failed: Cannot connect to the virtual machine".

My strace output is 6166 lines long. Is there anything specific you want to see in it? I doubt this forum will accept a post that long. Let me know how I can get this to you if it will be of help.

Thanks,

--Shawn

Reply
0 Kudos
oreeh
Immortal
Immortal
Jump to solution

With a remote connection you don't have a X11 environment / you don't have the DISPLAY environment variable set.

sprotsman
Contributor
Contributor
Jump to solution

Resolved.

I already had "export DISPLAY=0.0" in my .profile on my laptop (Mac OS 10.4.11) but I wasn't passing the '-Y' param to ssh. Now, if I start X11, then log in to my Linux box with '-Y', I can run 'vmrun start ...' and VMWare launches and starts my virtual machine. Works nicely! oreeh, thanks for pointing me in the right direction.

Now to figure out how to start the virtual machine from my laptop, detach while keeping it running and then re-attach when I return to the office.

--Shawn

Reply
0 Kudos
johnwheaton2
Enthusiast
Enthusiast
Jump to solution

I should have picked up on this. I run VMs with no gui on my Linux box...

Try "vmrun start nogui..." That should work. It tells workstation to run the vm without starting the gui. I ssh into my linux box and run this just fine.

Reply
0 Kudos
oreeh
Immortal
Immortal
Jump to solution

Take a look at (Gnu ?) "screen" - not sure if it is available for Mac OS.

Reply
0 Kudos
sprotsman
Contributor
Contributor
Jump to solution

'screen' is included with OS X but I after I detach I cannot logout until I suspend the virtual machine in the X11 session. I don't think screen was meant to be used with X sessions but would love to be proven wrong.

I started vmrun with nohup, then closed the GUI window and clicked send to background and this worked. And a less complicated way is to use John's suggestion of 'nogui':

deimos:~> vmrun start vmware/PGPUniversal-2.6.3/PGPUniversal-2.6.3.vmx nogui

+ Done vmrun suspend vmware/PGPUniversal-2.6.3/PGPUniversal-2.6.3.vmx

Thanks guys!

Reply
0 Kudos