Skip to content

Instantly share code, notes, and snippets.

@xd547
Forked from drakkhen/gist:5473067
Created February 24, 2014 23:47
Show Gist options
  • Select an option

  • Save xd547/9199734 to your computer and use it in GitHub Desktop.

Select an option

Save xd547/9199734 to your computer and use it in GitHub Desktop.

I see this error when I try to suspend an Ubuntu 10 guest in Fusion:

The request to Suspend this virtual machine failed because the corresponding VMware Tools script did not run successfully.

If you have configured a custom suspend script in this virtual machine, make sure that it contains no errors. Attempting the operation again will ignore the script failure. You can also submit a support request to report this issue.

As the dialog states, the second time you try to suspend the VM it ignores the non-zero return code of the script and it seems to work. But it's annoying.

The problem appears to not be VMware actually, but Ubuntu (or Ubuntu's service script). I tried to figure out where exactly Ubuntu's initctl configuration/scripts is broken to no avail but found a work-around that I'm happy with.

Edit /etc/vmware-tools/scripts/vmware/network and make the following change:

@@ -78,13 +78,13 @@ run_network_script()
    [ "$script" != "error" ] || Panic "Cannot find system networking script."

    # Using SysV "service" if it exists, otherwise fall back to run the script directly
-   service=`which service 2>/dev/null`
-   if [ $? = 0 -a -n "$service" ]; then
-      serviceName=`basename "$script"`
-      "$service" "$serviceName" "$1"
-   else
+   #service=`which service 2>/dev/null`
+   #if [ $? = 0 -a -n "$service" ]; then
+   #   serviceName=`basename "$script"`
+   #   "$service" "$serviceName" "$1"
+   #else
       "$script" "$1"
-   fi
+   #fi
 }

Now instead of using the (seemingly broken) service script, it will just call the networking script directly which seems to return a non-zero result correctly.

NOTE: when you re-install vmware-tools in the VM (which you will need to do whenever Fusion is updated -- which isn't too often), your changes will be reverted and you'll have to edit this file again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment