ctwise

VMWare Fusion Controller

36 posts in this topic

I created a workflow inspired by the Parallels controller workflow. It doesn't do screen captures since VMWare requires a username / password to do that, otherwise it's pretty similar. It's on alfpt or you can download it from here: http://tedwi.se/u/d4

 

The following commands are available:

 

 

vm list - Provides a list of VM's and their status (running or stopped). Copies path to clipboard.
vm start [nogui] - List the VM's that are currently stopped so you can start them. Optionally, if you add 'nogui' it will start them without showing the VMWare window.
vm stop [hard] / vm suspend [hard] / vm reset [hard] - List the VM's that are currently running so you can stop, suspend or reset them. Optionally, if you add 'hard' it will force the action.
vm pause / vm unpause - Get a list of VM's that are currently running so you can pause or unpause them. A paused VM counts as running.
vm snapshot <name> - Get a list of VM's that are currently running so you can create a named snapshot of a VM's current state, 'name' is not optional.
vm ip - List the ip addresses of all running vms and copies the selected ip to the clipboard. The vm _must_ be running vmware tools for this to work.
vm revert <name> - revert a vm to the named snapshot.
 
2013-02-07 - Add icons (cribbed from Jonas Erikson's VirtualBox controller)
deanishe, Enhorn, palobo and 1 other like this

Share this post


Link to post

The workflow has been updated, both at the above link and on alfpt. I added the following:

 

vm list - now copies the vmx path to the clipboard

vm ip - list the ip addresses of all running vms and copies the selected ip to the clipboard. The vm _must_ be running vmware tools for this to work.

vm revert <name> - revert a vm to the named snapshot.

Share this post


Link to post

Great workflow!  

 

Minor issue - I get repeat actionable items - not sure where they are coming from.  See photo in link:  http://db.tt/yqVyMltZ

 

Thanks!

Can you post this file? ~/Library/Application Support/VMware Fusion/vmInventory

If that doesn't exist, then this file: /Library/Application Support/VMware/VMware Fusion/Shared/vmInventory

Share this post


Link to post

Small correction: https://gist.github.com/melan/5205776

 

I use folders to organize my VMs and vmware.rb fails on parsing inventory item which represents folders.

 

Fix incorporated. It's easier (for me) if you fork the repository and send me a pull request. You also get your name as the committer (if that matters to you).

Share this post


Link to post

I'm noticing a weird issue with this workflow.  I use tab completion like crazy (vim, zsh, etc.) and use it with Alfred too.  When I go to start my vm I do the following:

  • activate Alfred
  • type 'vm st<TAB>'
  • wait while list is populated
  • hit '<TAB>' to complete the line

Now I would expect the Alfred line to be "vm start VM_NAME_TO_START", however it reads "vm start Start VM_NAME_TO_START" and if I hit <enter> now, the command executes but VMWare doesn't acknowledge the command.

 

Instead to get a machine to launch I have to do the following:

  • activate Alfred
  • type 'vm st<TAB>'
  • wait while list is populated
  • arrow to VM
  • hit '<enter>'

Share this post


Link to post

 

I'm noticing a weird issue with this workflow.  I use tab completion like crazy (vim, zsh, etc.) and use it with Alfred too.  When I go to start my vm I do the following:

  • activate Alfred
  • type 'vm st<TAB>'
  • wait while list is populated
  • hit '<TAB>' to complete the line

Now I would expect the Alfred line to be "vm start VM_NAME_TO_START", however it reads "vm start Start VM_NAME_TO_START" and if I hit <enter> now, the command executes but VMWare doesn't acknowledge the command.

 

Instead to get a machine to launch I have to do the following:

  • activate Alfred
  • type 'vm st<TAB>'
  • wait while list is populated
  • arrow to VM
  • hit '<enter>'

 

 

Yes, autocomplete doesn't work. There's no guarantees that the vm names are unique and that means autocompleting names isn't sufficient. What I should do is completely disable autocomplete.

Share this post


Link to post

One minor thing - if you have folders the workflow sees those as VMs. Any chance you could fix that in the future? Thanks for the workflow! 

Share this post


Link to post

Since updating to VMWare Fusion 6 and using this App with "Start Virtual Machine" the Workflow does not only open the selected VM also it opens the Library.

When I use the VMWare Icon in the Statusbar and select the machine it only opens the machine, not the library.

Does this workflow now maybe also need an update because of VMWare 6 ??

 

Thanks in advance for your reply and maybe updating the Workflow. :)

Share this post


Link to post

Since updating to VMWare Fusion 6 and using this App with "Start Virtual Machine" the Workflow does not only open the selected VM also it opens the Library.

When I use the VMWare Icon in the Statusbar and select the machine it only opens the machine, not the library.

Does this workflow now maybe also need an update because of VMWare 6 ??

 

Thanks in advance for your reply and maybe updating the Workflow. :)

 

Probably needs updating. I wasn't planning on upgrading to VMF 6 just yet, it doesn't have any features I've been waiting for.

Share this post


Link to post

I realize this has been around a while now, but could you verify what 'nogui' does? I assumed it would launch without the VM Library window showing. It seems instead to be launching in some fashion such that no window displays at all. That is, I cannot seem to find the VM anywhere on the CMD+Tab or Dock or menubar lists. That seems... odd.

Share this post


Link to post

I realize this has been around a while now, but could you verify what 'nogui' does? I assumed it would launch without the VM Library window showing. It seems instead to be launching in some fashion such that no window displays at all. That is, I cannot seem to find the VM anywhere on the CMD+Tab or Dock or menubar lists. That seems... odd.

 

"The nogui option suppresses the user interface, including startup dialog box, to allow non‐interactive scripting."

 

Nothing shows when you use nogui. You have to start the VMWare Fusion app separately.

Share this post


Link to post

Hope somebody can help.

What can I do when the Workflow is not showing and of my three VM in the list?

When I use the "vm start" and hit enter, there is no selection anymore.

I deleted the workflow and reinstalled it but that did not fix the problem.

 

What exists is

~/Library/Application Support/VMware Fusion/vmInventory

http://bit.ly/1sigdiA

 

What exists but looks empty  /Library/Application Support/VMware/VMware Fusion/Shared/vmInventory

http://bit.ly/1qGiL6U

 

thanks in advance.

Edited by DJay

Share this post


Link to post

Hope somebody can help.

What can I do when the Workflow is not showing and of my three VM in the list?

When I use the "vm start" and hit enter, there is no selection anymore.

I deleted the workflow and reinstalled it but that did not fix the problem.

 

What exists is

~/Library/Application Support/VMware Fusion/vmInventory

http://bit.ly/1sigdiA

 

What exists but looks empty  /Library/Application Support/VMware/VMware Fusion/Shared/vmInventory

http://bit.ly/1qGiL6U

 

thanks in advance.

 

Not sure why that happened. I'm not a VMWare expert. :-)

 

This knowledge base article says you can remove the file and restart VMWare to recreate it - http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2031100

 

There's also something online about registering VMWare instances to add them to the file, not sure how to go about that though.

Share this post


Link to post

Not sure why that happened. I'm not a VMWare expert. :-)

 

This knowledge base article says you can remove the file and restart VMWare to recreate it - http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2031100

 

There's also something online about registering VMWare instances to add them to the file, not sure how to go about that though.

 

I'm having the same issue on a brand new computer.  I dug into it a bit and exciting the vm list command manually Sfrom inside the workflow directory gives me the following error.

% ruby main.rb list
vmware.rb:63:in `block in inventory_list': undefined method `length' for nil:NilClass (NoMethodError)
	from vmware.rb:63:in `each'
	from vmware.rb:63:in `find_all'
	from vmware.rb:63:in `inventory_list'
	from vmware.rb:25:in `list'
	from main.rb:11:in `generate'
	from main.rb:22:in `list'
	from main.rb:119:in `<main>'

Share this post


Link to post

Okay.. did a restart an now all three machines are in the list. 

but wehen I select one of them.. VMWare is doing something and it sounds like it starts the machine but the VMWare Fusion Windows does not open. Nothing to see. I have to start VMWare app an then the window with the already running VM pops up. strange..  any idea? thx in advance.

VMWare Fusion Version 6.0.4 (1887983)

Share this post


Link to post

Okay.. did a restart an now all three machines are in the list. 

but wehen I select one of them.. VMWare is doing something and it sounds like it starts the machine but the VMWare Fusion Windows does not open. Nothing to see. I have to start VMWare app an then the window with the already running VM pops up. strange..  any idea? thx in advance.

VMWare Fusion Version 6.0.4 (1887983)

 

It's because of line 44 in main.rb:

 

  arg = arg.nil? ? "nogui" : arg
 
By default the VMs are started without a window (nogui). It's a "feature". I personally only use VMs to run servers and then access those servers from OS/X. You have a couple of options:
 
1. Change that line in the workflow to:
 
  arg = arg.nil? ? "" : arg
 
2. Add 'gui' to the end when you start a vm, e.g., 'vm start gui' and then select the vm you want to start.
 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now