Sunday, July 20, 2014

Using vmrun on Mac OS/X (VMware Fusion)

The skinny :

To use VMware Fusion's vmrun from the command line (i.e. Terminal), you must invoke it with its FULL PATH, even if you are already in the same directory as vmrun lives in.

The fat :

Continuing to prove that VMware is great when it works and quite lousy when it doesn't, get this :

I opened Terminal.

I cd'ed to /Applications/VMware\ Fusion.app\Contents\Library.

I tried to execute "vmrun".

"Command not found"

How can that be?!!  The command is definitely in that directory!

ls -l

Yup - there it is, vmrun, and all users have execute permission.

I lost probably half an hour on this stupid bug.

Turns out that the solution is simple, but horribly inobvious :

You must include the full path to vmrun every time you invoke it, even if you are already in the same directory as it!!!

So instead of bothering to cd to the enclosing directoy, just always use :

/Applications/VMware\ Fusion.app/Contents/Library/vmrun

Note : I tried adding the directory to my PATH to see if that way I could run vmrun just with "vmrun", but it didn't work.

2 comments:

Anonymous said...

Thank you for your post. I came across it when I was trying to use 'vmrun'. My resolution was to add the following line in my .bash_profile file:

alias vmrun='/Applications/VMware\ Fusion.app/Contents/Library/vmrun'

Note that if the final posting may wrap the line, so it should be all one line with the middle portion being:
...VMware\ Fusion.app....; a backslash followed by the space so it can escape it.

Once you have it in there, either source the file or just start up a new terminal instance you should be able to type vmrun along with whatever flags/parameters you want.

Arun said...

Helped me. Thanks