Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have installed the VMWare Tools into a test Ubuntu guest, and it's created the standard scripts as expected:

poweroff-vm-default
poweron-vm-default
resume-vm-default
suspend-vm-default

I add some custom actions to the scripts, but it says in the top of the file

##########################################################################
# DO NOT modify this file directly as it will be overwritten the next
# time the VMware Tools are installed.
##########################################################################

So where should the custom scripts go, if I'm not supposed to modify these ones?

scriptsdir="`dirname $0`/scripts/`basename $0`.d"
if [ -d "$scriptsdir" ]; then
    for scriptfile in "$scriptsdir"/*; do
        [ -x "$scriptfile" ] && "$scriptfile" poweron-vm
    done
fi
share|improve this question

2 Answers 2

up vote 2 down vote accepted

Here is some information on creating custom VMWare Tools scripts.

From phrases such as "enter the path and name of the script file" and "use the Browse feature to navigate to and select the new custom script" I infer that any location is suitable. I would use /usr/local/bin.

share|improve this answer
    
Not very helpful –  user705142 Jul 16 '12 at 1:12
    
@user705142: The OP apparently found it useful since he accepted it. However, I've tried to improve my answer a little. You didn't say how you found it unhelpful, but I hope you find the change at least a slight improvement. And yet someone upvoted it just after you made your comment and before I edited it. –  Dennis Williamson Jul 16 '12 at 1:52
    
If you're adding in scripts manually like this guy's doing they need to be in simple subdirectories such as /script/resume-vm-default.d/. Your link is only helpful if using the GUI, which this guy isn't (nor me, who came across this via google). –  user705142 Jul 16 '12 at 6:37

They go in (ToolsDir)/script/resume-vm-default.d/, (ToolsDir)/script/poweroff-vm-default.d/ directories.

They also need to be executable.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.