Sharing a Folder To a Kali Linux VM in VMware Fusion

How to.

Sometimes I get really surprised at where does my time and days go and here is one example.

Yesterday evening I decided that I needed to share a folder on my macOS so that the Kali Linux 2020 VM can have access to it. The vm was created in VMWare Fusion, so it makes sense to look for sharing feature in the VM settings.

This is how it looks like after I added a folder and called it kalish and checked the checkmark Enable Shared Folders.

It also warns us about VMware Tools.

VM Sharing Settings Window

Next, start the VM.

Open the Terminal and browse to the Host Guest File System (HGFS) folder by running this command:

user@kali:~$ cd /mnt/hgfs
Browsing mounted folder

At this point you’re all set and done …unless you have done the below.. :D

⚠️ Whenever the Linux kernel (Operating System) is updated, VMware Tools will need to be reinstalled.

So actually, it happened so that prior to mounting the shared folder I have also updated the vm using the following commands in the terminal, so I had to reinstall the VMware tools.

user@kali:~$ sudo apt update 
user@kali:~$
user@kali:~$ sudo apt full-upgrade -y
user@kali:~$
user@kali:~$ [ -f /var/run/reboot-required ] && sudo reboot -f

Reinstalling VMware Tools

Reinstall VMware Tools Window

As in the image on the left, in the VMware Fusion menu bar click on Virtual Machine > Reinstall VMware Tools, you will see a pop-up (see the image below) which basically has written out all the further steps you need to take in order to successfully install the VMware tools.

VMware Tools Installation Instructions

After you click on Install, there might be another pop-up

Guest CD-ROM is busy

In my case, I haven’t ejected the linux.iso which was occupying the drive and hence throwing this pop-up. Anyways, click on Yes to proceed.

Device Notifier Kali Linux

Open with the File Manager, as suggested, and unpack the contents .tar.gz to any preferred location.

Untar the .tar.gz

Now all you need is to run the installation script from the terminal like this Ensure the file is executable (chmod +x vmware-install.pl):

user@kali:~$ sudo ./vmware-install.pl

The command prompt will be asking different questions, I went with all the defaults.

At this point the mounting should succeed, and you should be able to browse the mounted folder.

While trying to figure out all those details I also came across a neat feature. You can sort of go deeper into the VM files and configure the sharing details from there, like deleting a desktop icon of the shared folder, etc.

Editing the .vmx file for your VMware Fusion virtual machine

In the Virtual Machine Library window, right-click on the vm > Show in Finder. Then open the vm’s package contents

Show Package Contents (view what’s inside the vm’s bundle)

And now you can edit the vm’s sharing settings by altering the values in the .vmx file in any text editor of your choice:

editing .vmx

References

Everything is unknown until it’s known. Self-learner.