1 2 Previous Next 17 Replies Latest reply on Jul 28, 2009 12:58 AM by Aldupon

    Automator Actions

    Guru

      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/$The specified item was not found./Library/Automator/ or /Libarary/Automator/

        • 1. 0.2008.09.02
          Guru
          • 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

          • 2. Re: 0.2008.09.02
            rcardona2k Champion

            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.

            • 3. Re: Automator Actions
              borisdusek Expert
              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?

              • 4. Re: Automator Actions
                Guru

                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.

                • 5. Re: Automator Actions
                  HobbitFootAussie Hot Shot

                  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.

                  • 6. Re: 0.2008.09.02
                    wila Guru
                    vExpertCommunity WarriorsUser Moderators

                    Thanks Eric, more toys to play with, very nice

                     

                    --

                    Wil

                    | Author of Vimalin. The VMware Fusion Backup app |
                    | More info at http://www.vimalin.com |
                    | Twitter @wilva |
                    | Wiki at http://www.vi-toolkit.com |
                    • 7. Re: Automator Actions
                      mlabonte Novice
                      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!

                       

                       

                      • 8. Re: Automator Actions
                        TheAngryPenguin Enthusiast

                        This is way cool, but WTF is Koi Productions?!?

                        • 9. Re: Automator Actions
                          Guru

                          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.

                          • 10. Re: Automator Actions
                            Piggy Hot Shot

                            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?

                            • 11. Re: Automator Actions
                              tasmund Lurker

                              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. 

                              • 12. Re: Automator Actions
                                Guru

                                (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

                                • 13. Re: Automator Actions
                                  matthewls Hot Shot

                                  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 the message "command not found" appears. I can run vmrun from finder, and run ls etc. from the command prompt...what am I missing?

                                  • 14. Re: Automator Actions
                                    Guru

                                    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