How to share a folder between physical host machine and virtual machines in VMware

Md. Mahim Bin Firoj
3 min readJan 27, 2024

--

Sometimes we need to copy some files between host and vm’s but we often see people face difficulties when sharing files between host machine and vm’s. You can copy the files from host machine to vm’s directly but if the file size is big and you need to copy it to multiple vm’s, then its a tedious and time consuming task. Rather we can place the file in a folder in our physical host machine and share the folder. All the vm’s will take it from the shared folder. Today i will share the process how you can share a folder from your host machine to virtual machine’s.

Prerequisite:

You need to install the vmware tools before starting.

Installed my side already
Go to the settings
You need to create the share folder
Click Next

Click on Browse and locate the share folder.

We have created a folder on E drive named Vmware_Share_Folder

Enable this share

Share folder creation is done.

Now go to your kali machine and give following command:

vmware-hgfsclient

You can see that your share folder is showing.

Now you need to create some directories inside your linux vm machine. Issue below command:

mkdir -R /mnt/hgfs/shared

It will create hgfs directory inside /mnt and inside hgfs, shared directory will also be created.

Now let’s share the shared directory that we just created in the vm with our Vmware_Share_Folder directory that we created in our physical host. Issue the below command from root user:

vmhgfs-fuse .host:/Vmware_Share_Folder /mnt/hgfs/shared -o allow_other -o uid=1000

Now it’s almost done.

This is from physical host
This is from VM

We can see that the contents are same. That means share is working. But this is not persistent yet. We need to give the following entry in /etc/fstab file in order to persistent it.

# Use shared folders between VMWare guest and host
.host:/Vmware_Share_Folder /mnt/hgfs/shared fuse.vmhgfs-fuse defaults,allow_other,uid=1000 0 0
fstab entry

Now save the file using Esc > :wq and reboot your vm to check. You should access the share after your vm reboots. I hope you like this. Please subscribe below if you find this useful.

LinkedIn:

https://www.linkedin.com/in/md-mahimbin-firoj-7b8a5a113/

YouTube:

https://www.youtube.com/@mahimfiroj1802/videos

--

--