Hi,
1)
Any ideas how to force vmrun to not return and keep running in the background.
Problem is when using launchd and keepalive (for detecting and restarting if vmware crashes), it needs the executable not to daemonize itself.
2)
Also wonder if there is a trick to suspend/quit vmware and the running instance nicely when shutting down a Mac OS X system.
I want to make sure the equivalent to vmrun suspend is executed when the system signal for shutdown
i.e..
Archive an attach a copy of the .plist file.
<plist version="1.0">
<dict>
What did you not understand about "Archive an attach a copy of the .plist file."? I DID NOT ask you to copy and paste the contents of the file into the body of a reply!
I checked your version, if I'm not wrong, it's function is identical to the one I sent.
QueueDirectories and WatchPaths is added but both have empty lists.
UserName is already "my user" since I run it from ~/Library/LaunchAgentsWhat I'm after is how to utilize launchd's nifty KeepAlive flag (which I've by purpose set to false currently).Problem by using vmrun is that it needs to block until the vmware application is closed, otherwise launchd can't be used together with KeepAlive.You can remove QueueDirectories and WatchPaths keys if you want however keep the UserName key and the .plist file needs to be placed in the /Library/LaunchDaemons/ folder owned by root if you want to keep it alive!
rw-r--r-- root wheelAlso I have the answer for your number two question and will post it a bit later when I get the time.
awesome, I will try that. so basically when running vmrun as root, it wont return immediately?
looking forward to input on question 2. seems to be a hot topic around the web, but no real answers.
awesome, I will try that. so basically when running vmrun as root, it wont return immediately?
If the KeepAlive key is set to false and run as I mentioned then it will not return immediately.
looking forward to input on question 2. seems to be a hot topic around the web, but no real answers.
I working on it now and should be to much longer.
2) Also wonder if there is a trick to suspend/quit vmware and the running instance nicely when shutting down a Mac OS X system.
Have a look at: Running a VM Headless (no GUI) and Controlling Shutdown/Suspend with Mac OS X Reboot/Shutdown
Thanks alot Woody!
I agree that it's so strange launchd doesn't have the feature of the old StartupItem to enable an easy way to gracefully quit apps during system shutdown/reboot...