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
- Select the VMware Virtual Machine and select VM > Settings.
- On the Options tab, select Shared Folders.
- Select a folder sharing option.
Option | Description |
---|---|
Always enabled | Keep folder sharing enabled, even when the virtual machine is shut down, suspended, or powered off. |
Enabled until next power off or suspend | Enable 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. |
Select Always enabled option
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.
Browse to the folder path you want to share.
Specify the name of the shared folder as it should appear inside the virtual machine and click Next.
Select shared folder attributes: Enable this share option
Option | Description |
---|---|
Enable this share | Enable the shared folder. Deselect this option to disable a shared folder without deleting it from the virtual machine configuration. |
Read-only | Make 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. |
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.
Click OK to save your changes.
Linux Guest Configuration
- 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
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)
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.
- Now make a directory for /mnt/hgfs
sudo mkdir /mnt/hgfs
Before mounting restart the daemon
sudo systemctl daemon-reload
- 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
- 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!!