black electronics

Fix VMware Copy Paste

A script for restarting the VMware Tools user process when clipboard sharing stops working.

Clipboard sharing between the host and a Kali guest sometimes stops working after a suspend/resume cycle. Restarting the VMware Tools user-mode process usually fixes it without needing a reboot.

#!/bin/bash
processString=$(ps -ef | grep '[0-9][0-9]:[0-9][0-9]:[0-9][0-9] /usr/bin/vmtoolsd -n vmusr') # Find the running vmtoolsd process
tokens=( $processString )
kill "${tokens[1]}" # Kill it by PID
/usr/bin/vmtoolsd -n vmusr & > /dev/null 2>&1 # Restart it

If clipboard sharing still doesn’t come back, restarting the desktop session’s user process can help too:

Terminal window
vmware-user
Useful LinksPentest PayloadsCheat Sheets