ctwise Posted January 30, 2013 Share Posted January 30, 2013 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) drking, David, palobo and 2 others 5 Link to comment
ctwise Posted February 4, 2013 Author Share Posted February 4, 2013 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. Link to comment
alon85 Posted February 4, 2013 Share Posted February 4, 2013 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! Link to comment
ctwise Posted February 5, 2013 Author Share Posted February 5, 2013 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 Link to comment
alon85 Posted February 5, 2013 Share Posted February 5, 2013 Sure: https://dl.dropbox.com/u/10028577/vmInventory Link to comment
ctwise Posted February 5, 2013 Author Share Posted February 5, 2013 Sure: https://dl.dropbox.com/u/10028577/vmInventory Defect fixed. Updated at link and on alfpt. Link to comment
alon85 Posted February 5, 2013 Share Posted February 5, 2013 Defect fixed. Updated at link and on alfpt. Great thanks! Link to comment
dmel Posted March 20, 2013 Share Posted March 20, 2013 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. Link to comment
ctwise Posted March 20, 2013 Author Share Posted March 20, 2013 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). Link to comment
bmorgenthaler Posted May 10, 2013 Share Posted May 10, 2013 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>' Link to comment
ctwise Posted May 10, 2013 Author Share Posted May 10, 2013 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. Link to comment
Jb_Bryant Posted May 30, 2013 Share Posted May 30, 2013 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! Link to comment
DJay Posted September 5, 2013 Share Posted September 5, 2013 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. Link to comment
ctwise Posted September 7, 2013 Author Share Posted September 7, 2013 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. Link to comment
willfarrell Posted September 17, 2013 Share Posted September 17, 2013 Added it to https://github.com/willfarrell/alfred-workflows. Awesome workflow! Link to comment
sychian Posted May 2, 2014 Share Posted May 2, 2014 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. Link to comment
ctwise Posted May 3, 2014 Author Share Posted May 3, 2014 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. Link to comment
deanishe Posted May 16, 2014 Share Posted May 16, 2014 Wish I'd noticed this workflow before. Very handy! Link to comment
DJay Posted August 3, 2014 Share Posted August 3, 2014 (edited) 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 August 3, 2014 by DJay Link to comment
ctwise Posted August 4, 2014 Author Share Posted August 4, 2014 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. Link to comment
bmorgenthaler Posted August 4, 2014 Share Posted August 4, 2014 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>' Link to comment
ctwise Posted August 5, 2014 Author Share Posted August 5, 2014 A new version that fixes the issue has been uploaded to Packal - https://github.com/packal/repository/raw/master/com.tedwise.vmwarecontrol/vmware_control.alfredworkflow Link to comment
DJay Posted August 5, 2014 Share Posted August 5, 2014 Thanks a lot. Now again some of my Virtual Machines are in the list again. But strange, only two of three. Link to comment
DJay Posted August 5, 2014 Share Posted August 5, 2014 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) Link to comment
ctwise Posted August 6, 2014 Author Share Posted August 6, 2014 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. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now