VMware Communities > VMTN > Desktop Products > VMware Fusion (for the Mac) > Discussions
1 2 Previous Next
17 Replies Last post: Jul 28, 2009 12:58 AM by Aldupon
Reply

Automator Actions

Sep 2, 2008 6:25 PM

Click to view etung's profile Guru etung 11,023 posts since
Oct 15, 2006
VMware
I've been toying with Automator recently, and came up with some actions for Fusion. Currently, the actions include:
  • List running virtual machines
  • List virtual machines in the Virtual Machine Library
  • Perform power operation on a list of virtual machines
    • Power On
    • Shut Down (soft)
    • Power Off (hard)
    • Reboot (soft)
    • Reset (hard)
    • Suspend
    • Pause
    • Unpause

Suggestions for more actions are welcome.



I will update this top post if and when I make updates so you don't have to search through the thread.

Nothing too exciting yet, this is mostly stuff you can trivially do with vmrun (pause/unpause is perhaps particularly interesting, since Fusion doesn't currently have a UI for this). For example, one useful combination would be to list all running VMs and pause them, and a matching action to list all running VMs and unpause them - this might be handy if you want to quickly devote computing power to some task but don't want to suspend.

The current version is 0.2008.09.02. To use, unzip and put the resulting actions in /Users/${USER}/Library/Automator/ or /Libarary/Automator/
Reply 0.2008.09.02 Sep 2, 2008 6:26 PM
Click to view etung's profile Guru etung 11,023 posts since
Oct 15, 2006
VMware
  • List running virtual machines
  • List virtual machines in the Virtual Machine Library
  • Perform power operation on a list of virtual machines
    • Power On
    • Shut Down (soft)
    • Power Off (hard)
    • Reboot (soft)
    • Reset (hard)
    • Suspend
    • Pause
    • Unpause
Attachments:
Reply Re: 0.2008.09.02 Sep 2, 2008 7:41 PM
in response to: etung
Click to view rcardona2k's profile Champion rcardona2k 5,103 posts since
Oct 20, 2005
I'm not much of an Automator/Applescript tinkerer but I grok the concepts. I ran through your actions and I like the intuitive Automator "pipelining" interface. You have a good start and I would want to dive right into starting up processes within Windows guest via vmrun. :)

I'll keep watching this thread for developments.
Reply Re: Automator Actions Sep 4, 2008 1:53 PM
Click to view borisdusek's profile Expert borisdusek 392 posts since
Mar 8, 2008
etung wrote:
    • Pause
    • Unpause

Never seen these - what do they do? "non-persistent" suspend, i.e. just stop giving CPU time to the machine? Where are they in Fusion menubar?
Reply Re: Automator Actions Sep 4, 2008 2:00 PM
in response to: borisdusek
Click to view etung's profile Guru etung 11,023 posts since
Oct 15, 2006
VMware
They aren't in the Fusion UI at all, which is why I mentioned them as being of interest. Your guess is correct - pause stops running the virtual machine, but keeps it in memory. Note that attempting to use Fusion with a paused virtual machine may not do anything, you need to unpause it first.
Reply Re: Automator Actions Sep 4, 2008 8:55 PM
Click to view HobbitFootAussie's profile Hot Shot HobbitFootAussie 207 posts since
Feb 7, 2007
Could we have "list running processes in VM" or "Grab screenshot of VM". For example I run my VMs in Spaces and would love an Automator action that perhaps runs a script in a VM (Windows) and watches to see when its done, or takes a screenshot every so often and shows it to me as the screen is hidden in another space.
Reply Re: 0.2008.09.02 Sep 5, 2008 2:22 AM
in response to: etung
Click to view wila's profile Virtuoso wila 3,205 posts since
Jun 27, 2006
Thanks Eric, more toys to play with, very nice :)

--
Wil
Reply Re: Automator Actions Sep 5, 2008 7:06 AM
in response to: etung
Click to view mlabonte's profile Novice mlabonte 11 posts since
Feb 5, 2008
etung wrote: pause stops running the virtual machine, but keeps it in memory.

This is the thing I have always needed but never realized I wanted. Thanks!
Reply Re: Automator Actions Sep 26, 2008 10:40 PM
Click to view TheAngryPenguin's profile Enthusiast TheAngryPenguin 60 posts since
Sep 21, 2006
This is way cool, but WTF is Koi Productions?!?
Reply Re: Automator Actions Sep 27, 2008 12:13 AM
in response to: TheAngryPenguin
Click to view etung's profile Guru etung 11,023 posts since
Oct 15, 2006
VMware
I figured it might be a good idea to have a domain a while back, and that was the best I could come up with in 5 minutes. As you can tell, I never got around to doing anything with it (maybe someday...), but since Apple requires developers to use a unique domain for preferences and I already had that one, I just used it.
Reply Re: Automator Actions Jan 22, 2009 9:00 AM
in response to: borisdusek
Click to view Piggy's profile Enthusiast Piggy 174 posts since
Apr 8, 2007
Really need to get 'pause' and 'unpause' in the UI. Why on earth would the developers not include them? Is it because of the dumbing down for Mac users?
Reply Re: Automator Actions Jun 2, 2009 10:50 PM
in response to: Piggy
Click to view tasmund's profile Lurker tasmund 3 posts since
Jun 2, 2009
I haven't used Automator Actions before.
I've fooled around with this for ten minutes and haven't got it working, so I thought I'd ask for more detailed instructions.

(1) Where do I look for these commands? I suspect the VMware Fusion menu, under the Services menu item.

(2) I had no Automator directory in either ~/Library or root /Library. Is this normal?

(3) I made an Automator director under /Library and put the three actions there. (I assume they don't need to be under the directory "0" in the ZIP file.) I restarted Fusion and couldn't see any evidence of these actions anywhere. Do I need to restart Fusion, or take some other action to have these actions show up, after installing them?

(4) I then deleted the Automator directory I created, along with the 3 action files in it, started the Automator application and imported these Actions in the top they would install. I tried dragging a single action into a workflow and playing the workflow, but it failed: The action “List Virtual Machines in Library” encountered an error.

(5) It then started to look like a great big hassle to use this package, so I thought I'd go for the vmrun command instead. I looked for vmrun inside the VMware application and couldn't find it: find /Applications/VMware\ Fusion.app/ -name '*vmrun*' -print Perhaps it's an optional package. Perhaps it's installed somewhere else in the filesystem (/usr/bin). Is this why the Automator actions are failing?

Okay, now I'm going to look for the vmrun docs to find out where it lives...

Some more specific instructions would be very helpful.

Even more helpful would be a Pause function inside Fusion 2.0.5 or 2.0.6. :-)
Reply Re: Automator Actions Jun 3, 2009 12:35 AM
in response to: tasmund
Click to view etung's profile Guru etung 11,023 posts since
Oct 15, 2006
VMware
(1) Where do I look for these commands? I suspect the VMware Fusion menu, under the Services menu item.

No, that's not how Automator works. You string together Automator actions using the Automator application to create scripts.

(2) I had no Automator directory in either ~/Library or root /Library. Is this normal?

I think so.

(4) I then deleted the Automator directory I created, along with the 3 action files in it, started the Automator application and imported these Actions in the top they would install. I tried dragging a single action into a workflow and playing the workflow, but it failed: The action “List Virtual Machines in Library” encountered an error.

You're getting closer, and that should have not errored out - I just tried it and it works for me. A quick Google search turns up resources like http://automator.us/leopard/index.html , since it sounds like you're not familiar with Automator, you should probably read up on it.

(5) It then started to look like a great big hassle to use this package, so I thought I'd go for the vmrun command instead. I looked for vmrun inside the VMware application and couldn't find it: find /Applications/VMware\ Fusion.app/ -name '*vmrun*' -print Perhaps it's an optional package. Perhaps it's installed somewhere else in the filesystem (/usr/bin). Is this why the Automator actions are failing?

vmrun is in /Library/Application\ Support/VMware\ Fusion/, it's not an optional package.

Message was edited by: etung to fix incorrect statements. It's late and it's been a long time since I've looked at this :p
Reply Re: Automator Actions Jun 12, 2009 8:11 AM
in response to: etung
Click to view matthewls's profile Hot Shot matthewls 246 posts since
Oct 11, 2007
Just to prove my novice status with unix, I can't get vmrun to run from the command line. Even though I'm in the /Library/Application Support/Vmware fusion directory, when I type vmrun enter the message "command not found" appears. I can run vmrun from finder, and run ls etc. from the command prompt...what am I missing?
Reply Re: Automator Actions Jun 12, 2009 8:59 AM
in response to: matthewls
Click to view etung's profile Guru etung 11,023 posts since
Oct 15, 2006
VMware
Welcome to the command line, it's a bit daunting at first but rewarding :) Short answer: you want "./vmrun" (no quotes)

Long answer: "vmrun" tells the OS to look in all the places it knows about (listed in $PATH) for programs and run the first one called vmrun that it finds. For security reasons, the current directory is traditionally not one of the places it looks (otherwise it's much easier to accidentally run a program, perhaps with security implications). In order to run a program that's not in your $PATH, you need to specify a path to that program so the OS knows you really mean it. "." is the current directory, and "/" is the path separator, so "./vmrun" means "look in the current directory for a program called vmrun and run it". Alternately, you could use "/Library/Application\ Support/VMware\ Fusion/vmrun" and not have to change into that directory first.
1 2 Previous Next
Actions