VMware_tools - zollak/pentest-notes GitHub Wiki

Install VMware tools

Howto

  1. Remove Virtualbox Guest tools if required:
root@alive # apt-get purge virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
  1. Always start with upgrade:
root@alive # apt update && apt -y full-upgrade
  1. Reboot now in case you have updated to a new kernel:
root@alive # reboot
  1. Once rebooted install open-vm-tools-desktop:
root@alive # apt -y install open-vm-tools-desktop fuse
root@alive # reboot
  1. Update shared folders if you add new items:
root@alive # mkdir -p /opt/scripts/

root@alive # cat <<EOF > /opt/scripts/mount-shared-folders.sh
#!/bin/bash
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
EOF

root@alive # chmod +x /opt/scripts/mount-shared-folders.sh

root@alive # whereis mount-shared-folders 
mount-shared-folders: /opt/scripts/mount-shared-folders.sh
root@alive # export PATH=/opt/scripts:$PATH

root@alive # mount-shared-folders.sh 
[i] Mounting zollak   (/mnt/hgfs/zollak)
[i] Mounting Hacking-Lab   (/mnt/hgfs/Hacking-Lab)
  1. Set autostart when reboot your VM:

howto

root@alive # mkdir /root/.config/autostart/
root@alive # cat <<EOF > ~/.config/autostart/automount.desktop
[Desktop Entry]
Name=automount
GenericName=Automount
Comment=Mount VMware tools shared-folders
Exec=/opt/scripts/mount-shared-folders.sh
Terminal=false
Type=Application
X-GNOME-Autostart-enabled=true
EOF

Depricated way

Install VMware Tools to Kali linux guest (with shared folder feature).

  1. Remove Virtualbox Guest tools if required:
root@alive # apt-get purge virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
  1. Download patch:
root@alive # /root/git/
root@alive # git clone https://github.com/rasa/vmware-tools-patches.git
  1. Delete all directory inside patches except vmhgfs:
root@alive # find vmware-tools-patches/patches/* ! -name vmhgfs -type d -exec rm -rf {} +
root@alive # ls -lh vmware-tools-patches/patches/
drwxr-xr-x 3 root root 4.0K Jun 23 11:28 .
drwxr-xr-x 5 root root 4.0K Jun 23 11:25 ..
drwxr-xr-x 2 root root 4.0K Jun 23 11:25 vmhgfs
-rw-r--r-- 1 root root 1.1K Jun 23 11:25 vmware-config-tools.patch
-rw-r--r-- 1 root root  261 Jun 23 11:25 vmware-tools.service
root@alive # git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	deleted:    patches/pvscsi/.gitkeep
	deleted:    patches/vmblock/.gitkeep
	deleted:    patches/vmblock/01-vmblock.3.10.patch
	deleted:    patches/vmblock/02-vmblock.3.11.patch
	deleted:    patches/vmblock/03-vmblock.3.12.patch
	deleted:    patches/vmblock/04-vmblock-vfs_readlink-kernel-3.15-tools-9.6.2.patch
	deleted:    patches/vmci/.gitkeep
	deleted:    patches/vmci/01-vmware9.k3.8rc4.patch
	deleted:    patches/vmmemctl/.gitkeep
	deleted:    patches/vmsync/.gitkeep
	deleted:    patches/vmxnet/.gitkeep
	deleted:    patches/vmxnet3/.gitkeep
	deleted:    patches/vsock/.gitkeep
	deleted:    patches/vsock/01-vsock-sk_data_ready-kernel-3.15-tools-9.6.2.patch

no changes added to commit (use "git add" and/or "git commit -a")
  1. Copy VMware Tools to your host's home and attach it to the guest:
MacBook-Pro:~ zollak$ cp /Applications/VMware\ Fusion.app/Contents/Library/isoimages/linux.iso ~/
root@alive # cp /media/cdrom/VMwareTools-10.0.6-3595377.tar.gz /root/git/vmware-tools-patches/patches/
root@alive # cd vmware-tools-patches/
root@alive # ./untar-and-patch-and-compile.sh

Note: VMware Fusion 11 has newer ISO with VMwareTools-10.3.21-14772444.tar.gz, I did not tested yet with this.

  1. Set file sharing:
root@alive # reboot
root@alive # mount
vmhgfs-fuse on /mnt/hgfs type fuse.vmhgfs-fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)

Our shared folder path is /mnt/hgfs

⚠️ **GitHub.com Fallback** ⚠️