본문 바로가기
운영체제/linux

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

by 신일석 2014. 10. 23.

https://gist.github.com/drakkhen/5473067


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.