When suspending and resuming the VM with VMware it will popup with the following message:
The VMware Tools resume script did not run successfully in this virtual machine.
If you have configured a custom resume script in this virtual machine, make sure that it contains no errors. You can also submit a support request to report this issue.
After digging into this error this seems to be caused by the /etc/vmware-tools/scripts/resume-vm-default.d/__pycache__ directory.
And can be reproduced using the following commands:
$ #sudo bash -x /etc/vmware-tools/suspend-vm-default; echo $? $ sudo bash -x /etc/vmware-tools/resume-vm-default; echo $? ++ date + echo Wed 14 Jul 2021 03:05:57 PM UTC ': Executing '\''/etc/vmware-tools/resume-vm-default'\''' Wed 14 Jul 2021 03:05:57 PM UTC : Executing '/etc/vmware-tools/resume-vm-default' ++ dirname /etc/vmware-tools/resume-vm-default + TOOLS_CONFDIR=/etc/vmware-tools <snipped> + exitCode=0 + RunScripts /etc/vmware-tools/scripts/resume-vm-default.d + scriptDir=/etc/vmware-tools/scripts/resume-vm-default.d + '[' -d /etc/vmware-tools/scripts/resume-vm-default.d ']' + for scriptFile in "$scriptDir"/* + '[' -x /etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py ']' + /etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py resume-vm ++ expr 0 '|' 0 + exitCode=0 + for scriptFile in "$scriptDir"/* + '[' -x /etc/vmware-tools/scripts/resume-vm-default.d/__pycache__ ']' + /etc/vmware-tools/scripts/resume-vm-default.d/__pycache__ resume-vm /etc/vmware-tools/resume-vm-default: line 92: /etc/vmware-tools/scripts/resume-vm-default.d/__pycache__: Is a directory ++ expr 0 '|' 126 + exitCode=126 + return 126 126
The error that causing the resume scripts to return errors:
/etc/vmware-tools/resume-vm-default: line 92: /etc/vmware-tools/scripts/resume-vm-default.d/__pycache__: Is a directory
So the /etc/vmware-tools/resume-vm-default does not handle directories very well.
$ dpkg -S /etc/vmware-tools/resume-vm-default open-vm-tools: /etc/vmware-tools/resume-vm-default $ dpkg -S /etc/vmware-tools/scripts/resume-vm-default.d/__pycache__ vyos-1x-vmware: /etc/vmware-tools/scripts/resume-vm-default.d/__pycache__
To fix this warning, the __pycache__ directory should be removed from the vyos-1x-vmware package.