Skip to content

Instantly share code, notes, and snippets.

@rufflabs
Created December 14, 2022 02:25
Show Gist options
  • Save rufflabs/6682154f205c31d7b5b2b6826c7a5243 to your computer and use it in GitHub Desktop.
Save rufflabs/6682154f205c31d7b5b2b6826c7a5243 to your computer and use it in GitHub Desktop.
Kali's mount-shared-folders script to mount VMware shared folders.
#!/bin/sh
test $(id -u) -eq 0 || { echo "Please call this script with sudo" >&2; exit 1; }
vmware-hgfsclient | while read folder; do
vmwpath="/mnt/hgfs/${folder}"
echo "[i] Mounting ${folder} (${vmwpath})"
mkdir -p "${vmwpath}"
umount -f "${vmwpath}" 2>/dev/null
vmhgfs-fuse -o allow_other -o auto_unmount ".host:/${folder}" "${vmwpath}"
done
sleep 2s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment