Skip to content

Instantly share code, notes, and snippets.

@nquangit
Created October 23, 2024 09:14
Show Gist options
  • Save nquangit/fe14e31e7c392f4e6c956fc1086fdb16 to your computer and use it in GitHub Desktop.
Save nquangit/fe14e31e7c392f4e6c956fc1086fdb16 to your computer and use it in GitHub Desktop.
#!/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