VMware Shared Folders enable users to easily transfer files between the host and guest operating systems on a virtual machine, providing a convenient and efficient way to share data and resources.

To setup a shared folder from Windows host operating system to Kali Linux or any linux guest operating system in VMware Workstation.

VMware VM Settings

  1. Select the VMware Virtual Machine and select VM > Settings.
  2. On the Options tab, select Shared Folders.
  3. Select a folder sharing option.
OptionDescription
Always enabledKeep folder sharing enabled, even when the virtual machine is shut down, suspended, or powered off.
Enabled until next power off or suspendEnable folder sharing temporarily, until you power off, suspend, or shut down the virtual machine. If you restart the virtual machine, shared folders remain enabled. This setting is available only when the virtual machine is powered on.
  1. Select Always enabled option

  2. Click Add to add a shared folder.

    • On Windows hosts, the Add Shared Folder wizard starts.
    • On Linux hosts, the Shared Folder Properties dialog box opens.
  3. Browse to the folder path you want to share.

  4. Specify the name of the shared folder as it should appear inside the virtual machine and click Next.

  5. Select shared folder attributes: Enable this share option

OptionDescription
Enable this shareEnable the shared folder. Deselect this option to disable a shared folder without deleting it from the virtual machine configuration.
Read-onlyMake the shared folder read-only. When this property is selected, the virtual machine can view and copy files from the shared folder, but it cannot add, change, or remove files. Access to files in the shared folder is also governed by permission settings on the host computer.
  1. Click Finish to add the shared folder.

    • The shared folder appears in the Folders list.
    • The check box next to folder name indicates that the folder is being shared.
    • You can deselect this check box to disable sharing for the folder.
  2. Click OK to save your changes.

Linux Guest Configuration

  1. Open terminal and type this command:
df -lh
┌──(kali㉿kali)-[~]
└─$ df -lh
Filesystem      Size  Used Avail Use% Mounted on
udev            951M     0  951M   0% /dev
tmpfs           198M  1.2M  197M   1% /run
/dev/sda1        79G   17G   59G  22% /
tmpfs           987M     0  987M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           198M   84K  198M   1% /run/user/1000
  1. Check for filesystem vmhgfs-fuse mounted on /mnt/hgfs

    • If it is not mounted follow below steps or skip to step 7 (if already mounted)
  2. Now, Edit fstab using sudo.

sudo nano /etc/fstab

Now add a new line

vmhgfs-fuse     /mnt/hgfs       fuse    defaults,allow_other    0       0

After adding press CTRL+O then ENTER & CTRL+X to exit nano editor.

  1. Now make a directory for /mnt/hgfs
sudo mkdir /mnt/hgfs

Before mounting restart the daemon

sudo systemctl daemon-reload
  1. To mount
sudo mount -a    

Now check for mounted folder, by using df -lh

┌──(kali㉿kali)-[~]
└─$ df -lh
Filesystem      Size  Used Avail Use% Mounted on
udev            951M     0  951M   0% /dev
tmpfs           198M  1.2M  197M   1% /run
/dev/sda1        79G   17G   59G  22% /
tmpfs           987M     0  987M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           198M   84K  198M   1% /run/user/1000
vmhgfs-fuse     466G  335G  131G  72% /mnt/hgfs
  1. Shared folders appear under /mnt/hgfs
cd /mnt/hgfs/
┌──(kali㉿kali)-[~]
└─$ cd /mnt/hgfs

┌──(kali㉿kali)-[/mnt/hgfs]
└─$ ls    
shared_folder

Thanks for reading! && Happy mounting!!

References